Skip to content
Permalink
Browse files

Code/Cleanup: Fix compile warnings

  • Loading branch information...
Zaffy committed May 28, 2019
1 parent bc41b4a commit f14fc98dc7580c3c20d161497d3e7e5f88a2f6ff
No changes.
@@ -73,7 +73,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)

AddOnPacked.resize(AddonRealSize); // resize target for zlib action

if (!uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition) != Z_OK)
if (Z_OK == uncompress(const_cast<uint8*>(AddOnPacked.contents()), &AddonRealSize, const_cast<uint8*>((*Source).contents() + CurrentPosition), (*Source).size() - CurrentPosition))
{
Target->Initialize(SMSG_ADDON_INFO);

@@ -2366,7 +2366,7 @@ void Creature::AllLootRemovedFromCorpse()
m_respawnTime = m_corpseRemoveTime + m_respawnDelay;
}

uint8 Creature::getLevelForTarget(Unit const* target) const
uint8 Creature::getLevelForTarget(WorldObject const* target) const
{
if (!isWorldBoss() || !target->ToUnit())
return Unit::getLevelForTarget(target);
@@ -516,7 +516,7 @@ class Creature : public Unit, public GridObject<Creature>
bool isElite() const;
bool isWorldBoss() const;

uint8 getLevelForTarget(Unit const* target) const; // overwrite Unit::getLevelForTarget for boss level support
uint8 getLevelForTarget(WorldObject const* target) const override; // overwrite Unit::getLevelForTarget for boss level support

bool IsInEvadeMode() const;

@@ -551,7 +551,7 @@ class Creature : public Unit, public GridObject<Creature>
void UpdateAttackPowerAndDamage(bool ranged = false) override;
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override;

void SetCanDualWield(bool value);
void SetCanDualWield(bool value) override;
void SetCurrentEquipmentId(uint8 id) { m_equipmentId = id; }
uint32 GetCurrentEquipmentId() { return m_equipmentId; }
float GetSpellDamageMod(int32 Rank) const;
@@ -82,10 +82,10 @@ class CreatureAI : public UnitAI
explicit CreatureAI(Creature* c) :
UnitAI((Unit*)c),
me(c),
m_MoveInLineOfSight_locked(false),
CombatMovementEnabled(true),
AttackDistance(0.0f),
AttackAngle(0.0f)
AttackAngle(0.0f),
m_MoveInLineOfSight_locked(false)
{}

~CreatureAI() override {}
@@ -128,7 +128,7 @@ class CreatureAI : public UnitAI
virtual void SpellHitTarget(Unit* /*target*/, const SpellEntry*) {}

// Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc)
virtual void AttackedBy(Unit* attacker) {}
virtual void AttackedBy(Unit* /*attacker*/) {}

virtual bool IsEscorted()
{
@@ -493,7 +493,7 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup)
return true;
}

std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, int loc_idx) const
std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 /*gender*/, uint8 textGroup, uint32 id, int loc_idx) const
{
CreatureTextMap::const_iterator mapitr = mTextMap.find(entry);
if (mapitr == mTextMap.end())
@@ -208,7 +208,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errlist, DBCS
if (f)
{
char buf[100];
snprintf(buf, 100, " (exists, but has %d fields instead %d) Wrong client version of DBC files?", storage.GetFieldCount(), strlen(storage.GetFormat()));
snprintf(buf, 100, " (exists, but has %d fields instead %lu) Wrong client version of DBC files?", storage.GetFieldCount(), strlen(storage.GetFormat()));
errlist.push_back(dbc_filename + buf);
fclose(f);
}
@@ -546,7 +546,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.outFatal("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s", bad_dbc_files.size(), DBCFilesCount, str.c_str());
sLog.outFatal("\nSome required *.dbc files (%lu from %d) not found or not compatible:\n%s", bad_dbc_files.size(), DBCFilesCount, str.c_str());
}

// check at up-to-date DBC files (53085 is last added spell in 2.4.3)
@@ -266,7 +266,7 @@ bool ChatHandler::HandleDebugPlayCinematicCommand(const char* args)
PSendSysMessage("%02u - %7ums [%f, %f, %f] Facing %f (%f degrees)", count, cam.timeStamp, cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w, cam.locations.w * (180 / M_PI));
count++;
}
PSendSysMessage("%u waypoints dumped", itr->second.size());
PSendSysMessage("%lu waypoints dumped", itr->second.size());
}
}

@@ -28,12 +28,12 @@ class FleeingMovementGenerator
public:
FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {}

void Initialize(T&);
void Finalize(T&);
void Reset(T&);
bool Update(T&, const uint32&);
void Initialize(T&) override;
void Finalize(T&) override;
void Reset(T&) override;
bool Update(T&, const uint32&) override;

