diff options
author | 2021-02-14 11:05:57 -0500 | |
---|---|---|
committer | 2021-02-14 11:05:57 -0500 | |
commit | bc0146c2038c46f789a246d5616afd7c425157f3 (patch) | |
tree | b4d39194034b4c6e56ccd4035d25636034be43ca /src/mame/machine/fddebug.cpp | |
parent | 91310bcdeb7ab0ff661738b212017bf836f4e8ad (diff) |
Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h
* sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration
* gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset
* emucore.h: Remove obsolete typedef
Diffstat (limited to 'src/mame/machine/fddebug.cpp')
-rw-r--r-- | src/mame/machine/fddebug.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mame/machine/fddebug.cpp b/src/mame/machine/fddebug.cpp index 1e186468e12..572741083c9 100644 --- a/src/mame/machine/fddebug.cpp +++ b/src/mame/machine/fddebug.cpp @@ -571,7 +571,7 @@ static void set_default_key_params(running_machine &machine) int keynum; /* look for a matching game and set the key appropriately */ - for (keynum = 0; keynum < ARRAY_LENGTH(default_keys); keynum++) + for (keynum = 0; keynum < std::size(default_keys); keynum++) if (strcmp(machine.system().name, default_keys[keynum].gamename) == 0) { fd1094_global = default_keys[keynum].global; @@ -1873,8 +1873,8 @@ static uint32_t reconstruct_base_seed(int keybaseaddr, uint32_t startseed) { seed = seed * 0x29; seed += seed << 16; - window[index++ % ARRAY_LENGTH(window)] = seed; - } while (((startseed ^ seed) & 0x3fffff) != 0 || index < ARRAY_LENGTH(window)); + window[index++ % std::size(window)] = seed; + } while (((startseed ^ seed) & 0x3fffff) != 0 || index < std::size(window)); /* when we break, we have overshot */ index--; @@ -1882,10 +1882,10 @@ static uint32_t reconstruct_base_seed(int keybaseaddr, uint32_t startseed) /* back up to where we would have been at address 3 */ index -= keybaseaddr - 3; if (index < 0) - index += ARRAY_LENGTH(window); + index += std::size(window); /* return the value from the window at that location */ - return window[index % ARRAY_LENGTH(window)] & 0x3fffff; + return window[index % std::size(window)] & 0x3fffff; } @@ -2095,7 +2095,7 @@ static void build_optable(running_machine &machine) } /* now iterate over entries in our intruction table */ - for (inum = 0; inum < ARRAY_LENGTH(instr_table); inum++) + for (inum = 0; inum < std::size(instr_table); inum++) { const char *bitstring = instr_table[inum].bitstring; const char *eastring = instr_table[inum].eastring; |