summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/inifile.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-02-14 11:05:57 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-02-14 11:05:57 -0500
commitbc0146c2038c46f789a246d5616afd7c425157f3 (patch)
treeb4d39194034b4c6e56ccd4035d25636034be43ca /src/frontend/mame/ui/inifile.cpp
parent91310bcdeb7ab0ff661738b212017bf836f4e8ad (diff)
Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
Diffstat (limited to 'src/frontend/mame/ui/inifile.cpp')
-rw-r--r--src/frontend/mame/ui/inifile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp
index 0bf8c6548f5..089d58f3e77 100644
--- a/src/frontend/mame/ui/inifile.cpp
+++ b/src/frontend/mame/ui/inifile.cpp
@@ -99,7 +99,7 @@ void inifile_manager::init_category(std::string &&filename, emu_file &file)
categoryindex index;
char rbuf[MAX_CHAR_INFO];
std::string name;
- while (file.gets(rbuf, ARRAY_LENGTH(rbuf)))
+ while (file.gets(rbuf, std::size(rbuf)))
{
if ('[' == rbuf[0])
{
@@ -143,7 +143,7 @@ bool favorite_manager::favorite_compare::operator()(ui_software_info const &lhs,
return true;
}
- return 0 > std::strncmp(lhs.driver->name, rhs.driver->name, ARRAY_LENGTH(lhs.driver->name));
+ return 0 > std::strncmp(lhs.driver->name, rhs.driver->name, std::size(lhs.driver->name));
}
bool favorite_manager::favorite_compare::operator()(ui_software_info const &lhs, game_driver const &rhs) const
@@ -153,7 +153,7 @@ bool favorite_manager::favorite_compare::operator()(ui_software_info const &lhs,
if (!lhs.startempty)
return false;
else
- return 0 > std::strncmp(lhs.driver->name, rhs.name, ARRAY_LENGTH(rhs.name));
+ return 0 > std::strncmp(lhs.driver->name, rhs.name, std::size(rhs.name));
}
bool favorite_manager::favorite_compare::operator()(game_driver const &lhs, ui_software_info const &rhs) const
@@ -163,7 +163,7 @@ bool favorite_manager::favorite_compare::operator()(game_driver const &lhs, ui_s
if (!rhs.startempty)
return true;
else
- return 0 > std::strncmp(lhs.name, rhs.driver->name, ARRAY_LENGTH(lhs.name));
+ return 0 > std::strncmp(lhs.name, rhs.driver->name, std::size(lhs.name));
}
bool favorite_manager::favorite_compare::operator()(ui_software_info const &lhs, running_software_key const &rhs) const
@@ -182,7 +182,7 @@ bool favorite_manager::favorite_compare::operator()(ui_software_info const &lhs,
else if (lhs.shortname > std::get<2>(rhs))
return false;
else
- return 0 > std::strncmp(lhs.driver->name, std::get<0>(rhs).name, ARRAY_LENGTH(lhs.driver->name));
+ return 0 > std::strncmp(lhs.driver->name, std::get<0>(rhs).name, std::size(lhs.driver->name));
}
bool favorite_manager::favorite_compare::operator()(running_software_key const &lhs, ui_software_info const &rhs) const
@@ -201,7 +201,7 @@ bool favorite_manager::favorite_compare::operator()(running_software_key const &
else if (std::get<2>(lhs) > rhs.shortname)
return false;
else
- return 0 > std::strncmp(std::get<0>(lhs).name, rhs.driver->name, ARRAY_LENGTH(rhs.driver->name));
+ return 0 > std::strncmp(std::get<0>(lhs).name, rhs.driver->name, std::size(rhs.driver->name));
}