Skip to content

Commit

Permalink
Fixed some compiler warnings uncovered following ACE removal
Browse files Browse the repository at this point in the history
  • Loading branch information
namreeb committed Mar 16, 2016
1 parent a6b0038 commit 6dd825e
Show file tree
Hide file tree
Showing 57 changed files with 142 additions and 144 deletions.
4 changes: 2 additions & 2 deletions src/framework/Utilities/LinkedList.h
Expand Up @@ -24,7 +24,7 @@
//============================================
class LinkedListHead;

class LinkedListElement
class MANGOS_DLL_SPEC LinkedListElement
{
private:

Expand Down Expand Up @@ -82,7 +82,7 @@ class LinkedListElement

//============================================

class LinkedListHead
class MANGOS_DLL_SPEC LinkedListHead
{
private:

Expand Down
2 changes: 1 addition & 1 deletion src/framework/Utilities/LinkedReference/Reference.h
Expand Up @@ -24,7 +24,7 @@
//=====================================================

template<class TO, class FROM>
class Reference : public LinkedListElement
class MANGOS_DLL_SPEC Reference : public LinkedListElement
{
private:

Expand Down
2 changes: 1 addition & 1 deletion src/game/AuctionHouseHandler.cpp
Expand Up @@ -688,7 +688,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket& recv_data)
wstrToLower(wsearchedname);

BuildListAuctionItems(auctions, data, wsearchedname, listfrom, levelmin, levelmax, usable,
auctionSlotID, auctionMainCategory, auctionSubCategory, quality, count, totalcount, isFull);
auctionSlotID, auctionMainCategory, auctionSubCategory, quality, count, totalcount, !!isFull);

data.put<uint32>(0, count);
data << uint32(totalcount);
Expand Down
2 changes: 1 addition & 1 deletion src/game/AuctionHouseMgr.h
Expand Up @@ -120,7 +120,7 @@ class AuctionHouseObject

bool RemoveAuction(uint32 id)
{
return AuctionsMap.erase(id);
return AuctionsMap.erase(id) > 0;
}

void Update();
Expand Down
8 changes: 4 additions & 4 deletions src/game/BattleGround/BattleGroundHandler.cpp
Expand Up @@ -707,7 +707,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
if (grp->GetLeaderGuid() != _player->GetObjectGuid())
return;
// may be Group::CanJoinBattleGroundQueue should be moved to player class...
err = grp->CanJoinBattleGroundQueue(bg, bgQueueTypeId, arenatype, arenatype, (bool)isRated, arenaslot);
err = grp->CanJoinBattleGroundQueue(bg, bgQueueTypeId, arenatype, arenatype, !!isRated, arenaslot);
}

uint32 ateamId = 0;
Expand Down Expand Up @@ -757,9 +757,9 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
DEBUG_LOG("Battleground: arena team id %u, leader %s queued with rating %u for type %u", _player->GetArenaTeamId(arenaslot), _player->GetName(), arenaRating, arenatype);

// set arena rated type to show correct minimap arena icon
bg->SetRated(isRated);
bg->SetRated(!!isRated);

GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, !!isRated, false, arenaRating, ateamId);
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
}

Expand Down Expand Up @@ -792,7 +792,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data)
}
else
{
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, nullptr, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId);
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, nullptr, bgTypeId, bracketEntry, arenatype, !!isRated, false, arenaRating, ateamId);
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
uint32 queueSlot = _player->AddBattleGroundQueueId(bgQueueTypeId);

Expand Down
4 changes: 2 additions & 2 deletions src/game/Calendar.h
Expand Up @@ -152,8 +152,8 @@ class CalendarEvent
~CalendarEvent();

// helper to test event flag
bool IsGuildEvent() const { return Flags & CALENDAR_FLAG_GUILD_EVENT; }
bool IsGuildAnnouncement() const { return Flags & CALENDAR_FLAG_GUILD_ANNOUNCEMENT; }
bool IsGuildEvent() const { return !!(Flags & CALENDAR_FLAG_GUILD_EVENT); }
bool IsGuildAnnouncement() const { return !!(Flags & CALENDAR_FLAG_GUILD_ANNOUNCEMENT); }

bool AddInvite(CalendarInvite* invite);

