summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/filemngr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/ui/filemngr.cpp')
-rw-r--r--src/emu/ui/filemngr.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/emu/ui/filemngr.cpp b/src/emu/ui/filemngr.cpp
index 6bc789299d9..ce94f437120 100644
--- a/src/emu/ui/filemngr.cpp
+++ b/src/emu/ui/filemngr.cpp
@@ -28,7 +28,7 @@
// ctor
//-------------------------------------------------
-ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container), selected_device(NULL)
+ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container), selected_device(nullptr)
{
// This warning string is used when accessing from the force_file_manager call, i.e.
// when the file manager is loaded top front in the case of mandatory image devices
@@ -59,9 +59,9 @@ void ui_menu_file_manager::custom_render(void *selectedref, float top, float bot
const char *path;
// access the path
- path = selected_device ? selected_device->filename() : NULL;
+ path = selected_device ? selected_device->filename() : nullptr;
extra_text_render(container, top, bottom,
- origx1, origy1, origx2, origy2, NULL, path);
+ origx1, origy1, origx2, origy2, nullptr, path);
}
@@ -71,20 +71,20 @@ void ui_menu_file_manager::fill_image_line(device_image_interface *img, std::str
strprintf(instance,"%s (%s)", img->instance_name(), img->brief_instance_name());
// get the base name
- if (img->basename() != NULL)
+ if (img->basename() != nullptr)
{
filename.assign(img->basename());
// if the image has been loaded through softlist, also show the loaded part
- if (img->part_entry() != NULL)
+ if (img->part_entry() != nullptr)
{
const software_part *tmp = img->part_entry();
- if (tmp->name() != NULL)
+ if (tmp->name() != nullptr)
{
filename.append(" (");
filename.append(tmp->name());
// also check if this part has a specific part_id (e.g. "Map Disc", "Bonus Disc", etc.), and in case display it
- if (img->get_feature("part_id") != NULL)
+ if (img->get_feature("part_id") != nullptr)
{
filename.append(": ");
filename.append(img->get_feature("part_id"));
@@ -108,17 +108,17 @@ void ui_menu_file_manager::populate()
if (!m_warnings.empty())
{
- item_append(m_warnings.c_str(), NULL, MENU_FLAG_DISABLE, NULL);
- item_append("", NULL, MENU_FLAG_DISABLE, NULL);
+ item_append(m_warnings.c_str(), nullptr, MENU_FLAG_DISABLE, nullptr);
+ item_append("", nullptr, MENU_FLAG_DISABLE, nullptr);
}
// cycle through all devices for this system
device_iterator iter(machine().root_device());
- tagmap_t<UINT8> devtags;
- for (device_t *dev = iter.first(); dev != NULL; dev = iter.next())
+ std::unordered_set<std::string> devtags;
+ for (device_t *dev = iter.first(); dev != nullptr; dev = iter.next())
{
bool tag_appended = false;
- if (devtags.add(dev->tag(), 1, FALSE) == TMERR_DUPLICATE)
+ if (!devtags.insert(dev->tag()).second)
continue;
// check whether it owns an image interface
@@ -127,11 +127,11 @@ void ui_menu_file_manager::populate()
{
// if so, cycle through all its image interfaces
image_interface_iterator subiterator(*dev);
- for (device_image_interface *scan = subiterator.first(); scan != NULL; scan = subiterator.next())
+ for (device_image_interface *scan = subiterator.first(); scan != nullptr; scan = subiterator.next())
{
// if it is a children device, and not something further down the device tree, we want it in the menu!
if (strcmp(scan->device().owner()->tag(), dev->tag()) == 0)
- if (devtags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE)
+ if (devtags.insert(scan->device().tag()).second)
{
// check whether we already had some devices with the same owner: if not, output the owner tag!
if (!tag_appended)
@@ -139,9 +139,9 @@ void ui_menu_file_manager::populate()
if (first_entry)
first_entry = false;
else
- item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
+ item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
strprintf(buffer, "[root%s]", dev->tag());
- item_append(buffer.c_str(), NULL, 0, NULL);
+ item_append(buffer.c_str(), nullptr, 0, nullptr);
tag_appended = true;
}
// finally, append the image interface to the menu
@@ -151,8 +151,8 @@ void ui_menu_file_manager::populate()
}
}
}
- item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
- item_append("Reset", NULL, 0, (void *)1);
+ item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
+ item_append("Reset", nullptr, 0, (void *)1);
custombottom = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
}
@@ -166,7 +166,7 @@ void ui_menu_file_manager::handle()
{
// process the menu
const ui_menu_event *event = process(0);
- if (event != NULL && event->itemref != NULL && event->iptkey == IPT_UI_SELECT)
+ if (event != nullptr && event->itemref != nullptr && event->iptkey == IPT_UI_SELECT)
{
if ((FPTR)event->itemref == 1)
{
@@ -176,7 +176,7 @@ void ui_menu_file_manager::handle()
else
{
selected_device = (device_image_interface *) event->itemref;
- if (selected_device != NULL)
+ if (selected_device != nullptr)
{
m_curr_selected = TRUE;
ui_menu::stack_push(selected_device->get_selection_menu(machine(), container));