summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/info.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/info.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/info.cpp')
-rw-r--r--src/frontend/mame/ui/info.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 9bac109258a..7d11970966f 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -490,8 +490,7 @@ menu_game_info::~menu_game_info()
void menu_game_info::populate(float &customtop, float &custombottom)
{
- std::string tempstring = ui().machine_info().game_info_string();
- item_append(std::move(tempstring), "", FLAG_MULTILINE, nullptr);
+ item_append(ui().machine_info().game_info_string(), FLAG_MULTILINE, nullptr);
}
void menu_game_info::handle()
@@ -515,8 +514,7 @@ menu_warn_info::~menu_warn_info()
void menu_warn_info::populate(float &customtop, float &custombottom)
{
- std::string tempstring = ui().machine_info().warnings_string();
- item_append(std::move(tempstring), "", FLAG_MULTILINE, nullptr);
+ item_append(ui().machine_info().warnings_string(), FLAG_MULTILINE, nullptr);
}
void menu_warn_info::handle()
@@ -540,8 +538,8 @@ menu_image_info::~menu_image_info()
void menu_image_info::populate(float &customtop, float &custombottom)
{
- item_append(machine().system().type.fullname(), "", FLAG_DISABLE, nullptr);
- item_append("", "", FLAG_DISABLE, nullptr);
+ item_append(machine().system().type.fullname(), FLAG_DISABLE, nullptr);
+ item_append(std::string(), FLAG_DISABLE, nullptr);
for (device_image_interface &image : image_interface_enumerator(machine().root_device()))
image_info(&image);
@@ -570,19 +568,19 @@ void menu_image_info::image_info(device_image_interface *image)
if (image->loaded_through_softlist())
{
// display long filename
- item_append(image->longname(), "", FLAG_DISABLE, nullptr);
+ item_append(image->longname(), FLAG_DISABLE, nullptr);
// display manufacturer and year
- item_append(string_format("%s, %s", image->manufacturer(), image->year()), "", FLAG_DISABLE, nullptr);
+ item_append(string_format("%s, %s", image->manufacturer(), image->year()), FLAG_DISABLE, nullptr);
// display supported information, if available
switch (image->supported())
{
case SOFTWARE_SUPPORTED_NO:
- item_append(_("Not supported"), "", FLAG_DISABLE, nullptr);
+ item_append(_("Not supported"), FLAG_DISABLE, nullptr);
break;
case SOFTWARE_SUPPORTED_PARTIAL:
- item_append(_("Partially supported"), "", FLAG_DISABLE, nullptr);
+ item_append(_("Partially supported"), FLAG_DISABLE, nullptr);
break;
default:
break;
@@ -591,7 +589,7 @@ void menu_image_info::image_info(device_image_interface *image)
}
else
item_append(image->brief_instance_name(), _("[empty]"), 0, nullptr);
- item_append("", "", FLAG_DISABLE, nullptr);
+ item_append(std::string(), FLAG_DISABLE, nullptr);
}
} // namespace ui