From 3ae17399eb5ad2981c9c37a02c8c0cad030d38ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 8 Jan 2025 12:56:57 +0100 Subject: [PATCH] Warning fixes --- Core/Dialog/PSPOskDialog.cpp | 6 +++--- UI/GameSettingsScreen.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index 0a9888ce62f5..5c062ba28007 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -54,7 +54,7 @@ static const uint8_t kor_lconsCom[33] = { 18,0,2,21,3,4,26,3,5,0,7,8,15,7,9,16,7 // Korean (Hangul) last consonant Separation key static const uint8_t kor_lconsSpr[33] = { 2,1,9,4,4,12,5,4,18,8,8,0,9,8,6,10,8,7,11,8,9,12,8,16,13,8,17,14,8,18,17,17,9 }; -static const char * const OskKeyboardNames[] = +static const std::string_view OskKeyboardNames[] = { "en_US", "ja_JP", @@ -940,11 +940,11 @@ int PSPOskDialog::Update(int animSpeed) { } // Now, let's grab the name. - const char *countryCode = OskKeyboardNames[lang]; + std::string countryCode(OskKeyboardNames[lang]); const char *language = languageMapping[countryCode].first.c_str(); // It seems like this is a "fake" country code for extra keyboard purposes. - if (!strcmp(countryCode, "English Full-width")) + if (countryCode == "English Full-width") language = "English Full-width"; return language; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index ef22b8bfd9e2..ca39aea5a37a 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1313,7 +1313,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { systemSettings->Add(new PopupMultiChoice(&g_Config.iLanguage, psps->T("Game language"), defaultLanguages, -1, ARRAY_SIZE(defaultLanguages), I18NCat::PSPSETTINGS, screenManager())); static const char *models[] = { "PSP-1000", "PSP-2000/3000" }; systemSettings->Add(new PopupMultiChoice(&g_Config.iPSPModel, sy->T("PSP Model"), models, 0, ARRAY_SIZE(models), I18NCat::SYSTEM, screenManager()))->SetEnabled(!PSP_IsInited()); - systemSettings->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sNickName, sy->T("Change Nickname"), "", 32, screenManager()))->OnChange.Add([this](UI::EventParams &e) { + systemSettings->Add(new PopupTextInputChoice(GetRequesterToken(), &g_Config.sNickName, sy->T("Change Nickname"), "", 32, screenManager()))->OnChange.Add([](UI::EventParams &e) { // Copy to infrastructure name if valid and not already set. if (g_Config.sInfrastructureUsername.empty()) { if (g_Config.sNickName == SanitizeString(g_Config.sNickName, StringRestriction::AlphaNumDashUnderscore, 3, 16)) {