Skip to content

Commit

Permalink
Replaced SIZEFMTD macro with "%zu" format parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sanctum32 authored and billy1arm committed Aug 19, 2024
1 parent 17f7357 commit 943af6a
Show file tree
Hide file tree
Showing 22 changed files with 55 additions and 58 deletions.
14 changes: 7 additions & 7 deletions src/game/AuctionHouseBot/AuctionHouseBot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ uint32 AuctionBotBuyer::GetBuyableEntry(AHB_Buyer_Config& config)
}

DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: %u items added to buyable vector for AH type: %u", count, config.GetHouseType());
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: SameItemInfo size = " SIZEFMTD, config.SameItemInfo.size());
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: SameItemInfo size = %zu", config.SameItemInfo.size());
return count;
}

Expand All @@ -822,7 +822,7 @@ void AuctionBotBuyer::PrepareListOfEntry(AHB_Buyer_Config& config)
}
}

DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: CheckedEntry size = " SIZEFMTD, config.CheckedEntry.size());
DEBUG_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot: CheckedEntry size = %zu", config.CheckedEntry.size());
}

bool AuctionBotBuyer::IsBuyableEntry(uint64 buyoutPrice, double InGame_BuyPrice, double MaxBuyablePrice, uint64 MinBuyPrice, uint32 MaxChance, uint32 ChanceRatio)
Expand Down Expand Up @@ -1187,8 +1187,8 @@ bool AuctionBotSeller::Initialize()
excludeItems.push_back(atoi(temp.c_str()));
}
}
sLog.outString("Forced Inclusion " SIZEFMTD " items", includeItems.size());
sLog.outString("Forced Exclusion " SIZEFMTD " items", excludeItems.size());
sLog.outString("Forced Inclusion %zu items", includeItems.size());
sLog.outString("Forced Exclusion %zu items", excludeItems.size());
sLog.outString();

sLog.outString("Loading npc vendor items for filter..");
Expand All @@ -1209,7 +1209,7 @@ bool AuctionBotSeller::Initialize()
BarGoLink bar(1);
bar.step();
}
sLog.outString("Npc vendor filter has " SIZEFMTD " items", npcItems.size());
sLog.outString("Npc vendor filter has %zu items", npcItems.size());
sLog.outString();

sLog.outString("Loading loot items for filter..");
Expand Down Expand Up @@ -1247,7 +1247,7 @@ bool AuctionBotSeller::Initialize()
BarGoLink bar(1);
bar.step();
}
sLog.outString("Loot filter has " SIZEFMTD " items", lootItems.size());
sLog.outString("Loot filter has %zu items", lootItems.size());
sLog.outString();

sLog.outString("Sorting and cleaning items for AHBot seller...");
Expand Down Expand Up @@ -1608,7 +1608,7 @@ bool AuctionBotSeller::Initialize()

