From afc3dda1ee5841f414aed7f6eda143f9b72f4f53 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Mon, 27 Sep 2021 18:36:37 +0200 Subject: [PATCH] Reintroduce `LanguageCode` alias type --- app/src/main/cpp/skyline/common/language.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/skyline/common/language.h b/app/src/main/cpp/skyline/common/language.h index 4b32e671..13ffdb9e 100644 --- a/app/src/main/cpp/skyline/common/language.h +++ b/app/src/main/cpp/skyline/common/language.h @@ -8,6 +8,8 @@ #include namespace skyline { + using LanguageCode = u64; + namespace constant { constexpr size_t OldLanguageCodeListSize{15}; //!< The size of the pre 4.0.0 language code list constexpr size_t NewLanguageCodeListSize{18}; //!< The size of the post 10.1.0 language code list (was 17 between 4.0.0 - 10.1.0) @@ -70,13 +72,13 @@ namespace skyline { #undef MAP #undef DONT_MAP - constexpr std::array LanguageCodeList{ - #define LANG_ENTRY(lang, code, sysIndex, appIndex, map) util::MakeMagic(#code), + constexpr std::array LanguageCodeList{ + #define LANG_ENTRY(lang, code, sysIndex, appIndex, map) util::MakeMagic(#code), LANGUAGES #undef LANG_ENTRY }; - constexpr u64 GetLanguageCode(SystemLanguage language) { + constexpr LanguageCode GetLanguageCode(SystemLanguage language) { return LanguageCodeList.at(static_cast(language)); }