summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/filemngr.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-12-08 21:19:17 -0500
committer AJR <ajrhacker@users.noreply.github.com>2020-12-08 21:24:46 -0500
commitc22cb17f326b4939d8ff4219410909e32e70ab86 (patch)
tree8db68c201fa9673eeb6acab37a5d221c7a338ea6 /src/frontend/mame/ui/filemngr.cpp
parent6172111b187c1dd66329adb2b9bba2a82a0ce116 (diff)
C++17 string handling updates (without charconv so as not to break GCC 7)
- render.cpp, rendlay.cpp, ui/ui.cpp, ui/menu.cpp: Change argument types for text processing functions from const char * to std::string_view - ui/menu.cpp: Add overloads of item_append omitting the frequently empty subtext argument - cheat.cpp: Remove some c_str() calls that became unnecessary a while ago
Diffstat (limited to 'src/frontend/mame/ui/filemngr.cpp')
-rw-r--r--src/frontend/mame/ui/filemngr.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/frontend/mame/ui/filemngr.cpp b/src/frontend/mame/ui/filemngr.cpp
index 6c5423746f8..2face5b6dd1 100644
--- a/src/frontend/mame/ui/filemngr.cpp
+++ b/src/frontend/mame/ui/filemngr.cpp
@@ -59,11 +59,9 @@ menu_file_manager::~menu_file_manager()
void menu_file_manager::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
- const char *path;
-
// access the path
- path = selected_device ? selected_device->filename() : nullptr;
- extra_text_render(top, bottom, origx1, origy1, origx2, origy2, nullptr, path);
+ std::string_view path = selected_device ? selected_device->filename() : std::string_view();
+ extra_text_render(top, bottom, origx1, origy1, origx2, origy2, std::string_view(), path);
}
@@ -110,8 +108,8 @@ void menu_file_manager::populate(float &customtop, float &custombottom)
if (!m_warnings.empty())
{
- item_append(m_warnings, "", FLAG_DISABLE, nullptr);
- item_append("", "", FLAG_DISABLE, nullptr);
+ item_append(m_warnings, FLAG_DISABLE, nullptr);
+ item_append(std::string(), FLAG_DISABLE, nullptr);
}
// cycle through all devices for this system
@@ -143,7 +141,7 @@ void menu_file_manager::populate(float &customtop, float &custombottom)
first_entry = false;
else
item_append(menu_item_type::SEPARATOR);
- item_append(string_format("[root%s]", dev.tag()), "", 0, nullptr);
+ item_append(string_format("[root%s]", dev.tag()), 0, nullptr);
tag_appended = true;
}
// finally, append the image interface to the menu
@@ -156,7 +154,7 @@ void menu_file_manager::populate(float &customtop, float &custombottom)
item_append(menu_item_type::SEPARATOR);
if (m_warnings.empty() || m_curr_selected)
- item_append("Reset", "", 0, (void *)1);
+ item_append("Reset", 0, (void *)1);
custombottom = ui().get_line_height() + 3.0f * ui().box_tb_border();
}