sLog.outString("Items loaded \tGrey\tWhite\tGreen\tBlue\tPurple\tOrange\tYellow");
for (uint32 i = 0; i < MAX_ITEM_CLASS; ++i)
sLog.outString("%-18s\t" SIZEFMTD "\t" SIZEFMTD "\t" SIZEFMTD "\t" SIZEFMTD "\t" SIZEFMTD "\t" SIZEFMTD "\t" SIZEFMTD,
sLog.outString("%-18s\t%zu\t%zu\t%zu\t%zu\t%zu\t%zu\t%zu",
sAuctionBotConfig.GetItemClassName(ItemClass(i)),
m_ItemPool[0][i].size(), m_ItemPool[1][i].size(), m_ItemPool[2][i].size(),
m_ItemPool[3][i].size(), m_ItemPool[4][i].size(), m_ItemPool[5][i].size(),
Expand Down
8 changes: 4 additions & 4 deletions src/game/ChatCommands/DebugCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,15 +823,15 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)

if (item->GetOwnerGuid() != player->GetObjectGuid())
{
PSendSysMessage("queue(" SIZEFMTD "): %s has the owner (%s) and inventory owner (%s) don't match!",
PSendSysMessage("queue(%zu): %s has the owner (%s) and inventory owner (%s) don't match!",
i, item->GetGuidStr().c_str(),
item->GetOwnerGuid().GetString().c_str(), player->GetGuidStr().c_str());
error = true; continue;
}

if (item->GetQueuePos() != i)
{
PSendSysMessage("queue(" SIZEFMTD "): %s has queuepos doesn't match it's position in the queue!",
PSendSysMessage("queue(%zu): %s has queuepos doesn't match it's position in the queue!",
i, item->GetGuidStr().c_str());
error = true; continue;
}
Expand All @@ -844,14 +844,14 @@ bool ChatHandler::HandleDebugGetItemStateCommand(char* args)

if (test == NULL)
{
PSendSysMessage("queue(" SIZEFMTD "): %s has incorrect (bag %u slot %u) values, the player doesn't have an item at that position!",
PSendSysMessage("queue(%zu): %s has incorrect (bag %u slot %u) values, the player doesn't have an item at that position!",
i, item->GetGuidStr().c_str(), item->GetBagSlot(), item->GetSlot());
error = true; continue;
}

if (test != item)
{
PSendSysMessage("queue(" SIZEFMTD "): %s has incorrect (bag %u slot %u) values, the %s is there instead!",
PSendSysMessage("queue(%zu): %s has incorrect (bag %u slot %u) values, the %s is there instead!",
i, item->GetGuidStr().c_str(), item->GetBagSlot(), item->GetSlot(),
test->GetGuidStr().c_str());
error = true; continue;
Expand Down
4 changes: 2 additions & 2 deletions src/game/ChatCommands/MMapCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bool ChatHandler::HandleMmapPathCommand(char* args)
PointsArray pointPath = path.getPath();
PSendSysMessage("%s's path to %s:", originUnit->GetName(), destinationUnit->GetName());
PSendSysMessage("Building %s", useStraightPath ? "StraightPath" : "SmoothPath");
PSendSysMessage("length " SIZEFMTD " type %u", pointPath.size(), path.getPathType());
PSendSysMessage("length %zu type %u", pointPath.size(), path.getPathType());

Vector3 start = path.getStartPosition();
Vector3 end = path.getEndPosition();
Expand Down Expand Up @@ -320,7 +320,7 @@ bool ChatHandler::HandleMmapTestArea(char* args)

if (!creatureList.empty())
{
PSendSysMessage("Found " SIZEFMTD " Creatures.", creatureList.size());
PSendSysMessage("Found %zu Creatures.", creatureList.size());

uint32 paths = 0;
uint32 uStartTime = GameTime::GetGameTimeMS();
Expand Down
2 changes: 1 addition & 1 deletion src/game/Object/GMTicketMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void GMTicketMgr::LoadGMTickets()
while (result->NextRow());
delete result;

sLog.outString(">> Loaded " SIZEFMTD " GM tickets", GetTicketCount());
sLog.outString(">> Loaded %zu GM tickets", GetTicketCount());
sLog.outString();
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/Object/LootMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void LootStore::LoadLootTable()
Verify(); // Checks validity of the loot store

sLog.outString();
sLog.outString(">> Loaded %u loot definitions (" SIZEFMTD " templates) from table %s", count, m_LootTemplates.size(), GetName());
sLog.outString(">> Loaded %u loot definitions (%zu templates) from table %s", count, m_LootTemplates.size(), GetName());
}
else
{
Expand Down
24 changes: 12 additions & 12 deletions src/game/Object/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void ObjectMgr::LoadCreatureLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " creature locale strings", mCreatureLocaleMap.size());
sLog.outString(">> Loaded %zu creature locale strings", mCreatureLocaleMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -445,7 +445,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " gossip_menu_option locale strings", mGossipMenuItemsLocaleMap.size());
sLog.outString(">> Loaded %zu gossip_menu_option locale strings", mGossipMenuItemsLocaleMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -508,7 +508,7 @@ void ObjectMgr::LoadPointOfInterestLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " points_of_interest locale strings", mPointOfInterestLocaleMap.size());
sLog.outString(">> Loaded %zu points_of_interest locale strings", mPointOfInterestLocaleMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -1669,7 +1669,7 @@ void ObjectMgr::LoadCreatures()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " creatures", mCreatureDataMap.size());
sLog.outString(">> Loaded %zu creatures", mCreatureDataMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -1883,7 +1883,7 @@ void ObjectMgr::LoadGameObjects()
delete result;

sLog.outString();
sLog.outString(">> Loaded " SIZEFMTD " gameobjects", mGameObjectDataMap.size());
sLog.outString(">> Loaded %zu gameobjects", mGameObjectDataMap.size());
}

void ObjectMgr::LoadGameObjectAddon()
Expand Down Expand Up @@ -2124,7 +2124,7 @@ void ObjectMgr::LoadItemLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " Item locale strings", mItemLocaleMap.size());
sLog.outString(">> Loaded %zu Item locale strings", mItemLocaleMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -4884,7 +4884,7 @@ void ObjectMgr::LoadQuests()
}
}

sLog.outString(">> Loaded " SIZEFMTD " quests definitions", mQuestTemplates.size());
sLog.outString(">> Loaded %zu quests definitions", mQuestTemplates.size());
sLog.outString();
}

Expand Down Expand Up @@ -5113,7 +5113,7 @@ void ObjectMgr::LoadQuestLocales()
delete result;

sLog.outString();
sLog.outString(">> Loaded " SIZEFMTD " Quest locale strings", mQuestLocaleMap.size());
sLog.outString(">> Loaded %zu Quest locale strings", mQuestLocaleMap.size());
}

void ObjectMgr::LoadPageTexts()
Expand Down Expand Up @@ -5222,7 +5222,7 @@ void ObjectMgr::LoadPageTextLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " PageText locale strings", mPageTextLocaleMap.size());
sLog.outString(">> Loaded %zu PageText locale strings", mPageTextLocaleMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -5296,7 +5296,7 @@ void ObjectMgr::LoadInstanceEncounters()
delete result;

sLog.outString();
sLog.outString(">> Loaded " SIZEFMTD " Instance Encounters", m_DungeonEncounters.size());
sLog.outString(">> Loaded %zu Instance Encounters", m_DungeonEncounters.size());
}

struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader, SQLStorage>
Expand Down Expand Up @@ -5577,7 +5577,7 @@ void ObjectMgr::LoadGossipTextLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " NpcText locale strings", mNpcTextLocaleMap.size());
sLog.outString(">> Loaded %zu NpcText locale strings", mNpcTextLocaleMap.size());
sLog.outString();
}

