Skip to content

Commit 68048e4

Browse files
authored
Merge pull request #559 from pifopi/debug
Small warning fixes
2 parents 2b5671a + 90a15f4 commit 68048e4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ bool operator<(const std::optional<Pokemon>& lhs, const std::optional<Pokemon>&
193193
}
194194

195195
for (const BoxSortingSelection preference : *lhs->preferences){
196-
bool ret = true;
196+
std::optional<bool> ret{};
197197
switch(preference.sort_type){
198198
// NOTE edit when adding new struct members
199199
case BoxSortingSortType::NationalDexNo:
@@ -228,10 +228,13 @@ bool operator<(const std::optional<Pokemon>& lhs, const std::optional<Pokemon>&
228228
}
229229
break;
230230
}
231-
if (preference.reverse){
232-
return !ret;
233-
}else{
234-
return ret;
231+
if (ret.has_value()){
232+
bool value = *ret;
233+
if (preference.reverse){
234+
return !value;
235+
}else{
236+
return value;
237+
}
235238
}
236239
}
237240

SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ bool reset_game_from_home(
107107
"reset_game_from_home(): Right Joycon required.",
108108
stream
109109
);
110-
return false;
111110
}
112111
bool ok = true;
113112
ok &= reset_game_to_gamemenu(stream, context);

0 commit comments

Comments
 (0)