From 128aee2de2cbb228077755203e670662f020bb79 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 1 Nov 2008 23:53:35 +0300 Subject: [PATCH] Fixed some format arg type/value pairs. Other warnings. --- src/game/BattleGround.cpp | 4 ++-- src/game/BattleGroundBE.cpp | 2 +- src/game/BattleGroundEY.cpp | 5 +++-- src/game/BattleGroundMgr.cpp | 2 +- src/game/BattleGroundRL.cpp | 2 +- src/game/BattleGroundWS.cpp | 2 +- src/game/CharacterHandler.cpp | 3 ++- src/game/Corpse.cpp | 6 ++++-- src/game/LootMgr.cpp | 3 ++- src/game/MiscHandler.cpp | 4 ++-- src/game/MotionMaster.cpp | 1 + src/game/NPCHandler.cpp | 5 +++-- src/game/Pet.cpp | 8 +++++--- src/shared/Database/SqlOperations.cpp | 3 ++- 14 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 838be2a47..c1a622e7e 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -998,7 +998,7 @@ bool BattleGround::DelCreature(uint32 type) Creature *cr = HashMapHolder::Find(m_BgCreatures[type]); if(!cr) { - sLog.outError("Can't find creature guid: %u",m_BgCreatures[type]); + sLog.outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type])); return false; } cr->CleanupsBeforeDelete(); @@ -1012,7 +1012,7 @@ bool BattleGround::DelObject(uint32 type) GameObject *obj = HashMapHolder::Find(m_BgObjects[type]); if(!obj) { - sLog.outError("Can't find gobject guid: %u",m_BgObjects[type]); + sLog.outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type])); return false; } obj->SetRespawnTime(0); // not save respawn time diff --git a/src/game/BattleGroundBE.cpp b/src/game/BattleGroundBE.cpp index dcf994325..4ad71988e 100644 --- a/src/game/BattleGroundBE.cpp +++ b/src/game/BattleGroundBE.cpp @@ -104,7 +104,7 @@ void BattleGroundBE::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattleGroundBE::RemovePlayer(Player *plr, uint64 guid) +void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) { } diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp index 165b1cf42..5eb6d6286 100644 --- a/src/game/BattleGroundEY.cpp +++ b/src/game/BattleGroundEY.cpp @@ -556,7 +556,7 @@ void BattleGroundEY::RespawnFlagAfterDrop() if(obj) obj->Delete(); else - sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",GetDroppedFlagGUID()); + sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID())); SetDroppedFlagGUID(0); } @@ -741,7 +741,8 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point) WorldSafeLocsEntry const *sg = NULL; sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId); if(!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team)) - sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: u, graveyard_id: %u", Point, Team, m_CapturingPointTypes[Point].GraveYardId); + sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u", + Point, Team, m_CapturingPointTypes[Point].GraveYardId); UpdatePointsIcons(Team, Point); UpdatePointsCount(Team); diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 8ef50bea9..c07639b8d 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -341,7 +341,7 @@ void BattleGroundQueue::Update(uint32 bgTypeId, uint32 queue_id) /*** BATTLEGROUND QUEUE EVENTS ***/ /*********************************************************/ -bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 p_time) +bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { Player* plr = objmgr.GetPlayer( m_PlayerGuid ); diff --git a/src/game/BattleGroundRL.cpp b/src/game/BattleGroundRL.cpp index 130f46a63..4be135c70 100644 --- a/src/game/BattleGroundRL.cpp +++ b/src/game/BattleGroundRL.cpp @@ -98,7 +98,7 @@ void BattleGroundRL::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattleGroundRL::RemovePlayer(Player *plr, uint64 guid) +void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) { } diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index c482a959e..4334304d6 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -198,7 +198,7 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team) if(obj) obj->Delete(); else - sLog.outError("unknown droped flag bg, guid: %u",GetDroppedFlagGUID(team)); + sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team))); SetDroppedFlagGUID(0,team); } diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index f8ccbfa88..286b94553 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -758,7 +758,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) SendNotification(LANG_GM_ON); std::string IP_str = GetRemoteAddress(); - sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)",GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUID()); + sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)", + GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow()); m_playerLoading = false; delete holder; diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 6b298791d..c2a873a1b 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -79,7 +79,8 @@ bool Corpse::Create( uint32 guidlow, Player *owner, uint32 mapid, float x, float if(!IsPositionValid()) { - sLog.outError("ERROR: Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %d Y: ^%d)",guidlow,owner->GetName(),x,y); + sLog.outError("ERROR: Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)", + guidlow,owner->GetName(),x,y); return false; } @@ -196,7 +197,8 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) if(!IsPositionValid()) { - sLog.outError("ERROR: Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %d Y: ^%d)",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()),GetPositionX(),GetPositionY()); + sLog.outError("ERROR: Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", + GetGUIDLow(),GUID_LOPART(GetOwnerGUID()),GetPositionX(),GetPositionY()); return false; } diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index c19535ccd..b88169161 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -268,7 +268,8 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const if( chance != 0 && chance < 0.000001f ) // loot with low chance { - sLog.outErrorDb("Table '%s' entry %d item %d: low chance (%d) - skipped", store.GetName(), entry, itemid, chance); + sLog.outErrorDb("Table '%s' entry %d item %d: low chance (%f) - skipped", + store.GetName(), entry, itemid, chance); return false; } } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 24c2e37f1..9deb8582e 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -133,7 +133,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data ) wstrToLower(str[i]); - sLog.outDebug("String %u: %s", i, str[i].c_str()); + sLog.outDebug("String %u: %s", i, temp.c_str()); } std::wstring wplayer_name; @@ -969,7 +969,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) (fabs(rotateDy) > atEntry->box_y/2 + delta) || (fabs(dz) > atEntry->box_z/2 + delta) ) { - sLog.outDebug("Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %u 1/2 box Z: %u rotate dX: %f rotate dY: %f dZ:%f), ignore Area Trigger ID: %u", + sLog.outDebug("Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotate dX: %f rotate dY: %f dZ:%f), ignore Area Trigger ID: %u", pl->GetName(), pl->GetGUIDLow(), atEntry->box_x/2, atEntry->box_y/2, atEntry->box_z/2, rotateDx, rotateDy, dz, Trigger_ID); return; } diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 0ebb40cd6..2dc42cd4d 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -186,6 +186,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle) if(i_owner->GetTypeId()==TYPEID_PLAYER) { DEBUG_LOG("Player (GUID: %u) chase to %s (GUID: %u)", + i_owner->GetGUIDLow(), target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature", target->GetTypeId()==TYPEID_PLAYER ? i_owner->GetGUIDLow() : ((Creature*)i_owner)->GetDBTableGUIDLow() ); Mutate(new TargetedMovementGenerator(*target,dist,angle)); diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index db5d9eb3d..8a5a2b244 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -137,14 +137,15 @@ void WorldSession::SendTrainerList( uint64 guid,std::string strTitle ) if (!ci) { - sLog.outDebug( "WORLD: SendTrainerList - (%u) NO CREATUREINFO! (GUID: %u)", uint32(GUID_LOPART(guid)), guid ); + sLog.outDebug( "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid) ); return; } TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if(!trainer_spells) { - sLog.outDebug( "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", guid, unit->GetEntry()); + sLog.outDebug( "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", + GUID_LOPART(guid), unit->GetEntry()); return; } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 2bc5f1b20..9c16b2fca 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -161,7 +161,8 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu if(!IsPositionValid()) { - sLog.outError("ERROR: Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %d Y: ^%d)", GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); + sLog.outError("ERROR: Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)", + GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); delete result; return false; } @@ -179,7 +180,7 @@ bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool cu return true; } - if(getPetType() == HUNTER_PET || getPetType() == SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK) + if(getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK)) m_charmInfo->SetPetNumber(pet_number, true); else m_charmInfo->SetPetNumber(pet_number, false); @@ -734,7 +735,8 @@ bool Pet::CreateBaseAtCreature(Creature* creature) if(!IsPositionValid()) { - sLog.outError("ERROR: Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %d Y: ^%d)", GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); + sLog.outError("ERROR: Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)", + GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); return false; } diff --git a/src/shared/Database/SqlOperations.cpp b/src/shared/Database/SqlOperations.cpp index 0993551cb..bc75c591e 100644 --- a/src/shared/Database/SqlOperations.cpp +++ b/src/shared/Database/SqlOperations.cpp @@ -100,7 +100,8 @@ bool SqlQueryHolder::SetQuery(size_t index, const char *sql) if(m_queries[index].first != NULL) { - sLog.outError("Attempt assign query to holder index (%u) where other query stored (Old: [%s] New: [%s])",index,m_queries.size(),m_queries[index].first,sql); + sLog.outError("Attempt assign query to holder index (%u) where other query stored (Old: [%s] New: [%s])", + index,m_queries[index].first,sql); return false; } -- 2.11.4.GIT