Expand Down
14 changes: 7 additions & 7 deletions src/game/Channel.h
Expand Up @@ -124,21 +124,21 @@ class Channel
ObjectGuid player;
uint8 flags;

bool HasFlag(uint8 flag) { return flags & flag; }
bool HasFlag(uint8 flag) const { return !!(flags & flag); }
void SetFlag(uint8 flag) { if (!HasFlag(flag)) flags |= flag; }
bool IsOwner() { return flags & MEMBER_FLAG_OWNER; }
bool IsOwner() const { return !!(flags & MEMBER_FLAG_OWNER); }
void SetOwner(bool state)
{
if (state) flags |= MEMBER_FLAG_OWNER;
else flags &= ~MEMBER_FLAG_OWNER;
}
bool IsModerator() { return flags & MEMBER_FLAG_MODERATOR; }
bool IsModerator() const { return !!(flags & MEMBER_FLAG_MODERATOR); }
void SetModerator(bool state)
{
if (state) flags |= MEMBER_FLAG_MODERATOR;
else flags &= ~MEMBER_FLAG_MODERATOR;
}
bool IsMuted() { return flags & MEMBER_FLAG_MUTED; }
bool IsMuted() const { return !!(flags & MEMBER_FLAG_MUTED); }
void SetMuted(bool state)
{
if (state) flags |= MEMBER_FLAG_MUTED;
Expand All @@ -150,15 +150,15 @@ class Channel
Channel(const std::string& name, uint32 channel_id);
std::string GetName() const { return m_name; }
uint32 GetChannelId() const { return m_channelId; }
bool IsConstant() const { return m_channelId != 0; }
bool IsConstant() const { return !!m_channelId; }
bool IsAnnounce() const { return m_announce; }
bool IsLFG() const { return GetFlags() & CHANNEL_FLAG_LFG; }
bool IsLFG() const { return !!(GetFlags() & CHANNEL_FLAG_LFG); }
std::string GetPassword() const { return m_password; }
void SetPassword(const std::string& npassword) { m_password = npassword; }
void SetAnnounce(bool nannounce) { m_announce = nannounce; }
uint32 GetNumPlayers() const { return m_players.size(); }
uint8 GetFlags() const { return m_flags; }
bool HasFlag(uint8 flag) { return m_flags & flag; }
bool HasFlag(uint8 flag) const { return !!(m_flags & flag); }

void Join(Player* player, const char* password);
void Leave(Player* player, bool send = true);
Expand Down
6 changes: 3 additions & 3 deletions src/game/CharacterDatabaseCleaner.cpp
Expand Up @@ -94,7 +94,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table

bool CharacterDatabaseCleaner::AchievementProgressCheck(uint32 criteria)
{
return sAchievementCriteriaStore.LookupEntry(criteria);
return !!sAchievementCriteriaStore.LookupEntry(criteria);
}

void CharacterDatabaseCleaner::CleanCharacterAchievementProgress()
Expand All @@ -104,7 +104,7 @@ void CharacterDatabaseCleaner::CleanCharacterAchievementProgress()

bool CharacterDatabaseCleaner::SkillCheck(uint32 skill)
{
return sSkillLineStore.LookupEntry(skill);
return !!sSkillLineStore.LookupEntry(skill);
}

void CharacterDatabaseCleaner::CleanCharacterSkills()
Expand All @@ -128,7 +128,7 @@ bool CharacterDatabaseCleaner::TalentCheck(uint32 talent_id)
if (!talentInfo)
return false;

return sTalentTabStore.LookupEntry(talentInfo->TalentTab);
return !!sTalentTabStore.LookupEntry(talentInfo->TalentTab);
}

void CharacterDatabaseCleaner::CleanCharacterTalent()
Expand Down
8 changes: 4 additions & 4 deletions src/game/CharacterHandler.cpp
Expand Up @@ -221,8 +221,8 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data)
Team team = Player::TeamForRace(race_);
switch (team)
{
case ALLIANCE: disabled = mask & (1 << 0); break;
case HORDE: disabled = mask & (1 << 1); break;
case ALLIANCE: disabled = !!(mask & (1 << 0)); break;
case HORDE: disabled = !!(mask & (1 << 1)); break;
default: break;
}

Expand Down Expand Up @@ -841,7 +841,7 @@ void WorldSession::HandleSetFactionAtWarOpcode(WorldPacket& recv_data)
recv_data >> repListID;
recv_data >> flag;

GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag);
GetPlayer()->GetReputationMgr().SetAtWar(repListID, !!flag);
}

void WorldSession::HandleTutorialFlagOpcode(WorldPacket& recv_data)
Expand Down Expand Up @@ -891,7 +891,7 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket& recv_data)
uint8 inactive;
recv_data >> replistid >> inactive;

_player->GetReputationMgr().SetInactive(replistid, inactive);
_player->GetReputationMgr().SetInactive(replistid, !!inactive);
}

void WorldSession::HandleShowingHelmOpcode(WorldPacket& /*recv_data*/)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Chat.cpp
Expand Up @@ -3514,7 +3514,7 @@ void ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg msgtype, char const
ObjectGuid const& targetGuid /*= ObjectGuid()*/, char const* targetName /*= nullptr*/,
char const* channelName /*= nullptr*/, uint32 achievementId /*= 0*/)
{
bool isGM = chatTag & CHAT_TAG_GM;
const bool isGM = !!(chatTag & CHAT_TAG_GM);
bool isAchievement = false;

data.Initialize(isGM ? SMSG_GM_MESSAGECHAT : SMSG_MESSAGECHAT);
Expand Down
2 changes: 1 addition & 1 deletion src/game/Creature.cpp
Expand Up @@ -344,7 +344,7 @@ bool Creature::InitEntry(uint32 Entry, CreatureData const* data /*=nullptr*/, Ga
UpdateSpeed(MOVE_WALK, false);
UpdateSpeed(MOVE_RUN, false);

SetLevitate(cinfo->InhabitType & INHABIT_AIR); // TODO: may not be correct to send opcode at this point (already handled by UPDATE_OBJECT createObject)
SetLevitate(!!(cinfo->InhabitType & INHABIT_AIR)); // TODO: may not be correct to send opcode at this point (already handled by UPDATE_OBJECT createObject)

// check if we need to add swimming movement. TODO: i thing movement flags should be computed automatically at each movement of creature so we need a sort of UpdateMovementFlags() method
if (cinfo->InhabitType & INHABIT_WATER && // check inhabit type water
Expand Down
16 changes: 8 additions & 8 deletions src/game/Creature.h
Expand Up @@ -171,7 +171,7 @@ struct CreatureInfo

bool IsExotic() const
{
return (CreatureTypeFlags & CREATURE_TYPEFLAGS_EXOTIC);
return !!(CreatureTypeFlags & CREATURE_TYPEFLAGS_EXOTIC);
}

bool isTameable(bool exotic) const
Expand Down Expand Up @@ -523,11 +523,11 @@ class MANGOS_DLL_SPEC Creature : public Unit
bool IsDespawned() const { return getDeathState() == DEAD; }
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
bool IsRacialLeader() const { return GetCreatureInfo()->RacialLeader; }
bool IsCivilian() const { return GetCreatureInfo()->ExtraFlags & CREATURE_FLAG_EXTRA_CIVILIAN; }
bool IsGuard() const { return GetCreatureInfo()->ExtraFlags & CREATURE_FLAG_EXTRA_GUARD; }
bool IsCivilian() const { return !!(GetCreatureInfo()->ExtraFlags & CREATURE_FLAG_EXTRA_CIVILIAN); }
bool IsGuard() const { return !!(GetCreatureInfo()->ExtraFlags & CREATURE_FLAG_EXTRA_GUARD); }

bool CanWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; }
bool CanSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; }
bool CanWalk() const { return !!(GetCreatureInfo()->InhabitType & INHABIT_GROUND); }
bool CanSwim() const { return !!(GetCreatureInfo()->InhabitType & INHABIT_WATER); }
bool IsSwimming() const { return (m_movementInfo.HasMovementFlag((MovementFlags)(MOVEFLAG_SWIMMING))); }
bool CanFly() const { return (GetCreatureInfo()->InhabitType & INHABIT_AIR) || (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE1_FLAG_FLY_ANIM) || m_movementInfo.HasMovementFlag((MovementFlags)(MOVEFLAG_LEVITATING | MOVEFLAG_CAN_FLY)); }
bool IsFlying() const { return (m_movementInfo.HasMovementFlag((MovementFlags)(MOVEFLAG_FLYING | MOVEFLAG_LEVITATING))); }
Expand Down Expand Up @@ -648,7 +648,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
Player* GetLootRecipient() const; // use group cases as prefered
Group* GetGroupLootRecipient() const;
bool HasLootRecipient() const { return m_lootGroupRecipientId || m_lootRecipientGuid; }
bool IsGroupLootRecipient() const { return m_lootGroupRecipientId; }
bool IsGroupLootRecipient() const { return!! m_lootGroupRecipientId; }
void SetLootRecipient(Unit* unit);
Player* GetOriginalLootRecipient() const; // ignore group changes/etc, not for looting

Expand Down Expand Up @@ -713,8 +713,8 @@ class MANGOS_DLL_SPEC Creature : public Unit
bool HasInvolvedQuest(uint32 quest_id) const override;

GridReference<Creature>& GetGridRef() { return m_gridRef; }
bool IsRegeneratingHealth() { return GetCreatureInfo()->RegenerateStats & REGEN_FLAG_HEALTH; }
bool IsRegeneratingPower() { return GetCreatureInfo()->RegenerateStats & REGEN_FLAG_POWER; }
bool IsRegeneratingHealth() const { return !!(GetCreatureInfo()->RegenerateStats & REGEN_FLAG_HEALTH); }
bool IsRegeneratingPower() const { return !!(GetCreatureInfo()->RegenerateStats & REGEN_FLAG_POWER); }
virtual uint8 GetPetAutoSpellSize() const { return CREATURE_MAX_SPELLS; }
virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/CreatureAI.cpp
Expand Up @@ -103,7 +103,7 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32
// Check if cannot cast spell
if (!(uiCastFlags & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)))
{
CanCastResult castResult = CanCastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED);
CanCastResult castResult = CanCastSpell(pTarget, pSpell, !!(uiCastFlags & CAST_TRIGGERED));

