From 90a15f414f2b9d44f7d26ace83cbe83909cfb526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DOTTEL=20Ga=C3=ABl?= Date: Tue, 1 Apr 2025 01:32:02 +0200 Subject: [PATCH] Small warning fixes --- .../PokemonHome/Programs/PokemonHome_BoxSorting.cpp | 13 ++++++++----- .../PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp b/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp index fee5aa08bb..f3ea879cb1 100644 --- a/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp +++ b/SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp @@ -193,7 +193,7 @@ bool operator<(const std::optional& lhs, const std::optional& } for (const BoxSortingSelection preference : *lhs->preferences){ - bool ret = true; + std::optional ret{}; switch(preference.sort_type){ // NOTE edit when adding new struct members case BoxSortingSortType::NationalDexNo: @@ -228,10 +228,13 @@ bool operator<(const std::optional& lhs, const std::optional& } break; } - if (preference.reverse){ - return !ret; - }else{ - return ret; + if (ret.has_value()){ + bool value = *ret; + if (preference.reverse){ + return !value; + }else{ + return value; + } } } diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp b/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp index d4a2cacd55..4a1ac3655e 100644 --- a/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp +++ b/SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp @@ -107,7 +107,6 @@ bool reset_game_from_home( "reset_game_from_home(): Right Joycon required.", stream ); - return false; } bool ok = true; ok &= reset_game_to_gamemenu(stream, context);