diff options
| author | 2023-05-01 02:37:28 +1000 | |
|---|---|---|
| committer | 2023-05-01 02:37:28 +1000 | |
| commit | c649fa82fdac71f6f625080a5bee78171ba449b9 (patch) | |
| tree | ee186a1fc1aff159b6550343094b672a6e8b4bda | |
| parent | 95fc84a22cce5d4a6570dee9631f99ec17904fba (diff) | |
ui: Don't use facets of destructed locales.
| -rw-r--r-- | scripts/genie.lua | 6 | ||||
| -rw-r--r-- | src/frontend/mame/ui/dirmenu.cpp | 3 | ||||
| -rw-r--r-- | src/frontend/mame/ui/filesel.cpp | 3 | ||||
| -rw-r--r-- | src/frontend/mame/ui/inifile.cpp | 6 | ||||
| -rw-r--r-- | src/frontend/mame/ui/miscmenu.cpp | 3 | ||||
| -rw-r--r-- | src/frontend/mame/ui/selsoft.cpp | 3 | ||||
| -rw-r--r-- | src/frontend/mame/ui/swlist.cpp | 3 | ||||
| -rw-r--r-- | src/frontend/mame/ui/systemlist.cpp | 3 |
8 files changed, 19 insertions, 11 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index 8b05e60bb56..727be423d2a 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1106,11 +1106,11 @@ end end if version >= 130000 then buildoptions_c { - "-Wno-dangling-pointer", + "-Wno-error=dangling-pointer", } buildoptions_cpp { - "-Wno-dangling-reference", - "-Wno-dangling-pointer", + "-Wno-error=dangling-reference", + "-Wno-error=dangling-pointer", "-Wno-xor-used-as-pow", } end diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp index e597b973d32..bd4ddb0cfdd 100644 --- a/src/frontend/mame/ui/dirmenu.cpp +++ b/src/frontend/mame/ui/dirmenu.cpp @@ -321,7 +321,8 @@ void menu_add_change_folder::populate() } // sort - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); std::sort( dirnames.begin(), dirnames.end(), diff --git a/src/frontend/mame/ui/filesel.cpp b/src/frontend/mame/ui/filesel.cpp index f43ddeac007..14d62c206b3 100644 --- a/src/frontend/mame/ui/filesel.cpp +++ b/src/frontend/mame/ui/filesel.cpp @@ -420,7 +420,8 @@ void menu_file_selector::populate() if (m_entrylist.size() > first) { // sort the menu entries - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); std::sort( m_entrylist.begin() + first, m_entrylist.end(), diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp index e25f00da4a1..85794bb2bf1 100644 --- a/src/frontend/mame/ui/inifile.cpp +++ b/src/frontend/mame/ui/inifile.cpp @@ -58,7 +58,8 @@ inifile_manager::inifile_manager(ui_options &options) } } } - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t>>(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); std::stable_sort( m_ini_index.begin(), m_ini_index.end(), @@ -132,7 +133,8 @@ void inifile_manager::init_category(std::string &&filename, util::core_file &fil } if (!index.empty()) { - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t>>(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); std::stable_sort( index.begin(), index.end(), diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index 6a41da2f070..70e456e35ed 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -479,7 +479,8 @@ void menu_crosshair::populate() if ((length > 4) && core_filename_ends_with(dir->name, ".png")) m_pics.emplace_back(dir->name, length - 4); } - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t>>(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); std::stable_sort( m_pics.begin(), m_pics.end(), diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 4d0c9554a9d..bc8d3267585 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -223,7 +223,8 @@ public: } // sort array - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); auto const compare_names = [&coll] (std::string const &x, std::string const &y) -> bool { diff --git a/src/frontend/mame/ui/swlist.cpp b/src/frontend/mame/ui/swlist.cpp index 294cd5d3058..8ae73e00c3c 100644 --- a/src/frontend/mame/ui/swlist.cpp +++ b/src/frontend/mame/ui/swlist.cpp @@ -258,7 +258,8 @@ void menu_software_list::populate() } else { - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t>>(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); m_entrylist.sort( [&coll] (entry_info const &e1, entry_info const &e2) -> bool { diff --git a/src/frontend/mame/ui/systemlist.cpp b/src/frontend/mame/ui/systemlist.cpp index 5038c7e9783..d2132e7f6c9 100644 --- a/src/frontend/mame/ui/systemlist.cpp +++ b/src/frontend/mame/ui/systemlist.cpp @@ -139,7 +139,8 @@ void system_list::do_cache_data(std::string const &datpath, std::string const &t } // sort drivers and notify - std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(std::locale()); + std::locale const lcl; + std::collate<wchar_t> const &coll = std::use_facet<std::collate<wchar_t> >(lcl); auto const compare_names = [&coll] (std::wstring const &wx, std::wstring const &wy) -> bool { |