Expand Down Expand Up @@ -6639,7 +6639,7 @@ void ObjectMgr::LoadGameObjectLocales()

delete result;

sLog.outString(">> Loaded " SIZEFMTD " gameobject locale strings", mGameObjectLocaleMap.size());
sLog.outString(">> Loaded %zu gameobject locale strings", mGameObjectLocaleMap.size());
sLog.outString();
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/Server/DB2Stores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ inline void LoadDB2(LocalDB2Data& localeData, StoreProblemList1& errors, DB2Stor
if (FILE* f = fopen(db2Filename.c_str(), "rb"))
{
char buf[100];
snprintf(buf, 100, " (exist, but have %d fields instead " SIZEFMTD ") Wrong client version DB2 file?", storage.GetFieldCount(), strlen(storage.GetFormat()));
snprintf(buf, 100, " (exist, but have %d fields instead %zu) Wrong client version DB2 file?", storage.GetFieldCount(), strlen(storage.GetFormat()));
errors.push_back(db2Filename + buf);
fclose(f);
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/Server/DBCStores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& err
if (f)
{
char buf[100];
snprintf(buf, 100, " (exist, but have %u fields instead " SIZEFMTD ") Wrong client version DBC file?", storage.GetFieldCount(), strlen(storage.GetFormat()));
snprintf(buf, 100, " (exist, but have %u fields instead %zu) Wrong client version DBC file?", storage.GetFieldCount(), strlen(storage.GetFormat()));
errlist.push_back(dbc_filename + buf);
fclose(f);
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/Server/WorldSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ WorldSession::~WorldSession()

void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
{
sLog.outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt crash server?), skipped",
sLog.outError("Client (account %u) send packet %s (%u) with size %zu but expected %u (attempt crash server?), skipped",
GetAccountId(), packet.GetOpcodeName(), packet.GetOpcode(), packet.size(), size);
}

Expand Down Expand Up @@ -251,7 +251,7 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* reason)
/// Logging helper for unexpected opcodes
void WorldSession::LogUnprocessedTail(WorldPacket* packet)
{
sLog.outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at " SIZEFMTD " from " SIZEFMTD ")",
sLog.outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %zu from %zu)",
packet->GetOpcodeName(),
packet->GetOpcode(),
packet->rpos(), packet->wpos());
Expand Down
2 changes: 1 addition & 1 deletion src/game/Server/WorldSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
#endif /* ENABLE_ELUNA */
return HandleAuthSession(*new_pct);
case CMSG_KEEP_ALIVE:
DEBUG_LOG("CMSG_KEEP_ALIVE ,size: " SIZEFMTD " ", new_pct->size());
DEBUG_LOG("CMSG_KEEP_ALIVE ,size: %zu ", new_pct->size());

