[7532] Avoid warnings at use size_t with printf fromat strings. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -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() );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
+13
-13
@@ -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>
|
||||
|
||||
+11
-2
@@ -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)
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user