diff options
| author | 2016-03-31 09:43:53 -0400 | |
|---|---|---|
| committer | 2016-03-31 09:43:53 -0400 | |
| commit | a7e393b36b57cead61978f332135a509b2ddc82a (patch) | |
| tree | 4d0d9a4b83d394e8706bd0475f379b5f468c43b1 /src/emu/debug/debugcmd.cpp | |
| parent | 677cfa86fd8675dd15cc6cde0e26fd216823c61b (diff) | |
Iterate over core classes C++11 style
C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.)
device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config.
memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
| -rw-r--r-- | src/emu/debug/debugcmd.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 2e10b40356e..cd16bd4e691 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -1935,7 +1935,6 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con UINT64 curaddr; UINT8 i, region_count = 0; - address_map_entry *entry; cheat_region_map cheat_region[100]; memset(cheat_region, 0, sizeof(cheat_region)); @@ -1987,18 +1986,18 @@ static void execute_cheatinit(running_machine &machine, int ref, int params, con /* initialize entire memory by default */ if (params <= 1) { - for (entry = space->map()->m_entrylist.first(); entry != nullptr; entry = entry->next()) + for (address_map_entry &entry : space->map()->m_entrylist) { - cheat_region[region_count].offset = space->address_to_byte(entry->m_addrstart) & space->bytemask(); - cheat_region[region_count].endoffset = space->address_to_byte(entry->m_addrend) & space->bytemask(); - cheat_region[region_count].share = entry->m_share; - cheat_region[region_count].disabled = (entry->m_write.m_type == AMH_RAM) ? FALSE : TRUE; + cheat_region[region_count].offset = space->address_to_byte(entry.m_addrstart) & space->bytemask(); + cheat_region[region_count].endoffset = space->address_to_byte(entry.m_addrend) & space->bytemask(); + cheat_region[region_count].share = entry.m_share; + cheat_region[region_count].disabled = (entry.m_write.m_type == AMH_RAM) ? FALSE : TRUE; /* disable double share regions */ - if (entry->m_share != nullptr) + if (entry.m_share != nullptr) for (i = 0; i < region_count; i++) if (cheat_region[i].share != nullptr) - if (strcmp(cheat_region[i].share, entry->m_share) == 0) + if (strcmp(cheat_region[i].share, entry.m_share) == 0) cheat_region[region_count].disabled = TRUE; region_count++; @@ -2979,12 +2978,12 @@ static void execute_symlist(running_machine &machine, int ref, int params, const } /* gather names for all symbols */ - for (symbol_entry *entry = symtable->first(); entry != nullptr; entry = entry->next()) + for (symbol_entry &entry : symtable->entries()) { /* only display "register" type symbols */ - if (!entry->is_function()) + if (!entry.is_function()) { - namelist[count++] = entry->name(); + namelist[count++] = entry.name(); if (count >= ARRAY_LENGTH(namelist)) break; } |
