Skip to content

Commit

Permalink
Fix compiling with gcc-4.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Artox committed Jul 2, 2012
1 parent 0c518ae commit a5b2a8e
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 36 deletions.
1 change: 1 addition & 0 deletions dep/include/g3dlite/G3D/GMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifndef G3D_WIN32
# include <pthread.h>
# include <signal.h>
# include <unistd.h>
#endif


Expand Down
4 changes: 2 additions & 2 deletions src/arcemu-world/AchievementMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ bool AchievementMgr::GMCompleteAchievement(WorldSession* gmSession, int32 achiev
}
if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
{
gmSession->SystemMessage("Achievement (%lu) |Hachievement:%lu:"I64FMT":0:0:0:-1:0:0:0:0|h[%s]|h is a counter and cannot be completed.",
gmSession->SystemMessage("Achievement (%lu) |Hachievement:%lu:" I64FMT ":0:0:0:-1:0:0:0:0|h[%s]|h is a counter and cannot be completed.",
achievement->ID, achievement->ID, gmSession->GetPlayer()->GetGUID(), achievement->name);
return false;
}
Expand Down Expand Up @@ -2159,7 +2159,7 @@ bool AchievementMgr::GMCompleteCriteria(WorldSession* gmSession, int32 criteriaI
if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
{
// can't complete this type of achivement (counter)
gmSession->SystemMessage("Referred achievement (%lu) |Hachievement:%lu:"I64FMT":0:0:0:-1:0:0:0:0|h[%s]|h is a counter and cannot be completed.",
gmSession->SystemMessage("Referred achievement (%lu) |Hachievement:%lu:" I64FMT ":0:0:0:-1:0:0:0:0|h[%s]|h is a counter and cannot be completed.",
achievement->ID, achievement->ID, gmSession->GetPlayer()->GetGUID(), achievement->name);
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/CombatHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data)

if(!pEnemy)
{
LOG_DEBUG("WORLD: "I64FMT" does not exist.", guid);
LOG_DEBUG("WORLD: " I64FMT " does not exist.", guid);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/arcemu-world/Creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void Creature::OnRemoveCorpse()
if(IsInWorld() && (int32)m_mapMgr->GetInstanceID() == m_instanceId)
{

LOG_DETAIL("Removing corpse of "I64FMT"...", GetGUID());
LOG_DETAIL("Removing corpse of " I64FMT "...", GetGUID());

setDeathState(DEAD);
m_position = m_spawnLocation;
Expand Down Expand Up @@ -361,7 +361,7 @@ void Creature::OnRespawn(MapMgr* m)
}
}

LOG_DETAIL("Respawning "I64FMT"...", GetGUID());
LOG_DETAIL("Respawning " I64FMT "...", GetGUID());
SetHealth(GetMaxHealth());
SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); // not tagging shit
if(m_spawn)
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/DatabaseCleaner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void DatabaseCleaner::CleanCharacters()

for(vector<uint64>::iterator itr = tokill_items.begin(); itr != tokill_items.end(); ++itr)
{
CharacterDatabase.WaitExecute("DELETE FROM playeritems WHERE guid = "I64FMTD, *itr);
CharacterDatabase.WaitExecute("DELETE FROM playeritems WHERE guid = " I64FMTD, *itr);
}

Log.Notice("DatabaseCleaner", "Deleted %u item instances.", tokill_items.size());
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/HonorHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ bool ChatHandler::HandlePVPCreditCommand(const char* args, WorldSession* m_sessi
return true;
}

BlueSystemMessage(m_session, "Building packet with Rank %u, Points %u, GUID "I64FMT".",
BlueSystemMessage(m_session, "Building packet with Rank %u, Points %u, GUID " I64FMT ".",
Rank, Points, Guid);

WorldPacket data(SMSG_PVP_CREDIT, 12);
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/Level1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool ChatHandler::HandleGMAnnounceCommand(const char* args, WorldSession* m_sess
}

char GMAnnounce[1024];
snprintf(GMAnnounce, 1024, MSG_COLOR_RED"[Team]"MSG_COLOR_GREEN" |Hplayer:%s|h[%s]|h:"MSG_COLOR_YELLOW" %s", m_session->GetPlayer()->GetName(), m_session->GetPlayer()->GetName(), args);
snprintf(GMAnnounce, 1024, MSG_COLOR_RED "[Team]" MSG_COLOR_GREEN " |Hplayer:%s|h[%s]|h:" MSG_COLOR_YELLOW " %s", m_session->GetPlayer()->GetName(), m_session->GetPlayer()->GetName(), args);
sWorld.SendGMWorldText(GMAnnounce);
sGMLog.writefromsession(m_session, "used team announce command, [%s]", args);
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/Level2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ bool ChatHandler::HandleKillByPlrCommand(const char* args , WorldSession* m_sess
plr->KillPlayer();
BlueSystemMessageToPlr(plr, "You were killed by %s with a GM command.", m_session->GetPlayer()->GetName());
GreenSystemMessage(m_session, "Killed player %s.", args);
sGMLog.writefromsession(m_session, "remote killed "I64FMT" (Name: %s)", plr->GetGUID(), plr->GetNameString());
sGMLog.writefromsession(m_session, "remote killed " I64FMT " (Name: %s)", plr->GetGUID(), plr->GetNameString());

}
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/arcemu-world/Level3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3444,7 +3444,7 @@ bool ChatHandler::HandleNpcPossessCommand(const char* args, WorldSession* m_sess
}

m_session->GetPlayer()->Possess(pTarget->GetGUID());
BlueSystemMessage(m_session, "Possessed "I64FMT, pTarget->GetGUID());
BlueSystemMessage(m_session, "Possessed " I64FMT, pTarget->GetGUID());
switch(pTarget->GetTypeId())
{
case TYPEID_PLAYER:
Expand Down Expand Up @@ -3587,7 +3587,7 @@ bool ChatHandler::HandleAIAgentDebugContinue(const char* args, WorldSession* m_s

SpellEntry* sp = *aiagent_spells.begin();
aiagent_spells.erase(aiagent_spells.begin());
BlueSystemMessage(m_session, "Casting %u, "MSG_COLOR_SUBWHITE"%u remaining.", sp->Id, aiagent_spells.size());
BlueSystemMessage(m_session, "Casting %u, " MSG_COLOR_SUBWHITE "%u remaining.", sp->Id, aiagent_spells.size());

map<uint32, spell_thingo>::iterator it = aiagent_extra.find(sp->Id);
ARCEMU_ASSERT(it != aiagent_extra.end());
Expand Down Expand Up @@ -4313,4 +4313,4 @@ bool ChatHandler::HandleNPCCastCommand(const char* args, WorldSession* m_session
c->CastSpell(reinterpret_cast< Unit* >(NULL), sp, false);

return true;
}
}
2 changes: 1 addition & 1 deletion src/arcemu-world/MapMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void MapMgr::PushObject(Object* obj)

if(plObj != NULL)
{
LOG_DETAIL("Creating player "I64FMT" for himself.", obj->GetGUID());
LOG_DETAIL("Creating player " I64FMT " for himself.", obj->GetGUID());
ByteBuffer pbuf(10000);
count = plObj->BuildCreateUpdateBlockForPlayer(&pbuf, plObj);
plObj->PushCreationData(&pbuf, count);
Expand Down
6 changes: 3 additions & 3 deletions src/arcemu-world/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ void Object::AddToWorld()
MapMgr* mapMgr = sInstanceMgr.GetInstance(this);
if(mapMgr == NULL)
{
LOG_ERROR("AddToWorld() failed for Object with GUID "I64FMT" MapId %u InstanceId %u", GetGUID(), GetMapId(), GetInstanceID());
LOG_ERROR("AddToWorld() failed for Object with GUID " I64FMT " MapId %u InstanceId %u", GetGUID(), GetMapId(), GetInstanceID());
return;
}

Expand Down Expand Up @@ -964,7 +964,7 @@ void Object::PushToWorld(MapMgr* mgr)

if(mgr == NULL)
{
LOG_ERROR("Invalid push to world of Object "I64FMT, GetGUID());
LOG_ERROR("Invalid push to world of Object " I64FMT, GetGUID());
return; //instance add failed
}

Expand Down Expand Up @@ -2499,4 +2499,4 @@ bool Object::GetPoint(float angle, float rad, float & outx, float & outy, float
}

return true;
}
}
2 changes: 1 addition & 1 deletion src/arcemu-world/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ void ObjectMgr::CreateGossipMenuForPlayer(GossipMenu** Location, uint64 Guid, ui
if(TextID == 0)
{
//TextID = 0 will not show the gossip to the player. Using "2" since it's the default value in GossipScript::GossipHello()
LOG_ERROR("Object with GUID "I64FMT" is trying to create a GossipMenu with TextID == 0", Guid);
LOG_ERROR("Object with GUID " I64FMT " is trying to create a GossipMenu with TextID == 0", Guid);
TextID = 2;
}

Expand Down
6 changes: 3 additions & 3 deletions src/arcemu-world/PetHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data)
PlayerPet* pet = _player->GetPlayerPet(petnumber);
if(!pet)
{
LOG_ERROR("PET SYSTEM: Player "I64FMT" tried to unstable non-existent pet %d", _player->GetGUID(), petnumber);
LOG_ERROR("PET SYSTEM: Player " I64FMT " tried to unstable non-existent pet %d", _player->GetGUID(), petnumber);
return;
}
//unstable selected pet but spawn it only if it's alive
Expand All @@ -318,7 +318,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data)
PlayerPet* pet = _player->GetPlayerPet(petnumber);
if(!pet)
{
LOG_ERROR("PET SYSTEM: Player "I64FMT" tried to unstable non-existent pet %d", _player->GetGUID(), petnumber);
LOG_ERROR("PET SYSTEM: Player " I64FMT " tried to unstable non-existent pet %d", _player->GetGUID(), petnumber);
return;
}
Pet* pPet = _player->GetSummon();
Expand Down Expand Up @@ -544,7 +544,7 @@ void WorldSession::HandlePetCancelAura(WorldPacket & recvPacket)
if((*itr)->GetGUID() == guid) //guid should be the pet guid
{
if(!(*itr)->RemoveAura(spellid))
LOG_ERROR("PET SYSTEM: Player "I64FMT" failed to cancel aura %u from pet", _player->GetGUID(), spellid);
LOG_ERROR("PET SYSTEM: Player " I64FMT " failed to cancel aura %u from pet", _player->GetGUID(), spellid);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/arcemu-world/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ void Player::_EventCharmAttack()
//Can't find victim, stop attacking
if(!pVictim)
{
LOG_ERROR("WORLD: "I64FMT" doesn't exist.", m_curSelection);
LOG_ERROR("WORLD: " I64FMT " doesn't exist.", m_curSelection);
LOG_DETAIL("Player::Update: No valid current selection to attack, stopping attack");
this->setHRegenTimer(5000); //prevent clicking off creature for a quick heal
clearStateFlag(UF_ATTACKING);
Expand Down Expand Up @@ -1954,7 +1954,7 @@ void Player::SpawnPet(uint32 pet_number)
std::map< uint32, PlayerPet* >::iterator itr = m_Pets.find(pet_number);
if(itr == m_Pets.end())
{
LOG_ERROR("PET SYSTEM: "I64FMT" Tried to load invalid pet %d", GetGUID(), pet_number);
LOG_ERROR("PET SYSTEM: " I64FMT " Tried to load invalid pet %d", GetGUID(), pet_number);
return;
}
Pet* pPet = objmgr.CreatePet(itr->second->entry);
Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/QuestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data)

if(!qst_giver)
{
LOG_DEBUG("WORLD: Invalid questgiver GUID "I64FMT".", guid);
LOG_DEBUG("WORLD: Invalid questgiver GUID " I64FMT ".", guid);
return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/arcemu-world/QuestMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ uint32 QuestMgr::CalcStatus(Object* quest_giver, Player* plr)
if(!bValid)
{
//annoying message that is not needed since all objects don't exactly have quests
//LOG_DEBUG("QUESTS: Warning, invalid NPC "I64FMT" specified for CalcStatus. TypeId: %d.", quest_giver->GetGUID(), quest_giver->GetTypeId());
//LOG_DEBUG("QUESTS: Warning, invalid NPC " I64FMT " specified for CalcStatus. TypeId: %d.", quest_giver->GetGUID(), quest_giver->GetTypeId());
return status;
}

Expand Down Expand Up @@ -280,7 +280,7 @@ uint32 QuestMgr::ActiveQuestsCount(Object* quest_giver, Player* plr)

if(!bValid)
{
LOG_DEBUG("QUESTS: Warning, invalid NPC "I64FMT" specified for ActiveQuestsCount. TypeId: %d.", quest_giver->GetGUID(), quest_giver->GetTypeId());
LOG_DEBUG("QUESTS: Warning, invalid NPC " I64FMT " specified for ActiveQuestsCount. TypeId: %d.", quest_giver->GetGUID(), quest_giver->GetTypeId());
return 0;
}

Expand Down Expand Up @@ -1784,7 +1784,7 @@ bool QuestMgr::OnActivateQuestGiver(Object* qst_giver, Player* plr)

if(!bValid)
{
LOG_DEBUG("QUESTS: Warning, invalid NPC "I64FMT" specified for OnActivateQuestGiver. TypeId: %d.", qst_giver->GetGUID(), qst_giver->GetTypeId());
LOG_DEBUG("QUESTS: Warning, invalid NPC " I64FMT " specified for OnActivateQuestGiver. TypeId: %d.", qst_giver->GetGUID(), qst_giver->GetTypeId());
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ uint8 Spell::prepare(SpellCastTargets* targets)
{
if(!m_caster->IsInWorld())
{
LOG_DEBUG("Object "I64FMT" is casting Spell ID %u while not in World", m_caster->GetGUID(), GetProto()->Id);
LOG_DEBUG("Object " I64FMT " is casting Spell ID %u while not in World", m_caster->GetGUID(), GetProto()->Id);
DecRef();
return SPELL_FAILED_DONT_REPORT;
}
Expand Down
16 changes: 8 additions & 8 deletions src/arcemu-world/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6189,7 +6189,7 @@ void Unit::SendFullAuraUpdate()
}
SendMessageToSet(&data, true);

LOG_DEBUG("Full Aura Update: GUID: "I64FMT" - Updates: %u", GetGUID(), Updates);
LOG_DEBUG("Full Aura Update: GUID: " I64FMT " - Updates: %u", GetGUID(), Updates);
}

void Unit::SendAuraUpdate(uint32 AuraSlot, bool remove)
Expand Down Expand Up @@ -6635,7 +6635,7 @@ void CombatStatusHandler::AddAttackTarget(const uint64 & guid)
ARCEMU_ASSERT(m_Unit->IsInWorld());

m_attackTargets.insert(guid);
//printf("Adding attack target "I64FMT" to "I64FMT"\n", guid, m_Unit->GetGUID());
//printf("Adding attack target " I64FMT " to " I64FMT "\n", guid, m_Unit->GetGUID());
if(m_Unit->IsPlayer() &&
m_primaryAttackTarget != guid) // players can only have one attack target.
{
Expand All @@ -6650,7 +6650,7 @@ void CombatStatusHandler::AddAttackTarget(const uint64 & guid)

void CombatStatusHandler::ClearPrimaryAttackTarget()
{
//printf("ClearPrimaryAttackTarget for "I64FMT"\n", m_Unit->GetGUID());
//printf("ClearPrimaryAttackTarget for " I64FMT "\n", m_Unit->GetGUID());
if(m_primaryAttackTarget != 0)
{
Unit* pt = m_Unit->GetMapMgr()->GetUnit(m_primaryAttackTarget);
Expand Down Expand Up @@ -6696,15 +6696,15 @@ void CombatStatusHandler::RemoveAttackTarget(Unit* pTarget)

if(!IsAttacking(pTarget))
{
//printf("Removing attack target "I64FMT" on "I64FMT"\n", pTarget->GetGUID(), m_Unit->GetGUID());
//printf("Removing attack target " I64FMT " on " I64FMT "\n", pTarget->GetGUID(), m_Unit->GetGUID());
m_attackTargets.erase(itr);
if(m_primaryAttackTarget == pTarget->GetGUID())
m_primaryAttackTarget = 0;

UpdateFlag();
}
/*else
printf("Cannot remove attack target "I64FMT" from "I64FMT"\n", pTarget->GetGUID(), m_Unit->GetGUID());*/
printf("Cannot remove attack target " I64FMT " from " I64FMT "\n", pTarget->GetGUID(), m_Unit->GetGUID());*/
}

void CombatStatusHandler::RemoveAttacker(Unit* pAttacker, const uint64 & guid)
Expand All @@ -6715,20 +6715,20 @@ void CombatStatusHandler::RemoveAttacker(Unit* pAttacker, const uint64 & guid)

if((!pAttacker) || (!pAttacker->CombatStatus.IsAttacking(m_Unit)))
{
//printf("Removing attacker "I64FMT" from "I64FMT"\n", guid, m_Unit->GetGUID());
//printf("Removing attacker " I64FMT " from " I64FMT "\n", guid, m_Unit->GetGUID());
m_attackers.erase(itr);
UpdateFlag();
}
/*else
{
printf("Cannot remove attacker "I64FMT" from "I64FMT"\n", guid, m_Unit->GetGUID());
printf("Cannot remove attacker " I64FMT " from " I64FMT "\n", guid, m_Unit->GetGUID());
}*/
}

void CombatStatusHandler::OnDamageDealt(Unit* pTarget)
{
// we added an aura, or dealt some damage to a target. they need to have us as an attacker, and they need to be our attack target if not.
//printf("OnDamageDealt to "I64FMT" from "I64FMT"\n", pTarget->GetGUID(), m_Unit->GetGUID());
//printf("OnDamageDealt to " I64FMT " from " I64FMT "\n", pTarget->GetGUID(), m_Unit->GetGUID());
if(pTarget == m_Unit)
return;

Expand Down
2 changes: 1 addition & 1 deletion src/arcemu-world/WayPoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,6 @@ bool ChatHandler::HandleNpcSelectCommand(const char* args, WorldSession* m_sessi
}

plr->SetSelection(un->GetGUID());
SystemMessage(m_session, "Set selection to "I64FMT" (%s)", un->GetGUID(), un->GetCreatureInfo()->Name);
SystemMessage(m_session, "Set selection to " I64FMT " (%s)", un->GetGUID(), un->GetCreatureInfo()->Name);
return true;
}
1 change: 1 addition & 0 deletions src/tools/ad/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <fcntl.h>

#if defined( __GNUC__ )
#include <unistd.h>
#define _open open
#define _close close
#ifndef O_BINARY
Expand Down

0 comments on commit a5b2a8e

Please sign in to comment.