From 1b0ec08af5cd3b3268b5889ba4e30409431434e2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 4 Dec 2015 10:29:21 +0100 Subject: clang-modernize part 6 --- src/mame/machine/315-5838_317-0229_comp.cpp | 20 ++++++++++---------- src/mame/machine/315_5296.cpp | 4 ++-- src/mame/machine/asic65.cpp | 4 ++-- src/mame/machine/balsente.cpp | 4 ++-- src/mame/machine/cdi070.cpp | 4 ++-- src/mame/machine/cdislave.cpp | 16 ++++++++-------- src/mame/machine/decocass_tape.cpp | 4 ++-- src/mame/machine/fd1094.cpp | 8 ++++---- src/mame/machine/gb.cpp | 4 ++-- src/mame/machine/kc.cpp | 16 ++++++++-------- src/mame/machine/megacdcd.cpp | 8 ++++---- src/mame/machine/micropolis.cpp | 14 +++++++------- src/mame/machine/model3.cpp | 8 ++++---- src/mame/machine/msx.cpp | 18 +++++++++--------- src/mame/machine/namcoio.cpp | 4 ++-- src/mame/machine/naomim1.cpp | 4 ++-- src/mame/machine/pce.cpp | 4 ++-- src/mame/machine/pgmprot_igs027a_type1.cpp | 4 ++-- src/mame/machine/pgmprot_igs027a_type3.cpp | 4 ++-- src/mame/machine/rx01.cpp | 8 ++++---- src/mame/machine/segaic16.cpp | 12 ++++++------ src/mame/machine/snes.cpp | 20 ++++++++++---------- src/mame/machine/st0016.cpp | 4 ++-- src/mame/machine/tait8741.cpp | 14 +++++++------- src/mame/machine/taitoio.cpp | 12 ++++++------ src/mame/machine/vectrex.cpp | 4 ++-- 26 files changed, 113 insertions(+), 113 deletions(-) (limited to 'src/mame/machine') diff --git a/src/mame/machine/315-5838_317-0229_comp.cpp b/src/mame/machine/315-5838_317-0229_comp.cpp index d7c33c5afad..cfd38aa7c88 100644 --- a/src/mame/machine/315-5838_317-0229_comp.cpp +++ b/src/mame/machine/315-5838_317-0229_comp.cpp @@ -49,24 +49,24 @@ sega_315_5838_comp_device::sega_315_5838_comp_device(const machine_config &mconf void sega_315_5838_comp_device::device_start() { - for (int i = 0; i < 2; i++) + for (auto & elem : m_channel) { - m_channel[i].m_decathlt_lastcount = 0; - m_channel[i].m_decathlt_prot_uploadmode = 0; - m_channel[i].m_decathlt_prot_uploadoffset = 0; - m_channel[i].m_read_ch.bind_relative_to(*owner()); + elem.m_decathlt_lastcount = 0; + elem.m_decathlt_prot_uploadmode = 0; + elem.m_decathlt_prot_uploadoffset = 0; + elem.m_read_ch.bind_relative_to(*owner()); } } void sega_315_5838_comp_device::device_reset() { - for (int i = 0; i < 2; i++) + for (auto & elem : m_channel) { - m_channel[i].m_srcoffset = 0; - m_channel[i].m_decathlt_lastcount = 0; - m_channel[i].m_decathlt_prot_uploadmode = 0; - m_channel[i].m_decathlt_prot_uploadoffset = 0; + elem.m_srcoffset = 0; + elem.m_decathlt_lastcount = 0; + elem.m_decathlt_prot_uploadmode = 0; + elem.m_decathlt_prot_uploadoffset = 0; } m_protstate = 0; diff --git a/src/mame/machine/315_5296.cpp b/src/mame/machine/315_5296.cpp index 18551b95f23..34aa0da1d22 100644 --- a/src/mame/machine/315_5296.cpp +++ b/src/mame/machine/315_5296.cpp @@ -105,8 +105,8 @@ void sega_315_5296_device::device_reset() for (int i = 0; i < 8; i++) (*m_out_port_cb[i])((offs_t)i, 0); - for (int i = 0; i < 3; i++) - (*m_out_cnt_cb[i])(0); + for (auto & elem : m_out_cnt_cb) + (*elem)(0); } diff --git a/src/mame/machine/asic65.cpp b/src/mame/machine/asic65.cpp index 5674adfd49e..3ad34f5e32a 100644 --- a/src/mame/machine/asic65.cpp +++ b/src/mame/machine/asic65.cpp @@ -102,9 +102,9 @@ asic65_device::asic65_device(const machine_config &mconfig, const char *tag, dev m_tdata(0), m_log(nullptr) { - for (int i = 0; i < 32; i++) + for (auto & elem : m_param) { - m_param[i] = 0; + elem = 0; } } diff --git a/src/mame/machine/balsente.cpp b/src/mame/machine/balsente.cpp index d9bde8cb7ae..8eceeffa417 100644 --- a/src/mame/machine/balsente.cpp +++ b/src/mame/machine/balsente.cpp @@ -925,8 +925,8 @@ WRITE8_MEMBER(balsente_state::balsente_counter_control_w) /* bit D0 enables/disables audio */ if (diff_counter_control & 0x01) { - for (int ch = 0; ch < 6; ch++) - m_cem_device[ch]->set_output_gain(0, (data & 0x01) ? 1.0 : 0); + for (auto & elem : m_cem_device) + elem->set_output_gain(0, (data & 0x01) ? 1.0 : 0); } /* bit D1 is hooked to counter 0's gate */ diff --git a/src/mame/machine/cdi070.cpp b/src/mame/machine/cdi070.cpp index 36b41333b7d..cc8f377d76a 100644 --- a/src/mame/machine/cdi070.cpp +++ b/src/mame/machine/cdi070.cpp @@ -426,9 +426,9 @@ void cdi68070_device::mcu_frame() { quizard_calculate_state(); uart_rx(0x5a); - for(int index = 0; index < 8; index++) + for(auto & elem : m_state) { - uart_rx(m_state[index]); + uart_rx(elem); } } } diff --git a/src/mame/machine/cdislave.cpp b/src/mame/machine/cdislave.cpp index fea5c7ef2ac..ac9d4fe706f 100644 --- a/src/mame/machine/cdislave.cpp +++ b/src/mame/machine/cdislave.cpp @@ -484,15 +484,15 @@ void cdislave_device::device_start() void cdislave_device::device_reset() { - for(INT32 index = 0; index < 4; index++) + for(auto & elem : m_channel) { - m_channel[index].m_out_buf[0] = 0; - m_channel[index].m_out_buf[1] = 0; - m_channel[index].m_out_buf[2] = 0; - m_channel[index].m_out_buf[3] = 0; - m_channel[index].m_out_index = 0; - m_channel[index].m_out_count = 0; - m_channel[index].m_out_cmd = 0; + elem.m_out_buf[0] = 0; + elem.m_out_buf[1] = 0; + elem.m_out_buf[2] = 0; + elem.m_out_buf[3] = 0; + elem.m_out_index = 0; + elem.m_out_count = 0; + elem.m_out_cmd = 0; } memset(m_in_buf, 0, 17); diff --git a/src/mame/machine/decocass_tape.cpp b/src/mame/machine/decocass_tape.cpp index 48c9fd310ee..8b3f2785032 100644 --- a/src/mame/machine/decocass_tape.cpp +++ b/src/mame/machine/decocass_tape.cpp @@ -67,8 +67,8 @@ decocass_tape_device::decocass_tape_device(const machine_config &mconfig, const m_clockpos(0), m_numclocks(0) { - for (int i = 0; i < 256; i++) - m_crc16[i] = 0; + for (auto & elem : m_crc16) + elem = 0; } //------------------------------------------------- diff --git a/src/mame/machine/fd1094.cpp b/src/mame/machine/fd1094.cpp index 4d0992ef30e..6fb0f8b866e 100644 --- a/src/mame/machine/fd1094.cpp +++ b/src/mame/machine/fd1094.cpp @@ -500,8 +500,8 @@ fd1094_decryption_cache::fd1094_decryption_cache(fd1094_device &fd1094) void fd1094_decryption_cache::reset() { // reset all allocated cache buffers - for (int cache = 0; cache < 256; cache++) - m_decrypted_opcodes[cache].clear(); + for (auto & elem : m_decrypted_opcodes) + elem.clear(); } @@ -570,9 +570,9 @@ fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, dev // create the initial masked opcode table memset(m_masked_opcodes_lookup, 0, sizeof(m_masked_opcodes_lookup)); - for (int index = 0; index < ARRAY_LENGTH(s_masked_opcodes); index++) + for (auto opcode : s_masked_opcodes) { - UINT16 opcode = s_masked_opcodes[index]; + m_masked_opcodes_lookup[0][opcode >> 4] |= 1 << ((opcode >> 1) & 7); m_masked_opcodes_lookup[1][opcode >> 4] |= 1 << ((opcode >> 1) & 7); } diff --git a/src/mame/machine/gb.cpp b/src/mame/machine/gb.cpp index 187cea04d72..3b77d56b403 100644 --- a/src/mame/machine/gb.cpp +++ b/src/mame/machine/gb.cpp @@ -226,8 +226,8 @@ MACHINE_RESET_MEMBER(gb_state,gbc) /* Enable BIOS rom */ m_bios_disable = 0; - for (int i = 0; i < 8; i++) - memset(m_gbc_rammap[i], 0, 0x1000); + for (auto & elem : m_gbc_rammap) + memset(elem, 0, 0x1000); } MACHINE_RESET_MEMBER(gb_state,sgb) diff --git a/src/mame/machine/kc.cpp b/src/mame/machine/kc.cpp index 1f8c0d95ed2..d4374e31c45 100644 --- a/src/mame/machine/kc.cpp +++ b/src/mame/machine/kc.cpp @@ -84,8 +84,8 @@ READ8_MEMBER( kc_state::expansion_read ) // assert MEI line of first slot m_expansions[0]->mei_w(ASSERT_LINE); - for (int i=0; i<3; i++) - m_expansions[i]->read(offset, result); + for (auto & elem : m_expansions) + elem->read(offset, result); return result; } @@ -95,8 +95,8 @@ WRITE8_MEMBER( kc_state::expansion_write ) // assert MEI line of first slot m_expansions[0]->mei_w(ASSERT_LINE); - for (int i=0; i<3; i++) - m_expansions[i]->write(offset, data); + for (auto & elem : m_expansions) + elem->write(offset, data); } /* @@ -129,8 +129,8 @@ READ8_MEMBER( kc_state::expansion_io_read ) } else { - for (int i=0; i<3; i++) - m_expansions[i]->io_read(offset, result); + for (auto & elem : m_expansions) + elem->io_read(offset, result); } return result; @@ -152,8 +152,8 @@ WRITE8_MEMBER( kc_state::expansion_io_write ) } else { - for (int i=0; i<3; i++) - m_expansions[i]->io_write(offset, data); + for (auto & elem : m_expansions) + elem->io_write(offset, data); } } diff --git a/src/mame/machine/megacdcd.cpp b/src/mame/machine/megacdcd.cpp index 54c7d3c81a2..0fd65a3d2c0 100644 --- a/src/mame/machine/megacdcd.cpp +++ b/src/mame/machine/megacdcd.cpp @@ -23,10 +23,10 @@ lc89510_temp_device::lc89510_temp_device(const machine_config &mconfig, const ch is_neoCD = false; nff0002 = 0; - for (int i=0;i<10;i++) - CDD_TX[i] = 0; - for (int i=0;i<10;i++) - CDD_RX[i] = 0; + for (auto & elem : CDD_TX) + elem = 0; + for (auto & elem : CDD_RX) + elem = 0; NeoCDCommsWordCount = 0; NeoCD_StatusHack = 0; SCD_CURLBA = 0; diff --git a/src/mame/machine/micropolis.cpp b/src/mame/machine/micropolis.cpp index 9cf03159e18..a42c692718c 100644 --- a/src/mame/machine/micropolis.cpp +++ b/src/mame/machine/micropolis.cpp @@ -82,11 +82,11 @@ micropolis_device::micropolis_device(const machine_config &mconfig, const char * m_sector_length(0), m_drive(nullptr) { - for (int i = 0; i < 6144; i++) - m_buffer[i] = 0; + for (auto & elem : m_buffer) + elem = 0; - for (int i = 0; i < 4; i++) - m_floppy_drive_tags[i] = nullptr; + for (auto & elem : m_floppy_drive_tags) + elem = nullptr; } //------------------------------------------------- @@ -118,11 +118,11 @@ void micropolis_device::device_start() void micropolis_device::device_reset() { - for (int i = 0; i < 4; i++) + for (auto & elem : m_floppy_drive_tags) { - if (m_floppy_drive_tags[i]) + if (elem) { - legacy_floppy_image_device *img = siblingdevice(m_floppy_drive_tags[i]); + legacy_floppy_image_device *img = siblingdevice(elem); if (img) { diff --git a/src/mame/machine/model3.cpp b/src/mame/machine/model3.cpp index 12826528efe..1cfb25e48f8 100644 --- a/src/mame/machine/model3.cpp +++ b/src/mame/machine/model3.cpp @@ -154,9 +154,9 @@ void model3_state::tap_write(int tck, int tms, int tdi, int trst) if (m_ir == U64(0x000023fffffffffe)) { - for (int i=0; i < 32; i++) + for (auto & elem : m_id_data) { - m_id_data[i] = 0; + elem = 0; } m_id_size = 41; @@ -237,9 +237,9 @@ void model3_state::tap_set_asic_ids() * data on TAP reset and when the instruction is issued. */ - for (int i=0; i < 32; i++) + for (auto & elem : m_id_data) { - m_id_data[i] = 0; + elem = 0; } if (m_m3_step == 0x10) diff --git a/src/mame/machine/msx.cpp b/src/mame/machine/msx.cpp index 11402a50c40..b881ad38d4d 100644 --- a/src/mame/machine/msx.cpp +++ b/src/mame/machine/msx.cpp @@ -31,9 +31,9 @@ void msx_state::check_irq() { int state = CLEAR_LINE; - for (int i = 0; i < ARRAY_LENGTH(m_irq_state); i++) + for (auto & elem : m_irq_state) { - if (m_irq_state[i] != CLEAR_LINE) + if (elem != CLEAR_LINE) { state = ASSERT_LINE; } @@ -47,9 +47,9 @@ void msx_state::machine_reset() { msx_memory_reset (); msx_memory_map_all (); - for (int i = 0; i < ARRAY_LENGTH(m_irq_state); i++) + for (auto & elem : m_irq_state) { - m_irq_state[i] = CLEAR_LINE; + elem = CLEAR_LINE; } check_irq(); } @@ -401,15 +401,15 @@ void msx_state::msx_memory_init() int count_populated_pages = 0; // Populate all unpopulated slots with the dummy interface - for ( int prim = 0; prim < 4; prim++ ) + for (auto & elem : m_all_slots) { for ( int sec = 0; sec < 4; sec++ ) { for ( int page = 0; page < 4; page++ ) { - if ( m_all_slots[prim][sec][page] == nullptr ) + if ( elem[sec][page] == nullptr ) { - m_all_slots[prim][sec][page] = &m_empty_slot; + elem[sec][page] = &m_empty_slot; } else { @@ -428,9 +428,9 @@ void msx_state::msx_memory_reset () { m_primary_slot = 0; - for (int prim=0; prim<4; prim++) + for (auto & elem : m_secondary_slot) { - m_secondary_slot[prim] = 0; + elem = 0; } } diff --git a/src/mame/machine/namcoio.cpp b/src/mame/machine/namcoio.cpp index b8fb22fef40..4ac534279ce 100644 --- a/src/mame/machine/namcoio.cpp +++ b/src/mame/machine/namcoio.cpp @@ -181,8 +181,8 @@ void namcoio_device::device_start() void namcoio_device::device_reset() { - for (int i = 0; i < 16; i++) - m_ram[i] = 0; + for (auto & elem : m_ram) + elem = 0; set_reset_line(PULSE_LINE); } diff --git a/src/mame/machine/naomim1.cpp b/src/mame/machine/naomim1.cpp index 5b16f278fb7..c9e5bc1c359 100644 --- a/src/mame/machine/naomim1.cpp +++ b/src/mame/machine/naomim1.cpp @@ -159,8 +159,8 @@ void naomi_m1_board::enc_reset() has_history = false; buffer_actual_size = 0; - for(int i=0; i<111; i++) - dict[i] = getb(8); + for(auto & elem : dict) + elem = getb(8); } void naomi_m1_board::wb(UINT8 byte) diff --git a/src/mame/machine/pce.cpp b/src/mame/machine/pce.cpp index 6aeba853933..ad5d712367c 100644 --- a/src/mame/machine/pce.cpp +++ b/src/mame/machine/pce.cpp @@ -110,8 +110,8 @@ MACHINE_START_MEMBER(pce_state,pce) MACHINE_RESET_MEMBER(pce_state,mess_pce) { - for (int joy_i = 0; joy_i < 5; joy_i++) - m_joy_6b_packet[joy_i] = 0; + for (auto & elem : m_joy_6b_packet) + elem = 0; /* Note: Arcade Card BIOS contents are the same as System 3, only internal HW differs. We use a category to select between modes (some games can be run in either S-CD or A-CD modes) */ diff --git a/src/mame/machine/pgmprot_igs027a_type1.cpp b/src/mame/machine/pgmprot_igs027a_type1.cpp index 096d1135c2b..84b7bfc5de6 100644 --- a/src/mame/machine/pgmprot_igs027a_type1.cpp +++ b/src/mame/machine/pgmprot_igs027a_type1.cpp @@ -881,9 +881,9 @@ void pgm_arm_type1_state::command_handler_puzzli2(int pc) m_valueresponse = 0x36<<16; // clear the return structure - for (int columns=0;columns<8;columns++) + for (auto & elem : level_structure) for (int rows=0;rows<10;rows++) - level_structure[columns][rows] = 0x0000; + elem[rows] = 0x0000; break; diff --git a/src/mame/machine/pgmprot_igs027a_type3.cpp b/src/mame/machine/pgmprot_igs027a_type3.cpp index 8faa5fc4432..24fc0c19ccd 100644 --- a/src/mame/machine/pgmprot_igs027a_type3.cpp +++ b/src/mame/machine/pgmprot_igs027a_type3.cpp @@ -566,10 +566,10 @@ void pgm_arm_type3_state::pgm_patch_external_arm_rom_jumptable_theglada(int base */ - for (int i = 0; i < 131; i++) + for (auto & subroutine_addresse : subroutine_addresses) { // UINT32 addr = extprot[(base/2)] | (extprot[(base/2) + 1] << 16); - extprot[(base / 2)] = subroutine_addresses[i]; + extprot[(base / 2)] = subroutine_addresse; base += 4; // printf("%04x (%08x)\n", subroutine_addresses[i], addr ); diff --git a/src/mame/machine/rx01.cpp b/src/mame/machine/rx01.cpp index c1889eb6a8b..b4cb85869ea 100644 --- a/src/mame/machine/rx01.cpp +++ b/src/mame/machine/rx01.cpp @@ -80,11 +80,11 @@ void rx01_device::device_start() void rx01_device::device_reset() { - for(int i=0;i<2;i++) + for(auto & elem : m_image) { - m_image[i]->floppy_mon_w(0); // turn it on - m_image[i]->floppy_drive_set_controller(this); - m_image[i]->floppy_drive_set_rpm(360.); + elem->floppy_mon_w(0); // turn it on + elem->floppy_drive_set_controller(this); + elem->floppy_drive_set_rpm(360.); } m_rxes = 0; m_rxcs = 0; diff --git a/src/mame/machine/segaic16.cpp b/src/mame/machine/segaic16.cpp index ee171e9af70..3d807412a56 100644 --- a/src/mame/machine/segaic16.cpp +++ b/src/mame/machine/segaic16.cpp @@ -487,8 +487,8 @@ void sega_315_5195_mapper_device::configure_explicit(const UINT8 *map_data) void sega_315_5195_mapper_device::fd1094_state_change(UINT8 state) { // iterate over regions and set the decrypted address of any ROM banks - for (int index = 0; index < ARRAY_LENGTH(m_banks); index++) - m_banks[index].update(); + for (auto & elem : m_banks) + elem.update(); } @@ -511,16 +511,16 @@ void sega_315_5195_mapper_device::device_start() // if we are mapping an FD1089, tell all the banks fd1089_base_device *fd1089 = dynamic_cast(m_cpu); if (fd1089 != nullptr) - for (int banknum = 0; banknum < ARRAY_LENGTH(m_banks); banknum++) - m_banks[banknum].set_decrypt(fd1089); + for (auto & elem : m_banks) + elem.set_decrypt(fd1089); // if we are mapping an FD1094, register for state change notifications and tell all the banks fd1094_device *fd1094 = dynamic_cast(m_cpu); if (fd1094 != nullptr) { fd1094->notify_state_change(fd1094_device::state_change_delegate(FUNC(sega_315_5195_mapper_device::fd1094_state_change), this)); - for (int banknum = 0; banknum < ARRAY_LENGTH(m_banks); banknum++) - m_banks[banknum].set_decrypt(fd1094); + for (auto & elem : m_banks) + elem.set_decrypt(fd1094); } // find the address space that is to be mapped diff --git a/src/mame/machine/snes.cpp b/src/mame/machine/snes.cpp index 30b125f94fa..9c4253906e2 100644 --- a/src/mame/machine/snes.cpp +++ b/src/mame/machine/snes.cpp @@ -1123,17 +1123,17 @@ void snes_state::machine_reset() snes_init_ram(); /* init DMA regs to be 0xff */ - for (int i = 0; i < 8; i++) + for (auto & elem : m_dma_channel) { - m_dma_channel[i].dmap = 0xff; - m_dma_channel[i].dest_addr = 0xff; - m_dma_channel[i].src_addr = 0xffff; - m_dma_channel[i].bank = 0xff; - m_dma_channel[i].trans_size = 0xffff; - m_dma_channel[i].ibank = 0xff; - m_dma_channel[i].hdma_addr = 0xffff; - m_dma_channel[i].hdma_line_counter = 0xff; - m_dma_channel[i].unk = 0xff; + elem.dmap = 0xff; + elem.dest_addr = 0xff; + elem.src_addr = 0xffff; + elem.bank = 0xff; + elem.trans_size = 0xffff; + elem.ibank = 0xff; + elem.hdma_addr = 0xffff; + elem.hdma_line_counter = 0xff; + elem.unk = 0xff; } /* Set STAT78 to NTSC or PAL */ diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp index 3abdc4eafaf..08959876e99 100644 --- a/src/mame/machine/st0016.cpp +++ b/src/mame/machine/st0016.cpp @@ -49,8 +49,8 @@ st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char * m_palette(*this, "palette") { - for (int i = 0; i < 0xc0; i++) - st0016_vregs[i] = 0; + for (auto & elem : st0016_vregs) + elem = 0; } diff --git a/src/mame/machine/tait8741.cpp b/src/mame/machine/tait8741.cpp index 58df20ca4ed..5e568fbd6f1 100644 --- a/src/mame/machine/tait8741.cpp +++ b/src/mame/machine/tait8741.cpp @@ -381,15 +381,15 @@ void josvolly8741_4pack_device::device_reset() { m_nmi_enable = 0; - for(int i=0;i<4;i++) + for(auto & elem : m_i8741) { - m_i8741[i].cmd = 0; - m_i8741[i].sts = 0; // 0xf0; /* init flag */ - m_i8741[i].txd = 0; - m_i8741[i].outport = 0xff; - m_i8741[i].rxd = 0; + elem.cmd = 0; + elem.sts = 0; // 0xf0; /* init flag */ + elem.txd = 0; + elem.outport = 0xff; + elem.rxd = 0; - m_i8741[i].rst = 1; + elem.rst = 1; } } diff --git a/src/mame/machine/taitoio.cpp b/src/mame/machine/taitoio.cpp index 4b15fa06932..6d2bcadd9b0 100644 --- a/src/mame/machine/taitoio.cpp +++ b/src/mame/machine/taitoio.cpp @@ -90,8 +90,8 @@ void tc0220ioc_device::device_reset() { m_port = 0; - for (int i = 0; i < 8; i++) - m_regs[i] = 0; + for (auto & elem : m_regs) + elem = 0; } /***************************************************************************** @@ -213,8 +213,8 @@ void tc0510nio_device::device_start() void tc0510nio_device::device_reset() { - for (int i = 0; i < 8; i++) - m_regs[i] = 0; + for (auto & elem : m_regs) + elem = 0; } /***************************************************************************** @@ -340,8 +340,8 @@ void tc0640fio_device::device_start() void tc0640fio_device::device_reset() { - for (int i = 0; i < 8; i++) - m_regs[i] = 0; + for (auto & elem : m_regs) + elem = 0; } diff --git a/src/mame/machine/vectrex.cpp b/src/mame/machine/vectrex.cpp index ca64a1cd23c..4959c3de5f1 100644 --- a/src/mame/machine/vectrex.cpp +++ b/src/mame/machine/vectrex.cpp @@ -306,8 +306,8 @@ DRIVER_INIT_MEMBER(vectrex_state,vectrex) { m_imager_angles = unknown_game_angles; m_beam_color = rgb_t::white; - for (int i = 0; i < ARRAY_LENGTH(m_imager_colors); i++) - m_imager_colors[i] = rgb_t::white; + for (auto & elem : m_imager_colors) + elem = rgb_t::white; /* * Minestorm's PRNG doesn't work with a 0 seed (mines in the first -- cgit v1.2.3