Fix listsamples and one other potential problematic place, and fixed better devctrl (nw)

This commit is contained in:
Miodrag Milanovic 2014-04-03 08:56:14 +00:00
parent 32b682c9b3
commit dd1e28e513
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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();
}