#ifdef ENABLE_ELUNA
sEluna->OnPacketReceive(m_Session, *new_pct);
Expand Down
4 changes: 2 additions & 2 deletions src/game/WorldHandlers/AchievementMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
delete result;

sLog.outString();
sLog.outString(">> Loaded " SIZEFMTD " realm completed achievements.", m_allCompletedAchievements.size());
sLog.outString(">> Loaded %zu realm completed achievements.", m_allCompletedAchievements.size());
}

void AchievementGlobalMgr::LoadRewards()
Expand Down Expand Up @@ -3300,5 +3300,5 @@ void AchievementGlobalMgr::LoadRewardLocales()
delete result;

sLog.outString();
sLog.outString(">> Loaded " SIZEFMTD " achievement reward locale strings", m_achievementRewardLocales.size());
sLog.outString(">> Loaded %zu achievement reward locale strings", m_achievementRewardLocales.size());
}
4 changes: 2 additions & 2 deletions src/game/WorldHandlers/CalendarHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
sCalendarMgr.GetPlayerInvitesList(guid, invites);

data << uint32(invites.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > " SIZEFMTD " invites", invites.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > %zu invites", invites.size());

for (CalendarInvitesList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr)
{
Expand All @@ -72,7 +72,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/)
sCalendarMgr.GetPlayerEventsList(guid, events);

data << uint32(events.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > " SIZEFMTD " events", events.size());
DEBUG_FILTER_LOG(LOG_FILTER_CALENDAR, "Sending > %zu events", events.size());

for (CalendarEventsList::const_iterator itr = events.begin(); itr != events.end(); ++itr)
{
Expand Down
12 changes: 6 additions & 6 deletions src/game/WorldHandlers/GameEventMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)

if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventCreatureGuids.size())
{
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size());
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: %zu)", internal_event_id, mGameEventCreatureGuids.size());
return;
}

Expand Down Expand Up @@ -788,7 +788,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)

if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventGameobjectGuids.size())
{
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size());
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %zu)", internal_event_id, mGameEventGameobjectGuids.size());
return;
}

Expand Down Expand Up @@ -820,7 +820,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
{
if ((size_t)event_id >= mGameEventSpawnPoolIds.size())
{
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventSpawnPoolIds element %i (size: " SIZEFMTD ")", event_id, mGameEventSpawnPoolIds.size());
sLog.outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventSpawnPoolIds element %i (size: %zu)", event_id, mGameEventSpawnPoolIds.size());
return;
}

Expand All @@ -837,7 +837,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)

if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventCreatureGuids.size())
{
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size());
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: %zu)", internal_event_id, mGameEventCreatureGuids.size());
return;
}

Expand Down Expand Up @@ -867,7 +867,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)

if (internal_event_id < 0 || (size_t)internal_event_id >= mGameEventGameobjectGuids.size())
{
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size());
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: %zu)", internal_event_id, mGameEventGameobjectGuids.size());
return;
}

Expand Down Expand Up @@ -899,7 +899,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
{
if ((size_t)event_id >= mGameEventSpawnPoolIds.size())
{
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventSpawnPoolIds element %i (size: " SIZEFMTD ")", event_id, mGameEventSpawnPoolIds.size());
sLog.outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventSpawnPoolIds element %i (size: %zu)", event_id, mGameEventSpawnPoolIds.size());
return;
}

Expand Down
3 changes: 1 addition & 2 deletions src/game/WorldHandlers/LootHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recv_data)

if (slotid >= pLoot->items.size())
{
DEBUG_LOG("WorldSession::HandleLootMasterGiveOpcode: Player %s might be using a hack! (slot %d, size %lu)",
GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size());
DEBUG_LOG("AutoLootItem: Player %s might be using a hack! (slot %d, size %zu)", GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/WorldHandlers/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5896,7 +5896,7 @@ void Spell::HandleThreatSpells()
}
}

DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell %u added an additional %f threat for %s " SIZEFMTD " target(s)", m_spellInfo->Id, threat, positive ? "assisting" : "harming", m_UniqueTargetInfo.size());
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell %u added an additional %f threat for %s %zu target(s)", m_spellInfo->Id, threat, positive ? "assisting" : "harming", m_UniqueTargetInfo.size());
}

void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, SpellEffectIndex i, float DamageMultiplier)
Expand Down
Loading

0 comments on commit 943af6a

Please sign in to comment.