From dcdddf658b2685187fe742732be3c9ea2e56add5 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Mon, 25 Sep 2017 10:54:21 +0200 Subject: [PATCH] Fixed warnings when EXTRA_LOGS are off --- .../lib-collision/src/Management/MMapManager.cpp | 2 +- modules/worldengine/nucleus/src/Define.h | 2 ++ src/game/Chat/ChatLink.cpp | 1 + src/game/DungeonFinding/LFGScripts.cpp | 7 +++++++ src/game/Entities/Unit/Unit.cpp | 2 +- src/game/Handlers/ChatHandler.cpp | 3 +++ src/game/Handlers/LFGHandler.cpp | 2 +- src/game/Spells/Auras/SpellAuraEffects.cpp | 3 +++ src/game/Warden/WardenWin.cpp | 11 ++++------- src/game/Weather/Weather.cpp | 3 +-- .../ScarletMonastery/instance_scarlet_monastery.cpp | 2 +- 11 files changed, 25 insertions(+), 13 deletions(-) diff --git a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp index 26fa9fb59..43355b834 100644 --- a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp +++ b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp @@ -157,7 +157,6 @@ namespace MMAP fclose(file); - dtMeshHeader* header = (dtMeshHeader*)data; dtTileRef tileRef = 0; dtStatus stat; @@ -172,6 +171,7 @@ namespace MMAP mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); ++loadedTiles; #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + dtMeshHeader* header = (dtMeshHeader*)data; sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); #endif return true; diff --git a/modules/worldengine/nucleus/src/Define.h b/modules/worldengine/nucleus/src/Define.h index 08bd88c27..349453101 100644 --- a/modules/worldengine/nucleus/src/Define.h +++ b/modules/worldengine/nucleus/src/Define.h @@ -74,6 +74,8 @@ #define SIZEFMTD ACE_SIZE_T_FORMAT_SPECIFIER +#define UNUSED(x) (void)(x) + typedef std::int64_t int64; typedef std::int32_t int32; typedef std::int16_t int16; diff --git a/src/game/Chat/ChatLink.cpp b/src/game/Chat/ChatLink.cpp index b82fc1af9..6052c9a6e 100644 --- a/src/game/Chat/ChatLink.cpp +++ b/src/game/Chat/ChatLink.cpp @@ -61,6 +61,7 @@ inline std::string ReadSkip(std::istringstream& iss, char term) inline bool CheckDelimiter(std::istringstream& iss, char delimiter, const char* context) { + UNUSED(context); // used only with EXTRA_LOGS char c = iss.peek(); if (c != delimiter) { diff --git a/src/game/DungeonFinding/LFGScripts.cpp b/src/game/DungeonFinding/LFGScripts.cpp index e6153d9b8..63dfe243b 100644 --- a/src/game/DungeonFinding/LFGScripts.cpp +++ b/src/game/DungeonFinding/LFGScripts.cpp @@ -176,6 +176,10 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid) void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason) { + // used only with EXTRA_LOGS + UNUSED(kicker); + UNUSED(reason); + if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER)) return; @@ -271,6 +275,9 @@ void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 o void LFGGroupScript::OnInviteMember(Group* group, uint64 guid) { + // used only with EXTRA_LOGS + UNUSED(guid); + if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER)) return; diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index a70577101..8b788b471 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -15060,7 +15060,6 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u bool takeCharges = false; SpellInfo const* spellInfo = i->aura->GetSpellInfo(); - uint32 Id = i->aura->GetId(); AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID()); @@ -15084,6 +15083,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + uint32 Id = i->aura->GetId(); sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); #endif takeCharges = true; diff --git a/src/game/Handlers/ChatHandler.cpp b/src/game/Handlers/ChatHandler.cpp index c0f9c2659..d0e2d9fd2 100644 --- a/src/game/Handlers/ChatHandler.cpp +++ b/src/game/Handlers/ChatHandler.cpp @@ -699,6 +699,9 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData) void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket) { + // used only with EXTRA_LOGS + UNUSED(recvPacket); + #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); #endif diff --git a/src/game/Handlers/LFGHandler.cpp b/src/game/Handlers/LFGHandler.cpp index 0673e0b01..5e0fd6448 100644 --- a/src/game/Handlers/LFGHandler.cpp +++ b/src/game/Handlers/LFGHandler.cpp @@ -137,10 +137,10 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) { - uint64 guid = GetPlayer()->GetGUID(); std::string comment; recvData >> comment; #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + uint64 guid = GetPlayer()->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); #endif diff --git a/src/game/Spells/Auras/SpellAuraEffects.cpp b/src/game/Spells/Auras/SpellAuraEffects.cpp index b087e819d..b0e436efb 100644 --- a/src/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/game/Spells/Auras/SpellAuraEffects.cpp @@ -6653,6 +6653,9 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell; if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { + // used only with EXTRA_LOGS + UNUSED(triggeredSpellInfo); + int32 basepoints0 = GetAmount(); #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId()); diff --git a/src/game/Warden/WardenWin.cpp b/src/game/Warden/WardenWin.cpp index 0d8037e93..3324459c4 100644 --- a/src/game/Warden/WardenWin.cpp +++ b/src/game/Warden/WardenWin.cpp @@ -396,19 +396,16 @@ void WardenWin::HandleData(ByteBuffer &buff) uint32 newClientTicks; buff >> newClientTicks; +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) uint32 ticksNow = World::GetGameTimeMS(); uint32 ourTicks = newClientTicks + (ticksNow - _serverTicks); -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "ServerTicks %u", ticksNow); // Now -#endif -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_WARDEN, "RequestTicks %u", _serverTicks); // At request -#endif -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_WARDEN, "Ticks %u", newClientTicks); // At response -#endif -#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); #endif } diff --git a/src/game/Weather/Weather.cpp b/src/game/Weather/Weather.cpp index 465cde59c..54c3cb471 100644 --- a/src/game/Weather/Weather.cpp +++ b/src/game/Weather/Weather.cpp @@ -87,9 +87,8 @@ bool Weather::ReGenerate() ACE_OS::localtime_r(>ime, <ime); uint32 season = ((ltime.tm_yday - 78 + 365)/91)%4; - static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" }; - #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" }; sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); #endif diff --git a/src/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index da129f34a..0793279da 100644 --- a/src/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -553,7 +553,7 @@ public: //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out if (Wait_Timer <= diff) { - if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE))) + if (ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE))) { DoCast(SPELL_SCARLET_RESURRECTION); Talk(SAY_WH_RESURRECT);