From d1dc775f9b686170416fbca6a615fbea108d0ff1 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 11 Nov 2015 16:31:18 +0100 Subject: Some cleanups and init fixes with help of ReSharper C++ (nw) --- src/emu/render.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/emu/render.cpp') diff --git a/src/emu/render.cpp b/src/emu/render.cpp index f9e55bf9abe..230b5978e4e 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -2500,8 +2500,8 @@ render_target *render_manager::target_by_index(int index) const float render_manager::ui_aspect(render_container *rc) { - int orient = 0; - float aspect = 1.0f; + int orient; + float aspect; if (rc == m_ui_container || rc == NULL) { // ui container, aggregated multi-screen target -- cgit v1.2.3-70-g09d2 From 61d05aacb8e680d998ffccd9306b859555db5d26 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Nov 2015 12:54:08 +0100 Subject: Fixed some suggestions by ReSharper C++ (nw) --- src/devices/video/poly.h | 10 +++++----- src/emu/debug/debugcmd.cpp | 2 +- src/emu/debug/debugcpu.cpp | 8 ++++---- src/emu/debug/dvmemory.cpp | 2 +- src/emu/debug/dvwpoints.cpp | 2 +- src/emu/dimemory.cpp | 2 +- src/emu/input.cpp | 24 ++++++++++++------------ src/emu/ioport.cpp | 30 +++++++++++++++--------------- src/emu/luaengine.cpp | 2 +- src/emu/memory.cpp | 20 ++++++++++---------- src/emu/profiler.cpp | 6 +++--- src/emu/render.cpp | 6 +++--- src/emu/rendlay.cpp | 6 +++--- src/emu/tilemap.cpp | 6 +++--- src/emu/ui/inputmap.cpp | 4 ++-- src/emu/ui/ui.cpp | 6 +++--- src/emu/uiinput.cpp | 2 +- 17 files changed, 69 insertions(+), 69 deletions(-) (limited to 'src/emu/render.cpp') diff --git a/src/devices/video/poly.h b/src/devices/video/poly.h index c73fcbd3829..058a6c793a2 100644 --- a/src/devices/video/poly.h +++ b/src/devices/video/poly.h @@ -1002,7 +1002,7 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polyg edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; for (int paramnum = 0; paramnum < paramcount; paramnum++) edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; - edgeptr++; + ++edgeptr; } // walk backward to build up the backward edge list @@ -1023,7 +1023,7 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polyg edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; for (int paramnum = 0; paramnum < paramcount; paramnum++) edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; - edgeptr++; + ++edgeptr; } // determine which list is left/right: @@ -1068,9 +1068,9 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polyg // compute the ending X based on which part of the triangle we're in _BaseType fully = _BaseType(curscan + extnum) + _BaseType(0.5); while (fully > ledge->v2->y && fully < v[maxv].y) - ledge++; + ++ledge; while (fully > redge->v2->y && fully < v[maxv].y) - redge++; + ++redge; _BaseType startx = ledge->v1->x + (fully - ledge->v1->y) * ledge->dxdy; _BaseType stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy; @@ -1159,7 +1159,7 @@ int poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::zclip_if_less(i nextout->y = v1.y + frac * (v2.y - v1.y); for (int paramnum = 0; paramnum < paramcount; paramnum++) nextout->p[paramnum] = v1.p[paramnum] + frac * (v2.p[paramnum] - v1.p[paramnum]); - nextout++; + ++nextout; } // if this vertex is not clipped, copy it in diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 6be96923e65..60b25df1928 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -1484,7 +1484,7 @@ static void execute_wplist(running_machine &machine, int ref, int params, const /* loop over all CPUs */ device_iterator iter(machine.root_device()); for (device_t *device = iter.first(); device != NULL; device = iter.next()) - for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum) if (device->debug()->watchpoint_first(spacenum) != NULL) { static const char *const types[] = { "unkn ", "read ", "write", "r/w " }; diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 872ad498e7e..8f399a1117a 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -2377,7 +2377,7 @@ int device_debug::watchpoint_set(address_space &space, int type, offs_t address, bool device_debug::watchpoint_clear(int index) { // scan the list to see if we own this breakpoint - for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum) for (watchpoint **wp = &m_wplist[spacenum]; *wp != NULL; wp = &(*wp)->m_next) if ((*wp)->m_index == index) { @@ -2401,7 +2401,7 @@ bool device_debug::watchpoint_clear(int index) void device_debug::watchpoint_clear_all() { // clear the head until we run out - for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum) while (m_wplist[spacenum] != NULL) watchpoint_clear(m_wplist[spacenum]->index()); } @@ -2415,7 +2415,7 @@ void device_debug::watchpoint_clear_all() bool device_debug::watchpoint_enable(int index, bool enable) { // scan the list to see if we own this watchpoint - for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum) for (watchpoint *wp = m_wplist[spacenum]; wp != NULL; wp = wp->next()) if (wp->m_index == index) { @@ -2437,7 +2437,7 @@ bool device_debug::watchpoint_enable(int index, bool enable) void device_debug::watchpoint_enable_all(bool enable) { // apply the enable to all watchpoints we own - for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum) for (watchpoint *wp = m_wplist[spacenum]; wp != NULL; wp = wp->next()) watchpoint_enable(wp->index(), enable); } diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index a81e032ce48..1e2e0648326 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -133,7 +133,7 @@ void debug_view_memory::enumerate_sources() memory_interface_iterator iter(machine().root_device()); for (device_memory_interface *memintf = iter.first(); memintf != NULL; memintf = iter.next()) if (&memintf->device() != &machine().root_device()) - for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum) if (memintf->has_space(spacenum)) { address_space &space = memintf->space(spacenum); diff --git a/src/emu/debug/dvwpoints.cpp b/src/emu/debug/dvwpoints.cpp index 2e5f89b24f3..c09cff91bf3 100644 --- a/src/emu/debug/dvwpoints.cpp +++ b/src/emu/debug/dvwpoints.cpp @@ -231,7 +231,7 @@ void debug_view_watchpoints::gather_watchpoints() { // Collect device_debug &debugInterface = *source->device()->debug(); - for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum) { for (device_debug::watchpoint *wp = debugInterface.watchpoint_first(spacenum); wp != NULL; wp = wp->next()) m_buffer.push_back(wp); diff --git a/src/emu/dimemory.cpp b/src/emu/dimemory.cpp index c10584817cb..0306774feae 100644 --- a/src/emu/dimemory.cpp +++ b/src/emu/dimemory.cpp @@ -241,7 +241,7 @@ void device_memory_interface::interface_validity_check(validity_checker &valid) bool detected_overlap = DETECT_OVERLAPPING_MEMORY ? false : true; // loop over all address spaces - for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum) { const address_space_config *spaceconfig = space_config(spacenum); if (spaceconfig != NULL) diff --git a/src/emu/input.cpp b/src/emu/input.cpp index e24501afde0..5495a5054f8 100644 --- a/src/emu/input.cpp +++ b/src/emu/input.cpp @@ -834,7 +834,7 @@ input_item_id input_device::add_item(const char *name, input_item_id itemid, ite // if we have a generic ID, pick a new internal one input_item_id originalid = itemid; if (itemid >= ITEM_ID_OTHER_SWITCH && itemid <= ITEM_ID_OTHER_AXIS_RELATIVE) - for (itemid = (input_item_id)(ITEM_ID_MAXIMUM + 1); itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; itemid++) + for (itemid = (input_item_id)(ITEM_ID_MAXIMUM + 1); itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; ++itemid) if (m_item[itemid] == NULL) break; assert(itemid <= ITEM_ID_ABSOLUTE_MAXIMUM); @@ -920,7 +920,7 @@ void input_device::apply_steadykey() const // update the state of all the keys and see if any changed state bool anything_changed = false; - for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; itemid++) + for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; ++itemid) { input_device_item *item = m_item[itemid]; if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH) @@ -930,7 +930,7 @@ void input_device::apply_steadykey() const // if the keyboard state is stable, flush the current state if (!anything_changed) - for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; itemid++) + for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; ++itemid) { input_device_item *item = m_item[itemid]; if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH) @@ -1183,7 +1183,7 @@ void input_manager::reset_polling() reset_memory(); // iterate over device classes and devices - for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++) + for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { // fetch the device; ignore if NULL @@ -1192,7 +1192,7 @@ void input_manager::reset_polling() continue; // iterate over items within each device - for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++) + for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid) { // for any non-switch items, set memory equal to the current value input_device_item *item = device->item(itemid); @@ -1210,7 +1210,7 @@ void input_manager::reset_polling() input_code input_manager::poll_switches() { // iterate over device classes and devices - for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++) + for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { // fetch the device; ignore if NULL @@ -1219,7 +1219,7 @@ input_code input_manager::poll_switches() continue; // iterate over items within each device - for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++) + for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid) { input_device_item *item = device->item(itemid); if (item != NULL) @@ -1299,7 +1299,7 @@ input_code input_manager::poll_keyboard_switches() continue; // iterate over items within each device - for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++) + for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid) { input_device_item *item = device->item(itemid); if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH) @@ -1364,7 +1364,7 @@ bool input_manager::code_check_axis(input_device_item &item, input_code code) input_code input_manager::poll_axes() { // iterate over device classes and devices - for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++) + for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { // fetch the device; ignore if NULL @@ -1373,7 +1373,7 @@ input_code input_manager::poll_axes() continue; // iterate over items within each device - for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++) + for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid) { input_device_item *item = device->item(itemid); if (item != NULL && item->itemclass() != ITEM_CLASS_SWITCH) @@ -1445,7 +1445,7 @@ void input_manager::reset_memory() input_code input_manager::code_from_itemid(input_item_id itemid) const { // iterate over device classes and devices - for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++) + for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass) for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) { input_device *device = m_class[devclass]->device(devnum); @@ -1613,7 +1613,7 @@ input_code input_manager::code_from_token(const char *_token) return INPUT_CODE_INVALID; // if not a standard code, look it up in the device specific codes - for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++) + for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid) { input_device_item *item = device->item(itemid); if (item != NULL && token[curtok].compare(item->token()) == 0) diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 70876ee974c..50b27db4779 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -712,7 +712,7 @@ void input_type_entry::configure_osd(const char *token, const char *name) void input_type_entry::restore_default_seq() { - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) m_seq[seqtype] = defseq(seqtype); } @@ -763,7 +763,7 @@ void digital_joystick::frame_update() // read all the associated ports running_machine *machine = NULL; - for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; direction++) + for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; ++direction) for (const simple_list_wrapper *i = m_field[direction].first(); i != NULL; i = i->next()) { machine = &i->object()->machine(); @@ -1477,7 +1477,7 @@ ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value def m_way(0) { // reset sequences and chars - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) m_seq[seqtype].set_default(); m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = unicode_char(0); @@ -1679,7 +1679,7 @@ void ioport_field::get_user_settings(user_settings &settings) memset(&settings, 0, sizeof(settings)); // copy the basics - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) settings.seq[seqtype] = seq(seqtype); // if there's a list of settings or we're an adjuster, copy the current value @@ -1711,7 +1711,7 @@ void ioport_field::get_user_settings(user_settings &settings) void ioport_field::set_user_settings(const user_settings &settings) { // copy the basics - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) { const input_seq &defseq = manager().type_seq(m_type, m_player, input_seq_type(seqtype)); if (defseq == settings.seq[seqtype]) @@ -2159,7 +2159,7 @@ ioport_field_live::ioport_field_live(ioport_field &field, analog_field *analog) joydir(digital_joystick::JOYDIR_COUNT) { // fill in the basic values - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) seq[seqtype] = field.defseq_unresolved(seqtype); // if this is a digital joystick field, make a note of it @@ -2984,7 +2984,7 @@ void ioport_manager::load_config(int config_type, xml_data_node *parentnode) // initialize sequences to invalid defaults input_seq newseq[SEQ_TYPE_TOTAL]; - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) newseq[seqtype].set(INPUT_CODE_INVALID); // loop over new sequences @@ -3012,7 +3012,7 @@ void ioport_manager::load_config(int config_type, xml_data_node *parentnode) // what we will diff against if (config_type == CONFIG_TYPE_CONTROLLER) for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next()) - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) entry->defseq(seqtype) = entry->seq(seqtype); } @@ -3053,7 +3053,7 @@ void ioport_manager::load_remap_table(xml_data_node *parentnode) // loop over the remapping table, then over default ports, replacing old with new for (int remapnum = 0; remapnum < count; remapnum++) for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next()) - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) entry->m_seq[seqtype].replace(oldtable[remapnum], newtable[remapnum]); } } @@ -3070,7 +3070,7 @@ bool ioport_manager::load_default_config(xml_data_node *portnode, int type, int for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next()) if (entry->type() == type && entry->player() == player) { - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) if (newseq[seqtype][0] != INPUT_CODE_INVALID) entry->m_seq[seqtype] = newseq[seqtype]; return true; @@ -3102,7 +3102,7 @@ bool ioport_manager::load_game_config(xml_data_node *portnode, int type, int pla field->mask() == mask && (field->defvalue() & mask) == (defvalue & mask)) { // if a sequence was specified, copy it in - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) if (newseq[seqtype][0] != INPUT_CODE_INVALID) field->live().seq[seqtype] = newseq[seqtype]; @@ -3221,7 +3221,7 @@ void ioport_manager::save_default_inputs(xml_data_node *parentnode) { // see if any of the sequences have changed input_seq_type seqtype; - for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) if (entry->seq(seqtype) != entry->defseq(seqtype)) break; @@ -3237,7 +3237,7 @@ void ioport_manager::save_default_inputs(xml_data_node *parentnode) xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player())); // add only the sequences that have changed from the defaults - for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; type++) + for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; ++type) if (entry->seq(type) != entry->defseq(type)) save_sequence(portnode, type, entry->type(), entry->seq(type)); } @@ -3261,7 +3261,7 @@ void ioport_manager::save_game_inputs(xml_data_node *parentnode) { // determine if we changed bool changed = false; - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) changed |= (field->seq(seqtype) != field->defseq(seqtype)); // non-analog changes @@ -3295,7 +3295,7 @@ void ioport_manager::save_game_inputs(xml_data_node *parentnode) xml_set_attribute_int(portnode, "defvalue", field->defvalue() & field->mask()); // add sequences if changed - for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) if (field->seq(seqtype) != field->defseq(seqtype)) save_sequence(portnode, seqtype, field->type(), field->seq(seqtype)); diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp index 84a215fd16e..e7f00e60126 100644 --- a/src/emu/luaengine.cpp +++ b/src/emu/luaengine.cpp @@ -428,7 +428,7 @@ luabridge::LuaRef lua_engine::l_dev_get_memspaces(const device_t *d) lua_State *L = luaThis->m_lua_state; luabridge::LuaRef sp_table = luabridge::LuaRef::newTable(L); - for (address_spacenum sp = AS_0; sp < ADDRESS_SPACES; sp++) { + for (address_spacenum sp = AS_0; sp < ADDRESS_SPACES; ++sp) { if (dev->memory().has_space(sp)) { sp_table[dev->memory().space(sp).name()] = &(dev->memory().space(sp)); } diff --git a/src/emu/memory.cpp b/src/emu/memory.cpp index f9e5e27cb1b..c9767bcd592 100644 --- a/src/emu/memory.cpp +++ b/src/emu/memory.cpp @@ -484,13 +484,13 @@ public: // forward delegate callbacks configuration template void set_delegate(_delegate delegate) const { - for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) + for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); ++i) (*i)->set_delegate(delegate, mask); } // forward I/O port access configuration void set_ioport(ioport_port &ioport) const { - for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) + for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); ++i) (*i)->set_ioport(ioport); } @@ -661,7 +661,7 @@ public: std::list entries; setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); std::list handlers; - for (std::list::const_iterator i = entries.begin(); i != entries.end(); i++) + for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) handlers.push_back(&handler_read(*i)); return handler_entry_proxy(handlers, mask); } @@ -734,7 +734,7 @@ public: std::list entries; setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); std::list handlers; - for (std::list::const_iterator i = entries.begin(); i != entries.end(); i++) + for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) handlers.push_back(&handler_write(*i)); return handler_entry_proxy(handlers, mask); } @@ -812,7 +812,7 @@ public: std::list entries; setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); std::list handlers; - for (std::list::const_iterator i = entries.begin(); i != entries.end(); i++) + for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) handlers.push_back(&handler_setoffset(*i)); return handler_entry_proxy(handlers, mask); } @@ -1524,7 +1524,7 @@ void memory_manager::initialize() // loop over devices and spaces within each device memory_interface_iterator iter(machine().root_device()); for (device_memory_interface *memory = iter.first(); memory != NULL; memory = iter.next()) - for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++) + for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum) { // if there is a configuration for this space, we need an address space const address_space_config *spaceconfig = memory->space_config(spacenum); @@ -1911,7 +1911,7 @@ void address_space::populate_from_map(address_map *map) { // find the entry before the last one we processed const address_map_entry *entry; - for (entry = map->m_entrylist.first(); entry->next() != last_entry; entry = entry->next()) ; + for (entry = map->m_entrylist.first(); entry->next() != last_entry; entry = entry->next()) { }; last_entry = entry; // map both read and write halves @@ -2869,7 +2869,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t curentry.configure(bytestart, byteend, bytemask); // Populate it wherever needed - for (std::list::const_iterator i = range_override.begin(); i != range_override.end(); i++) + for (std::list::const_iterator i = range_override.begin(); i != range_override.end(); ++i) populate_range(i->start, i->end, entry); // Add it in the "to be setup" list @@ -2882,7 +2882,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t // Ranges in range_partial must duplicated then partially changed if (!range_partial.empty()) { - for (std::map >::const_iterator i = range_partial.begin(); i != range_partial.end(); i++) + for (std::map >::const_iterator i = range_partial.begin(); i != range_partial.end(); ++i) { // Theorically, if the handler to change matches the // characteristics of ours, we can directly change it. In @@ -2912,7 +2912,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t curentry.configure(bytestart, byteend, bytemask); // Populate it wherever needed - for (std::list::const_iterator j = i->second.begin(); j != i->second.end(); j++) + for (std::list::const_iterator j = i->second.begin(); j != i->second.end(); ++j) populate_range(j->start, j->end, entry); // Add it in the "to be setup" list diff --git a/src/emu/profiler.cpp b/src/emu/profiler.cpp index 50e289e8d46..668d57964c2 100644 --- a/src/emu/profiler.cpp +++ b/src/emu/profiler.cpp @@ -175,12 +175,12 @@ void real_profiler_state::update_text(running_machine &machine) // compute the total time for all bits, not including profiler or idle UINT64 computed = 0; profile_type curtype; - for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_PROFILER; curtype++) + for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_PROFILER; ++curtype) computed += m_data[curtype]; // save that result in normalize, and continue adding the rest UINT64 normalize = computed; - for ( ; curtype < PROFILER_TOTAL; curtype++) + for ( ; curtype < PROFILER_TOTAL; ++curtype) computed += m_data[curtype]; // this becomes the total; if we end up with 0 for anything, we were just started, so return empty @@ -193,7 +193,7 @@ void real_profiler_state::update_text(running_machine &machine) // loop over all types and generate the string device_iterator iter(machine.root_device()); - for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_TOTAL; curtype++) + for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_TOTAL; ++curtype) { // determine the accumulated time for this type computed = m_data[curtype]; diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 230b5978e4e..c86b3f914c5 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -1204,7 +1204,7 @@ void render_target::compute_minimum_size(INT32 &minwidth, INT32 &minheight) throw emu_fatalerror("Mandatory artwork is missing"); // scan the current view for all screens - for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) + for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer) // iterate over items in the layer for (layout_view::item *curitem = m_curview->first_item(layer); curitem != NULL; curitem = curitem->next()) @@ -1287,7 +1287,7 @@ render_primitive_list &render_target::get_primitives() // iterate over layers back-to-front, but only if we're running if (m_manager.machine().phase() >= MACHINE_PHASE_RESET) - for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; layernum++) + for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; ++layernum) { int blendmode; item_layer layer = get_layer_and_blendmode(*m_curview, layernum, blendmode); @@ -1916,7 +1916,7 @@ bool render_target::map_point_internal(INT32 target_x, INT32 target_y, render_co } // loop through each layer - for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; layernum++) + for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; ++layernum) { int blendmode; item_layer layer = get_layer_and_blendmode(*m_curview, layernum, blendmode); diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 847dc8ec1d6..9f53cf86255 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -2216,7 +2216,7 @@ void layout_view::recompute(render_layer_config layerconfig) // loop over all layers bool first = true; bool scrfirst = true; - for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) + for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer) { // determine if this layer should be visible switch (layer) @@ -2291,7 +2291,7 @@ void layout_view::recompute(render_layer_config layerconfig) float yscale = (target_bounds.y1 - target_bounds.y0) / (m_bounds.y1 - m_bounds.y0); // normalize all the item bounds - for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) + for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer) for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next()) { curitem->m_bounds.x0 = target_bounds.x0 + (curitem->m_rawbounds.x0 - xoffs) * xscale; @@ -2308,7 +2308,7 @@ void layout_view::recompute(render_layer_config layerconfig) void layout_view::resolve_tags() { - for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) + for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer) { for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next()) { diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 999143f4c32..29af574443a 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -1355,7 +1355,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c // advance in X cx += incxx; x++; - dest++; + ++dest; pri++; } } @@ -1395,7 +1395,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c cx += incxx; cy += incxy; x++; - dest++; + ++dest; pri++; } @@ -1436,7 +1436,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c cx += incxx; cy += incxy; x++; - dest++; + ++dest; pri++; } diff --git a/src/emu/ui/inputmap.cpp b/src/emu/ui/inputmap.cpp index 0cf08392b42..ab1318e30c3 100644 --- a/src/emu/ui/inputmap.cpp +++ b/src/emu/ui/inputmap.cpp @@ -109,7 +109,7 @@ void ui_menu_input_general::populate() /* loop over all sequence types */ sortorder++; - for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) { /* build an entry for the standard sequence */ input_item_data *item = (input_item_data *)m_pool_alloc(sizeof(*item)); @@ -187,7 +187,7 @@ void ui_menu_input_specific::populate() sortorder = field->type() | 0xf000; /* loop over all sequence types */ - for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) + for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) { /* build an entry for the standard sequence */ input_item_data *item = (input_item_data *)m_pool_alloc(sizeof(*item)); diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index 046aa8bfa18..0f59220ccc8 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -1713,15 +1713,15 @@ UINT32 ui_manager::handler_load_save(running_machine &machine, render_container } // check for A-Z or 0-9 - for (input_item_id id = ITEM_ID_A; id <= ITEM_ID_Z; id++) + for (input_item_id id = ITEM_ID_A; id <= ITEM_ID_Z; ++id) if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id))) file = id - ITEM_ID_A + 'a'; if (file == 0) - for (input_item_id id = ITEM_ID_0; id <= ITEM_ID_9; id++) + for (input_item_id id = ITEM_ID_0; id <= ITEM_ID_9; ++id) if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id))) file = id - ITEM_ID_0 + '0'; if (file == 0) - for (input_item_id id = ITEM_ID_0_PAD; id <= ITEM_ID_9_PAD; id++) + for (input_item_id id = ITEM_ID_0_PAD; id <= ITEM_ID_9_PAD; ++id) if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id))) file = id - ITEM_ID_0_PAD + '0'; if (file == 0) diff --git a/src/emu/uiinput.cpp b/src/emu/uiinput.cpp index 107d94e9731..b0cbaa0add0 100644 --- a/src/emu/uiinput.cpp +++ b/src/emu/uiinput.cpp @@ -97,7 +97,7 @@ void ui_input_frame_update(running_machine &machine) ui_input_private *uidata = machine.ui_input_data; /* update the state of all the UI keys */ - for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; code++) + for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; ++code) { bool pressed = machine.ioport().type_pressed(code); if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET) -- cgit v1.2.3-70-g09d2