From a7e393b36b57cead61978f332135a509b2ddc82a Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 31 Mar 2016 09:43:53 -0400 Subject: 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). --- src/devices/machine/legscsi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/devices/machine/legscsi.cpp') 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(device); + SCSI_PORT_SLOT_device *slot = dynamic_cast(&device); if (slot != nullptr) { scsihle_device *scsidev = dynamic_cast(slot->dev()); -- cgit v1.2.3-70-g09d2