From 266aa1ec888c9589d4d47cd57da7faa515e91898 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Fri, 12 Jul 2024 00:26:42 +0800 Subject: [PATCH] [Warnings] Fix warnings --- src/strategy/actions/BattleGroundTactics.cpp | 7 +++++-- src/strategy/actions/BuyAction.cpp | 2 ++ src/strategy/actions/CastCustomSpellAction.cpp | 4 ++-- src/strategy/actions/CustomStrategyEditAction.cpp | 2 +- src/strategy/actions/RangeAction.cpp | 2 +- src/strategy/actions/TalkToQuestGiverAction.cpp | 4 ++++ src/strategy/actions/WhoAction.cpp | 4 ++-- src/strategy/values/BudgetValues.cpp | 2 ++ src/strategy/values/ItemForSpellValue.cpp | 4 ++-- 9 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/strategy/actions/BattleGroundTactics.cpp b/src/strategy/actions/BattleGroundTactics.cpp index 80eff17b..a9e916d3 100644 --- a/src/strategy/actions/BattleGroundTactics.cpp +++ b/src/strategy/actions/BattleGroundTactics.cpp @@ -4115,7 +4115,8 @@ bool BGTactics::selectObjective(bool reset) } break; } - + default: + break; } return false; @@ -4503,7 +4504,7 @@ bool BGTactics::atFlag(std::vector const& vPaths, std::vectorisSpawned() || !go->GetGoState() == GO_STATE_READY) + if (!go->isSpawned() || go->GetGoState() != GO_STATE_READY) continue; if (!bot->CanUseBattlegroundObject(go) && bgType != BATTLEGROUND_WS) @@ -4644,6 +4645,8 @@ bool BGTactics::atFlag(std::vector const& vPaths, std::vectorFormatQuest(quest); @@ -257,6 +259,8 @@ bool TurnInQueryQuestAction::Execute(Event event) case QUEST_STATUS_REWARDED: out << "|cffff0000Rewarded|r"; break; + default: + break; } out << ": " << chat->FormatQuest(quest); diff --git a/src/strategy/actions/WhoAction.cpp b/src/strategy/actions/WhoAction.cpp index 76bfd608..d7b9f2bc 100644 --- a/src/strategy/actions/WhoAction.cpp +++ b/src/strategy/actions/WhoAction.cpp @@ -11,8 +11,8 @@ #ifndef WIN32 inline int strcmpi(char const* s1, char const* s2) { - for (; *s1 && *s2 && (toupper(*s1) == toupper(*s2)); ++s1, ++s2); - return *s1 - *s2; + for (; *s1 && *s2 && (toupper(*s1) == toupper(*s2)); ++s1, ++s2) {} + return *s1 - *s2; } #endif diff --git a/src/strategy/values/BudgetValues.cpp b/src/strategy/values/BudgetValues.cpp index b1045d1f..d9806087 100644 --- a/src/strategy/values/BudgetValues.cpp +++ b/src/strategy/values/BudgetValues.cpp @@ -180,6 +180,8 @@ uint32 MoneyNeededForValue::Calculate() case NeedMoneyFor::tradeskill: moneyWanted = (level * level * level); //Or level^3 (10s @ lvl10, 3g @ lvl30, 20g @ lvl60, 50g @ lvl80): Todo replace (Should be buyable reagents that combined allow crafting of usefull items) break; + default: + break; } return moneyWanted; diff --git a/src/strategy/values/ItemForSpellValue.cpp b/src/strategy/values/ItemForSpellValue.cpp index e52bbbf6..58c4fae1 100644 --- a/src/strategy/values/ItemForSpellValue.cpp +++ b/src/strategy/values/ItemForSpellValue.cpp @@ -8,8 +8,8 @@ #ifndef WIN32 inline int strcmpi(char const* s1, char const* s2) { - for (; *s1 && *s2 && (toupper(*s1) == toupper(*s2)); ++s1, ++s2); - return *s1 - *s2; + for (; *s1 && *s2 && (toupper(*s1) == toupper(*s2)); ++s1, ++s2) {} + return *s1 - *s2; } #endif