MovementGeneratorType GetMovementGeneratorType()
MovementGeneratorType GetMovementGeneratorType() override
{
return FLEEING_MOTION_TYPE;
}
@@ -54,12 +54,12 @@ class TimedFleeingMovementGenerator
FleeingMovementGenerator<Creature>(fright),
i_totalFleeTime(time) {}

MovementGeneratorType GetMovementGeneratorType()
MovementGeneratorType GetMovementGeneratorType() override
{
return TIMED_FLEEING_MOTION_TYPE;
}
bool Update(Unit&, const uint32&);
void Finalize(Unit&);
bool Update(Unit&, const uint32&) override;
void Finalize(Unit&) override;

private:
TimeTracker i_totalFleeTime;
@@ -112,7 +112,7 @@ bool Group::Create(const uint64& guid, const char* name)
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty,masterLooterGuid) "
"VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')",
"VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','" UI64FMTD "')",
GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod),
GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_difficulty, m_masterLooterGuid);
}
@@ -231,7 +231,7 @@ class Group
{
return m_lootMethod;
}
const uint64 GetLooterGuid() const
uint64 GetLooterGuid() const
{
if (GetLootMethod() == FREE_FOR_ALL)
return 0;
@@ -34,8 +34,8 @@ class GuardAI : public ScriptedAI
public:
explicit GuardAI(Creature* creature);

void EnterEvadeMode();
void JustDied(Unit*);
void EnterEvadeMode() override;
void JustDied(Unit*) override;

static int Permissible(const Creature*);
bool CanSeeAlways(WorldObject const* obj) override;
@@ -68,7 +68,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature& owner)
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_EVADE | UNIT_STATE_IGNORE_PATHFINDING));
}

bool HomeMovementGenerator<Creature>::Update(Creature& owner, const uint32& time_diff)
bool HomeMovementGenerator<Creature>::Update(Creature& owner, const uint32& /*time_diff*/)
{
arrived = skipToHome || owner.movespline->Finalized();
return !arrived;
@@ -1210,7 +1210,7 @@ bool ChatHandler::HandleReloadAuctionsCommand(const char* /*args*/)
return true;
}

bool ChatHandler::HandleReloadConditions(const char* args)
bool ChatHandler::HandleReloadConditions(const char* /*args*/)
{
sLog.outString("Re-Loading Conditions...");
sConditionMgr.LoadConditions(true);
@@ -93,7 +93,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s
{
// search by GUID
if (isNumeric(searchString.c_str()))
resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = %llu", uint64(atoi(searchString.c_str())));
resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = " UI64FMTD, uint64(atoi(searchString.c_str())));
// search by name
else
{
@@ -31,10 +31,10 @@ class MapInstanced : public Map
~MapInstanced() {}

// functions overwrite Map versions
void Update(const uint32&);
void DelayedUpdate(const uint32 diff);
void Update(const uint32&) override;
void DelayedUpdate(const uint32 diff) override;
//void RelocationNotify();
void UnloadAll();
void UnloadAll() override;
EnterState CannotEnter(Player* /*player*/) override;

Map* CreateInstanceForPlayer(const uint32 mapId, Player* player, uint32 loginInstanceId = 0);
@@ -62,7 +62,7 @@ class MapInstanced : public Map
{
return m_InstancedMaps;
}
virtual void InitVisibilityDistance();
void InitVisibilityDistance() override;

private:

@@ -47,8 +47,8 @@ class MapUpdater
private:

DelayExecutor m_executor;
ACE_Condition_Thread_Mutex m_condition;
ACE_Thread_Mutex m_mutex;
ACE_Condition_Thread_Mutex m_condition;
size_t pending_requests;

void update_finished();
@@ -57,22 +57,22 @@ template<class T, class D>
class MovementGeneratorMedium : public MovementGenerator
{
public:
void Initialize(Unit& u)
void Initialize(Unit& u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->Initialize(*((T*)&u));
}
void Finalize(Unit& u)
void Finalize(Unit& u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->Finalize(*((T*)&u));
}
void Reset(Unit& u)
void Reset(Unit& u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->Reset(*((T*)&u));
}
bool Update(Unit& u, const uint32& time_diff)
bool Update(Unit& u, const uint32& time_diff) override
{
//u->AssertIsType<T>();
return (static_cast<D*>(this))->Update(*((T*)&u), time_diff);
@@ -2119,7 +2119,7 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, const Position& pos, TempS
{
if (Map* map = FindMap())
{
if (TempSummon* summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL, NULL, spwtype))
if (TempSummon* summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL, 0, spwtype))
return summon;
}

0 comments on commit f14fc98

Please sign in to comment.
You can’t perform that action at this time.