aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-24 17:38:14 -0600
committermegamage <none@none>2009-03-24 17:38:14 -0600
commit941e5b9dbd1c1dd6056bf4d5b2b057b0043ce63c (patch)
tree2bc2024abe3d327e568984f85e2b8247bd16ec68 /src
parentcda206aacc9cdd3b9038f7cecfb9b0a71558c86f (diff)
[7532] Avoid warnings at use size_t with printf fromat strings. Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/AchievementMgr.cpp9
-rw-r--r--src/game/AuctionHouseHandler.cpp2
-rw-r--r--src/game/Guild.cpp2
-rw-r--r--src/game/LootHandler.cpp2
-rw-r--r--src/game/LootMgr.cpp2
-rw-r--r--src/game/ObjectMgr.cpp26
-rw-r--r--src/game/SpellAuras.cpp13
-rw-r--r--src/game/SpellHandler.cpp6
-rw-r--r--src/game/Transports.cpp2
-rw-r--r--src/shared/ByteBuffer.h8
-rw-r--r--src/shared/Database/DBCStores.cpp2
-rw-r--r--src/shared/Database/SqlOperations.cpp2
12 files changed, 43 insertions, 33 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 4bd2c71e69a..aef535cc337 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -1310,7 +1310,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
}
sLog.outString("");
- sLog.outString(">> Loaded %u achievement criteria.",m_AchievementCriteriasByType->size());
+ sLog.outString(">> Loaded %lu achievement criteria.",(unsigned long)m_AchievementCriteriasByType->size());
}
@@ -1339,7 +1339,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
delete result;
sLog.outString("");
- sLog.outString(">> Loaded %u realm completed achievements.",m_allCompletedAchievements.size());
+ sLog.outString(">> Loaded %lu realm completed achievements.",(unsigned long)m_allCompletedAchievements.size());
}
void AchievementGlobalMgr::LoadRewards()
@@ -1449,7 +1449,7 @@ void AchievementGlobalMgr::LoadRewards()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u achievement reward locale strings", m_achievementRewardLocales.size() );
+ sLog.outString( ">> Loaded %lu achievement reward locale strings", (unsigned long)m_achievementRewardLocales.size() );
}
void AchievementGlobalMgr::LoadRewardLocales()
@@ -1517,6 +1517,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
delete result;
+
sLog.outString("");
- sLog.outString( ">> Loaded %u achievement reward locale strings", m_achievementRewardLocales.size() );
+ sLog.outString( ">> Loaded %lu achievement reward locale strings", (unsigned long)m_achievementRewardLocales.size() );
}
diff --git a/src/game/AuctionHouseHandler.cpp b/src/game/AuctionHouseHandler.cpp
index dcf462de46a..ef9d8d92682 100644
--- a/src/game/AuctionHouseHandler.cpp
+++ b/src/game/AuctionHouseHandler.cpp
@@ -502,7 +502,7 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
recv_data >> outbiddedCount;
if (recv_data.size() != (16 + outbiddedCount * 4 ))
{
- sLog.outError("Client sent bad opcode!!! with count: %u and size : %d (mustbe: %d", outbiddedCount, recv_data.size(),(16 + outbiddedCount * 4 ));
+ sLog.outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(),(16 + outbiddedCount * 4 ));
outbiddedCount = 0;
}
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 4aa9f54f682..b35bdf300bf 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -614,7 +614,7 @@ void Guild::CreateRank(std::string name_,uint32 rights)
// name now can be used for encoding to DB
CharacterDatabase.escape_string(name_);
- CharacterDatabase.PExecute( "INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", Id, m_ranks.size(), name_.c_str(), rights );
+ CharacterDatabase.PExecute( "INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", Id, (unsigned int)m_ranks.size(), name_.c_str(), rights );
}
void Guild::AddRank(const std::string& name_,uint32 rights, uint32 money)
diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp
index 5015a01c064..6aded9b1f97 100644
--- a/src/game/LootHandler.cpp
+++ b/src/game/LootHandler.cpp
@@ -490,7 +490,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
if (slotid > pLoot->items.size())
{
- sLog.outDebug("AutoLootItem: Player %s might be using a hack! (slot %d, size %d)",GetPlayer()->GetName(), slotid, pLoot->items.size());
+ sLog.outDebug("AutoLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size());
return;
}
diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp
index ec1ebca5381..8a9bf99f503 100644
--- a/src/game/LootMgr.cpp
+++ b/src/game/LootMgr.cpp
@@ -169,7 +169,7 @@ void LootStore::LoadLootTable()
Verify(); // Checks validity of the loot store
sLog.outString("");
- sLog.outString( ">> Loaded %u loot definitions (%d templates)", count, m_LootTemplates.size());
+ sLog.outString( ">> Loaded %u loot definitions (%lu templates)", count, (unsigned long)m_LootTemplates.size());
}
else
{
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 59dfd500f25..92e8872a8b0 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -384,7 +384,7 @@ void ObjectMgr::LoadCreatureLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u creature locale strings", mCreatureLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu creature locale strings", (unsigned long)mCreatureLocaleMap.size() );
}
void ObjectMgr::LoadNpcOptionLocales()
@@ -452,7 +452,7 @@ void ObjectMgr::LoadNpcOptionLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u npc_option locale strings", mNpcOptionLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu npc_option locale strings", (unsigned long)mNpcOptionLocaleMap.size() );
}
void ObjectMgr::LoadPointOfInterestLocales()
@@ -503,7 +503,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u points_of_interest locale strings", mPointOfInterestLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu points_of_interest locale strings", (unsigned long)mPointOfInterestLocaleMap.size() );
}
struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
@@ -1068,7 +1068,7 @@ void ObjectMgr::LoadCreatures()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u creatures", mCreatureDataMap.size() );
+ sLog.outString( ">> Loaded %lu creatures", (unsigned long)mCreatureDataMap.size() );
}
void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
@@ -1196,7 +1196,7 @@ void ObjectMgr::LoadGameobjects()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u gameobjects", mGameObjectDataMap.size());
+ sLog.outString( ">> Loaded %lu gameobjects", (unsigned long)mGameObjectDataMap.size());
}
void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
@@ -1269,7 +1269,7 @@ void ObjectMgr::LoadCreatureRespawnTimes()
delete result;
- sLog.outString( ">> Loaded %u creature respawn times", mCreatureRespawnTimes.size() );
+ sLog.outString( ">> Loaded %lu creature respawn times", (unsigned long)mCreatureRespawnTimes.size() );
sLog.outString("");
}
@@ -1311,7 +1311,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes()
delete result;
- sLog.outString( ">> Loaded %u gameobject respawn times", mGORespawnTimes.size() );
+ sLog.outString( ">> Loaded %lu gameobject respawn times", (unsigned long)mGORespawnTimes.size() );
sLog.outString("");
}
@@ -1463,7 +1463,7 @@ void ObjectMgr::LoadItemLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u Item locale strings", mItemLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu Item locale strings", (unsigned long)mItemLocaleMap.size() );
}
struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
@@ -3510,7 +3510,7 @@ void ObjectMgr::LoadQuests()
}
sLog.outString("");
- sLog.outString( ">> Loaded %u quests definitions", mQuestTemplates.size() );
+ sLog.outString( ">> Loaded %lu quests definitions", (unsigned long)mQuestTemplates.size() );
}
void ObjectMgr::LoadQuestLocales()
@@ -3646,7 +3646,7 @@ void ObjectMgr::LoadQuestLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u Quest locale strings", mQuestLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu Quest locale strings", (unsigned long)mQuestLocaleMap.size() );
}
void ObjectMgr::LoadPetCreateSpells()
@@ -4209,7 +4209,7 @@ void ObjectMgr::LoadPageTextLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u PageText locale strings", mPageTextLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu PageText locale strings", (unsigned long)mPageTextLocaleMap.size() );
}
struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
@@ -4404,7 +4404,7 @@ void ObjectMgr::LoadNpcTextLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u NpcText locale strings", mNpcTextLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu NpcText locale strings", (unsigned long)mNpcTextLocaleMap.size() );
}
//not very fast function but it is called only once a day, or on starting-up
@@ -5573,7 +5573,7 @@ void ObjectMgr::LoadGameObjectLocales()
delete result;
sLog.outString("");
- sLog.outString( ">> Loaded %u gameobject locale strings", mGameObjectLocaleMap.size() );
+ sLog.outString( ">> Loaded %lu gameobject locale strings", (unsigned long)mGameObjectLocaleMap.size() );
}
struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 1798fbf6f21..45e573a2cb8 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3077,8 +3077,15 @@ void Aura::HandleAuraModScale(bool apply, bool Real)
{
m_target->SetCharmerGUID(GetCasterGUID());
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
+
caster->SetCharm(m_target);
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ ((Player*)caster)->SetFarSightGUID(m_target->GetGUID());
+ ((Player*)caster)->SetClientControl(m_target, 1);
+ }
+
m_target->CombatStop();
m_target->DeleteThreatList();
if(m_target->GetTypeId() == TYPEID_UNIT)
@@ -3111,11 +3118,15 @@ void Aura::HandleAuraModScale(bool apply, bool Real)
if(caster->GetTypeId() == TYPEID_PLAYER)
{
+ ((Player*)caster)->SetFarSightGUID(0);
+ ((Player*)caster)->SetClientControl(m_target,0);
+
WorldPacket data(SMSG_PET_SPELLS, 8+4);
data << uint64(0);
data << uint32(0);
((Player*)caster)->GetSession()->SendPacket(&data);
}
+
if(m_target->GetTypeId() == TYPEID_UNIT)
{
((Creature*)m_target)->AIM_Initialize();
@@ -3124,8 +3135,6 @@ void Aura::HandleAuraModScale(bool apply, bool Real)
((Creature*)m_target)->AI()->AttackStart(caster);
}
}
- if(caster->GetTypeId() == TYPEID_PLAYER)
- ((Player*)caster)->SetFarSightGUID(apply ? m_target->GetGUID() : 0);
}
void Aura::HandleModPossessPet(bool apply, bool Real)
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index d5dfcb8dab4..e15dd92149b 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -60,7 +60,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
return;
}
- sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, cast_count: %u, spellid: %u, Item: %u, glyphIndex: %u, unk_flags: %u, data length = %i", bagIndex, slot, cast_count, spellid, pItem->GetEntry(), glyphIndex, unk_flags, recvPacket.size());
+ sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, cast_count: %u, spellid: %u, Item: %u, glyphIndex: %u, unk_flags: %u, data length = %i", bagIndex, slot, cast_count, spellid, pItem->GetEntry(), glyphIndex, unk_flags, (uint32)recvPacket.size());
ItemPrototype const *proto = pItem->GetProto();
if(!proto)
@@ -139,7 +139,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket,1+1);
- sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",recvPacket.size());
+ sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",(uint32)recvPacket.size());
Player* pUser = _player;
uint8 bagIndex, slot;
@@ -251,7 +251,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
recvPacket >> unk_flags; // flags (if 0x02 - some additional data are received)
sLog.outDebug("WORLD: got cast spell packet, spellId - %u, cast_count: %u, unk_flags %u, data length = %i",
- spellId, cast_count, unk_flags, recvPacket.size());
+ spellId, cast_count, unk_flags, (uint32)recvPacket.size());
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId );
diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp
index 23b53ee1ccf..ea267f5df46 100644
--- a/src/game/Transports.cpp
+++ b/src/game/Transports.cpp
@@ -416,7 +416,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
uint32 timer = t;
- // sLog.outDetail(" Generated %d waypoints, total time %u.", m_WayPoints.size(), timer);
+ // sLog.outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
m_curr = m_WayPoints.begin();
m_curr = GetNextWayPoint();
diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h
index 5f8a584eb0f..16988632871 100644
--- a/src/shared/ByteBuffer.h
+++ b/src/shared/ByteBuffer.h
@@ -340,7 +340,7 @@ class ByteBuffer
if(!sLog.IsOutDebug()) // optimize disabled debug output
return;
- sLog.outDebug("STORAGE_SIZE: %u", size() );
+ sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); i++)
sLog.outDebugInLine("%u - ", read<uint8>(i) );
sLog.outDebug(" ");
@@ -351,7 +351,7 @@ class ByteBuffer
if(!sLog.IsOutDebug()) // optimize disabled debug output
return;
- sLog.outDebug("STORAGE_SIZE: %u", size() );
+ sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); i++)
sLog.outDebugInLine("%c", read<uint8>(i) );
sLog.outDebug(" ");
@@ -363,7 +363,7 @@ class ByteBuffer
return;
uint32 j = 1, k = 1;
- sLog.outDebug("STORAGE_SIZE: %u", size() );
+ sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() );
for(uint32 i = 0; i < size(); i++)
{
@@ -415,7 +415,7 @@ class ByteBuffer
protected:
bool PrintPosError(bool add, size_t pos, size_t esize) const
{
- sLog.outError("ERROR: Attempt %s in ByteBuffer (pos: %u size: %u) value with size: %u",(add ? "put" : "get"),pos, size(), esize);
+ sLog.outError("ERROR: Attempt %s in ByteBuffer (pos: %lu size: %lu) value with size: %lu",(add ? "put" : "get"),(unsigned long)pos, (unsigned long)size(), (unsigned long)esize);
// assert must fail after function call
return false;
diff --git a/src/shared/Database/DBCStores.cpp b/src/shared/Database/DBCStores.cpp
index 6b59489f77e..ba61b028203 100644
--- a/src/shared/Database/DBCStores.cpp
+++ b/src/shared/Database/DBCStores.cpp
@@ -506,7 +506,7 @@ void LoadDBCStores(const std::string& dataPath)
for(std::list<std::string>::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
str += *i + "\n";
- sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",bad_dbc_files.size(),DBCFilesCount,str.c_str());
+ sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str());
exit(1);
}
diff --git a/src/shared/Database/SqlOperations.cpp b/src/shared/Database/SqlOperations.cpp
index 68f5759a85e..53b99359c09 100644
--- a/src/shared/Database/SqlOperations.cpp
+++ b/src/shared/Database/SqlOperations.cpp
@@ -97,7 +97,7 @@ bool SqlQueryHolder::SetQuery(size_t index, const char *sql)
{
if(m_queries.size() <= index)
{
- sLog.outError("Query index (%u) out of range (size: %u) for query: %s",index,m_queries.size(),sql);
+ sLog.outError("Query index (%u) out of range (size: %u) for query: %s",index,(uint32)m_queries.size(),sql);
return false;
}