Fix a lot of warnings

This commit is contained in:
Spp
2012-02-16 13:56:28 +01:00
parent e47ec04b4d
commit 03c34ee507
38 changed files with 88 additions and 98 deletions
+2 -3
View File
@@ -40,7 +40,6 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
return false;
}
bool condMeets = false;
bool sendErrorMsg = false;
switch (ConditionType)
{
case CONDITION_NONE:
@@ -724,7 +723,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
{
for (GossipMenusContainer::iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr)
{
if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == cond->SourceEntry)
if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == uint32(cond->SourceEntry))
{
(*itr).second.conditions.push_back(cond);
return true;
@@ -743,7 +742,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
{
for (GossipMenuItemsContainer::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
{
if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == cond->SourceEntry)
if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == uint32(cond->SourceEntry))
{
(*itr).second.Conditions.push_back(cond);
return true;
+4 -3
View File
@@ -255,10 +255,11 @@ template <class T> bool CompareValues(ComparisionType type, T val1, T val2)
return val1 >= val2;
case COMP_TYPE_LOW_EQ:
return val1 <= val2;
default:
// incorrect parameter
ASSERT(false);
return false;
}
// incorrect parameter
ASSERT(false);
return false;
}
#define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance()
@@ -145,7 +145,7 @@ m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false),
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL), m_path_id(0)
m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
@@ -33,7 +33,7 @@
#include "GameObjectModel.h"
#include "DynamicTree.h"
GameObject::GameObject() : WorldObject(false), m_goValue(new GameObjectValue), m_AI(NULL), m_model(NULL)
GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new GameObjectValue), m_AI(NULL)
{
m_objectType |= TYPEMASK_GAMEOBJECT;
m_objectTypeId = TYPEID_GAMEOBJECT;
+4 -5
View File
@@ -434,9 +434,9 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/)
// 5. Credit instance encounter.
KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) :
// 1. Initialize internal variables to default values.
_killer(killer), _victim(victim), _isBattleGround(isBattleGround),
_isPvP(false), _group(killer->GetGroup()), _groupRate(1.0f),
_maxLevel(0), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _isFullXP(false), _xp(0)
_killer(killer), _victim(victim), _group(killer->GetGroup()),
_groupRate(1.0f), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _xp(0),
_isFullXP(false), _maxLevel(0), _isBattleGround(isBattleGround), _isPvP(false)
{
// mark the credit as pvp if victim is player
if (victim->GetTypeId() == TYPEID_PLAYER)
@@ -11830,7 +11830,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
Map const* map = lootedObject->GetMap();
if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true))
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty())
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
lootedObjectInDungeon = true;
if (!lootedObjectInDungeon)
@@ -12024,7 +12024,6 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
return NULL;
Item* lastItem = pItem;
uint32 entry = pItem->GetEntry();
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();)
{
uint16 pos = itr->pos;
+8 -8
View File
@@ -146,9 +146,10 @@ _hitMask(hitMask), _spell(spell), _damageInfo(damageInfo), _healInfo(healInfo)
#endif
Unit::Unit(bool isWorldObject): WorldObject(isWorldObject),
m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false),
m_ControlledByPlayer(false), i_AI(NULL), i_disabledAI(NULL), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this), m_vehicle(NULL),
m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this), movespline(new Movement::MoveSpline())
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL),
i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this),
m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -7010,8 +7011,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
|| attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
|| attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
|| (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
|| (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
return false;
// Now compute real proc chance...
@@ -7307,8 +7308,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
Player* player = ToPlayer();
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
|| attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
|| attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
|| (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
|| (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
return false;
float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f));
@@ -12685,7 +12686,6 @@ void Unit::setDeathState(DeathState s)
{
// death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that
// it can be used to check creation of death items (such as soul shards).
DeathState oldDeathState = m_deathState;
m_deathState = s;
if (s != ALIVE && s != JUST_ALIVED)
@@ -63,7 +63,7 @@ struct VehicleSeat
struct VehicleAccessory
{
VehicleAccessory(uint32 entry, int8 seatId, bool isMinion, uint8 summonType, uint32 summonTime) :
AccessoryEntry(entry), SeatId(seatId), IsMinion(isMinion), SummonedType(summonType), SummonTime(summonTime) {}
AccessoryEntry(entry), IsMinion(isMinion), SummonTime(summonTime), SeatId(seatId), SummonedType(summonType) {}
uint32 AccessoryEntry;
uint32 IsMinion;
uint32 SummonTime;
+1 -1
View File
@@ -554,7 +554,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
{
Player* Leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(sLFGMgr->GetDungeon(GetGUID()));
if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != dungeon->map) || !dungeon)
if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != uint32(dungeon->map)) || !dungeon)
{
Disband();
return false;
+1 -1
View File
@@ -316,7 +316,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->getSource())
if (WorldSession* session = player->GetSession())
session->SendNotification(buff);
session->SendNotification("%s", buff);
}
}
+3 -3
View File
@@ -1364,7 +1364,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i)
{
if (i->itemid == cond->SourceEntry)
if (i->itemid == uint32(cond->SourceEntry))
{
i->conditions.push_back(cond);
return true;
@@ -1380,7 +1380,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i)
{
if ((*i).itemid == cond->SourceEntry)
if ((*i).itemid == uint32(cond->SourceEntry))
{
(*i).conditions.push_back(cond);
return true;
@@ -1392,7 +1392,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i)
{
if ((*i).itemid == cond->SourceEntry)
if ((*i).itemid == uint32(cond->SourceEntry))
{
(*i).conditions.push_back(cond);
return true;
+1 -1
View File
@@ -2374,7 +2374,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin())))
if (dungeon->map == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true);
}
+1 -1
View File
@@ -91,7 +91,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void InitTop();
public:
explicit MotionMaster(Unit* unit) : _top(-1), _owner(unit), _expList(NULL), _cleanFlag(MMCF_NONE)
explicit MotionMaster(Unit* unit) : _expList(NULL), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
{
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
{
@@ -57,7 +57,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
}
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 /*time_diff*/)
{
arrived = owner.movespline->Finalized();
return !arrived;
@@ -41,7 +41,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
}
template<class T>
bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/)
{
if (!&unit)
return false;
@@ -35,9 +35,8 @@
template<>
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature& creature)
{
float respX, respY, respZ, respO, currZ, destX, destY, destZ, travelDistZ;
float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;
creature.GetHomePosition(respX, respY, respZ, respO);
currZ = creature.GetPositionZ();
Map const* map = creature.GetBaseMap();
// For 2D/3D system selection
@@ -39,8 +39,9 @@ class TargetedMovementGeneratorMedium
{
protected:
TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) :
TargetedMovementGeneratorBase(target), i_offset(offset), i_angle(angle),
i_recalculateTravel(false), i_targetReached(false), i_recheckDistance(0)
TargetedMovementGeneratorBase(target), i_recheckDistance(0),
i_offset(offset), i_angle(angle),
i_recalculateTravel(false), i_targetReached(false)
{
}
~TargetedMovementGeneratorMedium() {}
@@ -78,7 +78,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
{
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for %u.", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/);
}
@@ -240,7 +240,7 @@ void FlightPathMovementGenerator::Reset(Player & player)
init.Launch();
}
bool FlightPathMovementGenerator::Update(Player &player, const uint32 diff)
bool FlightPathMovementGenerator::Update(Player &player, const uint32 /*diff*/)
{
uint32 pointId = (uint32)player.movespline->currentPathIdx();
if (pointId > i_currentNode)
@@ -42,7 +42,7 @@ template<class T, class P>
class PathMovementBase
{
public:
PathMovementBase() : i_currentNode(0), i_path(NULL) {}
PathMovementBase() : i_path(NULL), i_currentNode(0) {}
virtual ~PathMovementBase() {};
// template pattern, not defined .. override required
@@ -63,7 +63,8 @@ class WaypointMovementGenerator<Creature>
public PathMovementBase<Creature, WaypointPath const*>
{
public:
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : i_nextMoveTime(0), path_id(_path_id), m_isArrivalDone(false), repeating(_repeating) {}
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true)
: i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating) {}
~WaypointMovementGenerator() { i_path = NULL; }
void Initialize(Creature &);
void Finalize(Creature &);
@@ -187,7 +187,7 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args)
}
MoveSpline::MoveSpline() : m_Id(0), time_passed(0),
vertical_acceleration(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), initialOrientation(0.f)
vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0)
{
splineflags.done = true;
}
@@ -47,7 +47,6 @@ namespace Movement
Result_NextCycle = 0x04,
Result_NextSegment = 0x08,
};
#pragma region fields
friend class PacketBuilder;
protected:
MySpline spline;
@@ -88,7 +87,6 @@ namespace Movement
void _Finalize();
void _Interrupt() { splineflags.done = true;}
#pragma endregion
public:
void Initialize(const MoveSplineInitArgs&);
@@ -98,14 +98,14 @@ namespace Movement
void operator &= (uint32 f) { raw() &= f;}
void operator |= (uint32 f) { raw() |= f;}
void EnableAnimation(uint8 anim) { raw() = raw() & ~(Mask_Animations|Falling|Parabolic) | Animation|anim;}
void EnableParabolic() { raw() = raw() & ~(Mask_Animations|Falling|Animation) | Parabolic;}
void EnableFalling() { raw() = raw() & ~(Mask_Animations|Parabolic|Animation) | Falling;}
void EnableFlying() { raw() = raw() & ~Catmullrom | Flying; }
void EnableCatmullRom() { raw() = raw() & ~Flying | Catmullrom; }
void EnableFacingPoint() { raw() = raw() & ~Mask_Final_Facing | Final_Point;}
void EnableFacingAngle() { raw() = raw() & ~Mask_Final_Facing | Final_Angle;}
void EnableFacingTarget() { raw() = raw() & ~Mask_Final_Facing | Final_Target;}
void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations|Falling|Parabolic)) | Animation|anim;}
void EnableParabolic() { raw() = (raw() & ~(Mask_Animations|Falling|Animation)) | Parabolic;}
void EnableFalling() { raw() = (raw() & ~(Mask_Animations|Parabolic|Animation)) | Falling;}
void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; }
void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; }
void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;}
void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;}
void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;}
uint8 animId : 8;
bool done : 1;
@@ -56,7 +56,6 @@ SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] =
};
///////////
#pragma region evaluation methtods
using G3D::Matrix4;
static const Matrix4 s_catmullRomCoeffs(
@@ -199,7 +198,6 @@ float SplineBase::SegLengthBezier3(index_type index) const
}
return length;
}
#pragma endregion
void SplineBase::init_spline(const Vector3 * controls, index_type count, EvaluationMode m)
{
+1 -5
View File
@@ -39,7 +39,6 @@ public:
ModesEnd
};
#pragma region fields
protected:
ControlArray points;
@@ -84,10 +83,9 @@ protected:
void UninitializedSpline() const { ASSERT(false);}
#pragma endregion
public:
explicit SplineBase() : m_mode(UninitializedMode), index_lo(0), index_hi(0), cyclic(false) {}
explicit SplineBase() : index_lo(0), index_hi(0), m_mode(UninitializedMode), cyclic(false) {}
/** Caclulates the position for given segment Idx, and percent of segment length t
@param t - percent of segment length, assumes that t in range [0, 1]
@@ -138,13 +136,11 @@ class Spline : public SplineBase
public:
typedef length_type LengthType;
typedef std::vector<length_type> LengthArray;
#pragma region fields
protected:
LengthArray lengths;
index_type computeIndexInBounds(length_type length) const;
#pragma endregion
public:
explicit Spline(){}
+1 -1
View File
@@ -360,7 +360,7 @@ class Quest
struct QuestStatusData
{
QuestStatusData(): Status(QUEST_STATUS_NONE), Explored(false), Timer(0), PlayerCount(0)
QuestStatusData(): Status(QUEST_STATUS_NONE), Timer(0), PlayerCount(0), Explored(false)
{
memset(ItemCount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint16));
memset(CreatureOrGOCount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint16));
@@ -373,10 +373,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
};
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster):
m_base(base), m_spellInfo(base->GetSpellInfo()), m_effIndex(effIndex),
m_base(base), m_spellInfo(base->GetSpellInfo()),
m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[m_effIndex].BasePoints),
m_canBeRecalculated(true), m_spellmod(NULL), m_isPeriodic(false),
m_periodicTimer(0), m_tickNumber(0)
m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
m_canBeRecalculated(true), m_isPeriodic(false)
{
CalculatePeriodic(caster, true, false);
+2 -2
View File
@@ -37,8 +37,8 @@
#include "Vehicle.h"
AuraApplication::AuraApplication(Unit* target, Unit* caster, Aura* aura, uint8 effMask):
_target(target), _base(aura), _slot(MAX_AURAS), _flags(AFLAG_NONE),
_effectsToApply(effMask), _removeMode(AURA_REMOVE_NONE), _needClientUpdate(false)
_target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS),
_flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false)
{
ASSERT(GetTarget() && GetBase());
+1 -1
View File
@@ -4651,7 +4651,7 @@ SpellCastResult Spell::CheckCast(bool strict)
Unit::AuraEffectList const& blockSpells = m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY);
for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr)
if ((*blockItr)->GetMiscValue() == m_spellInfo->SpellFamilyName)
if (uint32((*blockItr)->GetMiscValue()) == m_spellInfo->SpellFamilyName)
return SPELL_FAILED_SPELL_UNAVAILABLE;
bool reqCombat = true;