if (castResult != CAST_OK)
return castResult;
Expand All @@ -116,7 +116,7 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32
// Creature should always stop before it will cast a new spell
pCaster->StopMoving();

pCaster->CastSpell(pTarget, pSpell, uiCastFlags & CAST_TRIGGERED, nullptr, nullptr, uiOriginalCasterGUID);
pCaster->CastSpell(pTarget, pSpell, !!(uiCastFlags & CAST_TRIGGERED), nullptr, nullptr, uiOriginalCasterGUID);
return CAST_OK;
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/game/CreatureEventAI.cpp
Expand Up @@ -1048,10 +1048,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
}
case ACTION_T_DYNAMIC_MOVEMENT:
{
if (action.dynamicMovement.state == m_DynamicMovement)
if ((!!action.dynamicMovement.state) == m_DynamicMovement)
break;

m_DynamicMovement = action.dynamicMovement.state;
m_DynamicMovement = !!action.dynamicMovement.state;
SetCombatMovement(!m_DynamicMovement, true);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/CreatureEventAI.h
Expand Up @@ -673,7 +673,7 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI

// Variables used by Events themselves
typedef std::vector<CreatureEventAIHolder> CreatureEventAIList;
CreatureEventAIList m_CreatureEventAIList; // Holder for events (stores enabled, time, and eventid)
CreatureEventAIList m_CreatureEventAIList; // Holder for events (stores enabled, time, and eventid)

uint8 m_Phase; // Current phase, max 32 phases
bool m_MeleeEnabled; // If we allow melee auto attack
Expand Down
2 changes: 1 addition & 1 deletion src/game/CreatureLinkingMgr.cpp
Expand Up @@ -283,7 +283,7 @@ bool CreatureLinkingMgr::IsLinkedEventTrigger(Creature* pCreature) const

// Also return true for npcs that trigger reverse actions, or for followers(needed in respawn)
if (CreatureLinkingInfo const* pInfo = GetLinkedTriggerInformation(pCreature))
return pInfo->linkingFlag & EVENT_MASK_TRIGGER_TO;
return !!(pInfo->linkingFlag & EVENT_MASK_TRIGGER_TO);

return false;
}
Expand Down
16 changes: 8 additions & 8 deletions src/game/DBCStructure.h
Expand Up @@ -1777,14 +1777,14 @@ struct SpellEntry
return SpellFamily(SpellFamilyName) == family && IsFitToFamilyMask(mask);
}

