summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui
diff options
context:
space:
mode:
author npwoods <npwoods@mess.org>2022-09-14 13:02:30 -0400
committer GitHub <noreply@github.com>2022-09-15 03:02:30 +1000
commit3737b424d6c8ef4fb3ea393e9407361a7e095d94 (patch)
tree732c524436f789780bec41c832e33e2cc99ac3ef /src/frontend/mame/ui
parent81e5abf05222ce96c70ea29e9ffed3922afcc811 (diff)
util/corestr.cpp: Changed core_stricmp to take std::string_view parameters. (#10287)
Note that the implementation is still not UTF-8 aware.
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r--src/frontend/mame/ui/custui.cpp12
-rw-r--r--src/frontend/mame/ui/filesel.cpp2
-rw-r--r--src/frontend/mame/ui/inifile.cpp2
-rw-r--r--src/frontend/mame/ui/menu.cpp6
-rw-r--r--src/frontend/mame/ui/selmenu.cpp2
5 files changed, 12 insertions, 12 deletions
diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp
index 08cad10ccdd..090f657169a 100644
--- a/src/frontend/mame/ui/custui.cpp
+++ b/src/frontend/mame/ui/custui.cpp
@@ -250,7 +250,7 @@ void menu_custom_ui::find_languages()
std::sort(
std::next(m_languages.begin()),
m_languages.end(),
- [] (std::string const &x, std::string const &y) { return 0 > core_stricmp(x.c_str(), y.c_str()); });
+ [] (std::string const &x, std::string const &y) { return 0 > core_stricmp(x, y); });
char const *const lang = machine().options().language();
if (*lang)
@@ -259,8 +259,8 @@ void menu_custom_ui::find_languages()
std::next(m_languages.begin()),
m_languages.end(),
lang,
- [] (std::string const &x, char const *y) { return 0 > core_stricmp(x.c_str(), y); });
- if ((m_languages.end() != found) && !core_stricmp(found->c_str(), lang))
+ [] (std::string const &x, char const *y) { return 0 > core_stricmp(x, y); });
+ if ((m_languages.end() != found) && !core_stricmp(*found, lang))
m_currlang = std::distance(m_languages.begin(), found);
}
else
@@ -292,7 +292,7 @@ void menu_custom_ui::find_sysnames()
std::sort(
m_sysnames.begin(),
m_sysnames.end(),
- [] (std::string const &x, std::string const &y) { return 0 > core_stricmp(x.c_str(), y.c_str()); });
+ [] (std::string const &x, std::string const &y) { return 0 > core_stricmp(x, y); });
char const *const names = ui().options().system_names();
if (*names)
@@ -301,9 +301,9 @@ void menu_custom_ui::find_sysnames()
std::next(m_sysnames.begin()),
m_sysnames.end(),
names,
- [] (std::string const &x, char const *y) { return 0 > core_stricmp(x.c_str(), y); });
+ [] (std::string const &x, char const *y) { return 0 > core_stricmp(x, y); });
m_currsysnames = std::distance(m_sysnames.begin(), found);
- if ((m_sysnames.end() == found) || core_stricmp(found->c_str(), names))
+ if ((m_sysnames.end() == found) || core_stricmp(*found, names))
m_sysnames.emplace(found, names);
}
else
diff --git a/src/frontend/mame/ui/filesel.cpp b/src/frontend/mame/ui/filesel.cpp
index 704aaba3686..664bd699c47 100644
--- a/src/frontend/mame/ui/filesel.cpp
+++ b/src/frontend/mame/ui/filesel.cpp
@@ -397,7 +397,7 @@ void menu_file_selector::populate(float &customtop, float &custombottom)
selected_entry = entry;
// do we have to select this file?
- if (!core_stricmp(m_current_file.c_str(), dirent->name))
+ if (!core_stricmp(m_current_file, dirent->name))
selected_entry = entry;
}
}
diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp
index 4475210db74..55c7da2d919 100644
--- a/src/frontend/mame/ui/inifile.cpp
+++ b/src/frontend/mame/ui/inifile.cpp
@@ -532,7 +532,7 @@ void favorite_manager::update_sorted()
int cmp;
- cmp = core_stricmp(lhs.longname.c_str(), rhs.longname.c_str());
+ cmp = core_stricmp(lhs.longname, rhs.longname);
if (0 > cmp)
return true;
else if (0 < cmp)
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp
index dbe1b29a813..0ad1ad0b379 100644
--- a/src/frontend/mame/ui/menu.cpp
+++ b/src/frontend/mame/ui/menu.cpp
@@ -719,13 +719,13 @@ void menu::draw(uint32_t flags)
}
// customize subitem text color
- if (!core_stricmp(pitem.subtext().c_str(), _("On")))
+ if (!core_stricmp(pitem.subtext(), _("On")))
fgcolor2 = rgb_t(0x00,0xff,0x00);
- if (!core_stricmp(pitem.subtext().c_str(), _("Off")))
+ if (!core_stricmp(pitem.subtext(), _("Off")))
fgcolor2 = rgb_t(0xff,0x00,0x00);
- if (!core_stricmp(pitem.subtext().c_str(), _("Auto")))
+ if (!core_stricmp(pitem.subtext(), _("Auto")))
fgcolor2 = rgb_t(0xff,0xff,0x00);
// draw the subitem right-justified
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index 9b1b3f1e74d..a37b7215918 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -278,7 +278,7 @@ void menu_select_launch::software_parts::populate(float &customtop, float &custo
parts.reserve(m_parts.size());
for (s_parts::const_iterator it = m_parts.begin(); m_parts.end() != it; ++it)
parts.push_back(it);
- std::sort(parts.begin(), parts.end(), [] (auto const &left, auto const &right) { return 0 > core_stricmp(left->first.c_str(), right->first.c_str()); });
+ std::sort(parts.begin(), parts.end(), [] (auto const &left, auto const &right) { return 0 > core_stricmp(left->first, right->first); });
for (auto const &elem : parts)
item_append(elem->first, elem->second, 0, (void *)&*elem);