diff options
author | 2016-03-31 09:43:53 -0400 | |
---|---|---|
committer | 2016-03-31 09:43:53 -0400 | |
commit | a7e393b36b57cead61978f332135a509b2ddc82a (patch) | |
tree | 4d0d9a4b83d394e8706bd0475f379b5f468c43b1 /src/devices/machine/legscsi.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/devices/machine/legscsi.cpp')
-rw-r--r-- | src/devices/machine/legscsi.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/machine/legscsi.cpp b/src/devices/machine/legscsi.cpp index 23cc5902a29..e8cbd7e9704 100644 --- a/src/devices/machine/legscsi.cpp +++ b/src/devices/machine/legscsi.cpp @@ -133,9 +133,9 @@ UINT8 legacy_scsi_host_adapter::get_status() scsihle_device *legacy_scsi_host_adapter::get_device(int id) { // steal scsi devices from bus - for (device_t *device = m_scsi_port->first_subdevice(); device != nullptr; device = device->next()) + for (device_t &device : m_scsi_port->subdevices()) { - SCSI_PORT_SLOT_device *slot = dynamic_cast<SCSI_PORT_SLOT_device *>(device); + SCSI_PORT_SLOT_device *slot = dynamic_cast<SCSI_PORT_SLOT_device *>(&device); if (slot != nullptr) { scsihle_device *scsidev = dynamic_cast<scsihle_device *>(slot->dev()); |