inline bool HasAttribute(SpellAttributes attribute) const { return Attributes & attribute; }
inline bool HasAttribute(SpellAttributesEx attribute) const { return AttributesEx & attribute; }
inline bool HasAttribute(SpellAttributesEx2 attribute) const { return AttributesEx2 & attribute; }
inline bool HasAttribute(SpellAttributesEx3 attribute) const { return AttributesEx3 & attribute; }
inline bool HasAttribute(SpellAttributesEx4 attribute) const { return AttributesEx4 & attribute; }
inline bool HasAttribute(SpellAttributesEx5 attribute) const { return AttributesEx5 & attribute; }
inline bool HasAttribute(SpellAttributesEx6 attribute) const { return AttributesEx6 & attribute; }
inline bool HasAttribute(SpellAttributesEx7 attribute) const { return AttributesEx7 & attribute; }
inline bool HasAttribute(SpellAttributes attribute) const { return !!(Attributes & attribute); }
inline bool HasAttribute(SpellAttributesEx attribute) const { return !!(AttributesEx & attribute); }
inline bool HasAttribute(SpellAttributesEx2 attribute) const { return !!(AttributesEx2 & attribute); }
inline bool HasAttribute(SpellAttributesEx3 attribute) const { return !!(AttributesEx3 & attribute); }
inline bool HasAttribute(SpellAttributesEx4 attribute) const { return !!(AttributesEx4 & attribute); }
inline bool HasAttribute(SpellAttributesEx5 attribute) const { return !!(AttributesEx5 & attribute); }
inline bool HasAttribute(SpellAttributesEx6 attribute) const { return !!(AttributesEx6 & attribute); }
inline bool HasAttribute(SpellAttributesEx7 attribute) const { return !!(AttributesEx7 & attribute); }

private:
// prevent creating custom entries (copy data from original in fact)
Expand Down
18 changes: 9 additions & 9 deletions src/game/GameObject.h
Expand Up @@ -405,8 +405,8 @@ struct GameObjectInfo
{
switch (type)
{
case GAMEOBJECT_TYPE_CHEST: return chest.consumable;
case GAMEOBJECT_TYPE_GOOBER: return goober.consumable;
case GAMEOBJECT_TYPE_CHEST: return !!chest.consumable;
case GAMEOBJECT_TYPE_GOOBER: return !!goober.consumable;
default: return false;
}
}
Expand Down Expand Up @@ -434,12 +434,12 @@ struct GameObjectInfo
{
switch (type)
{
case GAMEOBJECT_TYPE_DOOR: return door.noDamageImmune;
case GAMEOBJECT_TYPE_BUTTON: return button.noDamageImmune;
case GAMEOBJECT_TYPE_QUESTGIVER: return questgiver.noDamageImmune;
case GAMEOBJECT_TYPE_GOOBER: return goober.noDamageImmune;
case GAMEOBJECT_TYPE_FLAGSTAND: return flagstand.noDamageImmune;
case GAMEOBJECT_TYPE_FLAGDROP: return flagdrop.noDamageImmune;
case GAMEOBJECT_TYPE_DOOR: return !!door.noDamageImmune;
case GAMEOBJECT_TYPE_BUTTON: return !!button.noDamageImmune;
case GAMEOBJECT_TYPE_QUESTGIVER: return !!questgiver.noDamageImmune;
case GAMEOBJECT_TYPE_GOOBER: return !!goober.noDamageImmune;
case GAMEOBJECT_TYPE_FLAGSTAND: return !!flagstand.noDamageImmune;
case GAMEOBJECT_TYPE_FLAGDROP: return !!flagdrop.noDamageImmune;
default: return true;
}
}
Expand Down Expand Up @@ -734,7 +734,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
Player* GetLootRecipient() const; // use group cases as prefered
Group* GetGroupLootRecipient() const;
bool HasLootRecipient() const { return m_lootGroupRecipientId || !m_lootRecipientGuid.IsEmpty(); }
bool IsGroupLootRecipient() const { return m_lootGroupRecipientId; }
bool IsGroupLootRecipient() const { return !!m_lootGroupRecipientId; }
void SetLootRecipient(Unit* pUnit);
Player* GetOriginalLootRecipient() const; // ignore group changes/etc, not for looting

Expand Down

0 comments on commit 6dd825e

Please sign in to comment.