summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/imgcntrl.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-04-18 18:53:28 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-04-18 18:53:28 -0400
commit084d3654ca14a79d9ec173bad4ddf00ad0fb5a7f (patch)
tree197ae37b68f3169048fb3cadf6947353315f3608 /src/emu/ui/imgcntrl.cpp
parent55d3e544e013174880c8f208264683aac6d711f9 (diff)
Iterate over devices C++11 style
Replace the old device_iterator and its specialized versions with functionally equivalent classes that use standard operators to yield references to devices/interfaces rather than pointers. With range-based for loops, they no longer have to be stored in named variables, though they can also be reused concurrently since the iteration state is now maintained by a subclass. Add a few more typical getters to device_t::subdevice_list.
Diffstat (limited to 'src/emu/ui/imgcntrl.cpp')
-rw-r--r--src/emu/ui/imgcntrl.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/emu/ui/imgcntrl.cpp b/src/emu/ui/imgcntrl.cpp
index 883541786af..5497d953f99 100644
--- a/src/emu/ui/imgcntrl.cpp
+++ b/src/emu/ui/imgcntrl.cpp
@@ -36,14 +36,10 @@ ui_menu_control_device_image::ui_menu_control_device_image(running_machine &mach
{
image = _image;
- sld = nullptr;
- if (image->software_list_name()) {
- software_list_device_iterator iter(machine.config().root_device());
- for (software_list_device *swlist = iter.first(); swlist != nullptr; swlist = iter.next())
- {
- if (strcmp(swlist->list_name(),image->software_list_name())==0) sld = swlist;
- }
- }
+ if (image->software_list_name())
+ sld = software_list_device::find_by_name(machine.config(), image->software_list_name());
+ else
+ sld = nullptr;
swi = image->software_entry();
swp = image->part_entry();