diff --git a/src/emu/clifront.c b/src/emu/clifront.c index 8bfbccf1fc7..3334d5181e8 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -148,7 +148,7 @@ int cli_frontend::execute(int argc, char **argv) machine_config config(*system, m_options); software_list_device_iterator iter(config.root_device()); - if (iter.first() == NULL) + if (iter.count() == 0) throw emu_fatalerror(MAMERR_FATALERROR, "Error: unknown option: %s\n", m_options.software_name()); bool found = false; @@ -550,7 +550,7 @@ void cli_frontend::listsamples(const char *gamename) { // see if we have samples samples_device_iterator iter(drivlist.config().root_device()); - if (iter.first() == NULL) + if (iter.count() == 0) continue; // print a header diff --git a/src/emu/ui/devctrl.h b/src/emu/ui/devctrl.h index f293b02c09e..5cc246cb567 100644 --- a/src/emu/ui/devctrl.h +++ b/src/emu/ui/devctrl.h @@ -46,9 +46,8 @@ ui_menu_device_control<_DeviceType>::ui_menu_device_control(running_machine &mac : ui_menu(machine, container) { iterator iter(machine.root_device()); + m_count = iter.count(); m_device = device ? device : iter.first(); - iterator iter_cnt(machine.root_device()); - m_count = iter_cnt.count(); }