summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/luaengine.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/luaengine.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/luaengine.cpp')
-rw-r--r--src/emu/luaengine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/emu/luaengine.cpp b/src/emu/luaengine.cpp
index 34b78ba2890..dca6eb4b3b2 100644
--- a/src/emu/luaengine.cpp
+++ b/src/emu/luaengine.cpp
@@ -547,10 +547,10 @@ luabridge::LuaRef lua_engine::l_machine_get_images(const running_machine *r)
lua_State *L = luaThis->m_lua_state;
luabridge::LuaRef image_table = luabridge::LuaRef::newTable(L);
- image_interface_iterator iter(r->root_device());
- for (device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) {
- image_table[image->brief_instance_name()] = image;
- image_table[image->instance_name()] = image;
+ for (device_image_interface &image : image_interface_iterator(r->root_device()))
+ {
+ image_table[image.brief_instance_name()] = &image;
+ image_table[image.instance_name()] = &image;
}
return image_table;