diff options
| author | 2026-03-24 15:44:25 +1100 | |
|---|---|---|
| committer | 2026-03-25 00:54:58 +1100 | |
| commit | a4ba1e57ca1f1e164c6f9ffbecd427df64866486 (patch) | |
| tree | 391a63eed7a5817965a8215d74295ebcfe24bf63 /src/frontend | |
| parent | f97a8a76ee1c8aafbc974a77af0bc16c8036312c (diff) | |
Fixed various things that C++20 doesn't allow:
* cpu/i386/i386dasm.cpp, frontend/mame/infoxml.cpp, dec/pdp1_v.cpp:
Avoid arithmetic between different enum types.
* frontend/mame/cheat.cpp: Default-construct XML parser options.
* emu/validity.cpp: Avoid use of volatile assignement result as value.
* ui/devopt.cpp: UTF-8 strings will use a distinct character type.
Diffstat (limited to 'src/frontend')
| -rw-r--r-- | src/frontend/mame/cheat.cpp | 2 | ||||
| -rw-r--r-- | src/frontend/mame/infoxml.cpp | 23 | ||||
| -rw-r--r-- | src/frontend/mame/ui/devopt.cpp | 4 |
3 files changed, 8 insertions, 21 deletions
diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp index 6e10f650328..5d51348eba7 100644 --- a/src/frontend/mame/cheat.cpp +++ b/src/frontend/mame/cheat.cpp @@ -1409,7 +1409,7 @@ void cheat_manager::load_cheats(std::string const &filename) osd_printf_verbose("Loading cheats file from %s\n", cheatfile.fullpath()); // read the XML file into internal data structures - util::xml::parse_options options = { nullptr }; + util::xml::parse_options options; util::xml::parse_error error; options.error = &error; util::xml::file::ptr const rootnode(util::xml::file::read(cheatfile, &options)); diff --git a/src/frontend/mame/infoxml.cpp b/src/frontend/mame/infoxml.cpp index 9da194d36de..bf9a15d2cd2 100644 --- a/src/frontend/mame/infoxml.cpp +++ b/src/frontend/mame/infoxml.cpp @@ -1437,26 +1437,13 @@ void output_input(std::ostream &out, const ioport_list &portlist) CTRL_COUNT }; - enum - { - CTRL_P1, - CTRL_P2, - CTRL_P3, - CTRL_P4, - CTRL_P5, - CTRL_P6, - CTRL_P7, - CTRL_P8, - CTRL_P9, - CTRL_P10, - CTRL_PCOUNT - }; + constexpr unsigned CTRL_PCOUNT = 10; // directions - const uint8_t DIR_UP = 0x01; - const uint8_t DIR_DOWN = 0x02; - const uint8_t DIR_LEFT = 0x04; - const uint8_t DIR_RIGHT = 0x08; + constexpr uint8_t DIR_UP = 0x01; + constexpr uint8_t DIR_DOWN = 0x02; + constexpr uint8_t DIR_LEFT = 0x04; + constexpr uint8_t DIR_RIGHT = 0x08; // initialize the list of control types struct diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp index 9ff99ad3bf6..25f13b43dd6 100644 --- a/src/frontend/mame/ui/devopt.cpp +++ b/src/frontend/mame/ui/devopt.cpp @@ -117,7 +117,7 @@ void menu_device_config::populate_text(std::optional<text_layout> &layout, float util::string_format( (count > 1) ? ((clock != 0) ? u8" %1$d×%2$s %3$s\u00a0%4$s\n" : u8" %1$d×%2$s\n") - : ((clock != 0) ? u8" %2$s %3$s\u00a0%4$s\n" : " %2$s\n"), + : ((clock != 0) ? u8" %2$s %3$s\u00a0%4$s\n" : u8" %2$s\n"), count, name, hz, (d == 9) ? _("GHz") : (d == 6) ? _("MHz") : (d == 3) ? _("kHz") : _("Hz")), color); @@ -212,7 +212,7 @@ void menu_device_config::populate_text(std::optional<text_layout> &layout, float util::string_format( (count > 1) ? ((clock != 0) ? u8" %1$d×%2$s %3$s\u00a0%4$s" : u8" %1$d×%2$s") - : ((clock != 0) ? u8" %2$s %3$s\u00a0%4$s" : " %2$s"), + : ((clock != 0) ? u8" %2$s %3$s\u00a0%4$s" : u8" %2$s"), count, sound.device().name(), hz, (d == 9) ? _("GHz") : (d == 6) ? _("MHz") : (d == 3) ? _("kHz") : _("Hz")), color); |
