Core: Fixed warnings:

C4100: 'variable' : unreferenced formal parameter
C4701: potentially uninitialized local variable
C4389: '!=' : signed/unsigned mismatch
C4245: 'argument' : conversion from 'X' to 'Y', signed/unsigned mismatch
This commit is contained in:
Shauren
2011-03-08 16:42:00 +01:00
parent 00f2ded757
commit e5347a3bda
24 changed files with 54 additions and 51 deletions
@@ -21,7 +21,7 @@
void BIH::buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats)
{
// create space for the first node
tempTree.push_back(3 << 30); // dummy leaf
tempTree.push_back(uint32(3 << 30)); // dummy leaf
tempTree.insert(tempTree.end(), 2, 0);
//tempTree.add(0);
+2 -2
View File
@@ -289,7 +289,7 @@ namespace VMAP
char chunk[8];
//general info
if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) success = false;
char tiled;
char tiled = '\0';
if (success && fread(&tiled, sizeof(char), 1, rf) != 1) success = false;
iIsTiled = bool(tiled);
// Nodes
@@ -370,7 +370,7 @@ namespace VMAP
if (!readChunk(tf, chunk, VMAP_MAGIC, 8))
result = false;
uint32 numSpawns;
uint32 numSpawns = 0;
if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1)
result = false;
for (uint32 i=0; i<numSpawns && result; ++i)
@@ -153,7 +153,7 @@ namespace VMAP
bool ModelSpawn::readFromFile(FILE *rf, ModelSpawn &spawn)
{
uint32 check=0, nameLen;
uint32 check = 0, nameLen;
check += fread(&spawn.flags, sizeof(uint32), 1, rf);
// EoF?
if (!check)
@@ -176,13 +176,13 @@ namespace VMAP
spawn.iBound = G3D::AABox(bLow, bHigh);
}
check += fread(&nameLen, sizeof(uint32), 1, rf);
if(check != (has_bound ? 17 : 11))
if (check != uint32(has_bound ? 17 : 11))
{
std::cout << "Error reading ModelSpawn!\n";
return false;
}
char nameBuff[500];
if (nameLen>500) // file names should never be that long, must be file error
if (nameLen > 500) // file names should never be that long, must be file error
{
std::cout << "Error reading ModelSpawn, file name too long!\n";
return false;
@@ -207,16 +207,16 @@ namespace VMAP
check += fwrite(&spawn.iRot, sizeof(float), 3, wf);
check += fwrite(&spawn.iScale, sizeof(float), 1, wf);
bool has_bound = (spawn.flags & MOD_HAS_BOUND);
if(has_bound) // only WMOs have bound in MPQ, only available after computation
if (has_bound) // only WMOs have bound in MPQ, only available after computation
{
check += fwrite(&spawn.iBound.low(), sizeof(float), 3, wf);
check += fwrite(&spawn.iBound.high(), sizeof(float), 3, wf);
}
uint32 nameLen = spawn.name.length();
check += fwrite(&nameLen, sizeof(uint32), 1, wf);
if(check != (has_bound ? 17 : 11)) return false;
if (check != uint32(has_bound ? 17 : 11)) return false;
check = fwrite(spawn.name.c_str(), sizeof(char), nameLen, wf);
if(check != nameLen) return false;
if (check != nameLen) return false;
return true;
}
+5 -3
View File
@@ -303,11 +303,12 @@ namespace VMAP
{
char chunk[8];
bool result = true;
uint32 chunkSize, count;
uint32 chunkSize = 0;
uint32 count = 0;
triangles.clear();
vertices.clear();
delete iLiquid;
iLiquid = 0;
iLiquid = NULL;
if (result && fread(&iBound, sizeof(G3D::AABox), 1, rf) != 1) result = false;
if (result && fread(&iMogpFlags, sizeof(uint32), 1, rf) != 1) result = false;
@@ -538,7 +539,8 @@ namespace VMAP
return false;
bool result = true;
uint32 chunkSize, count;
uint32 chunkSize = 0;
uint32 count = 0;
char chunk[8]; // Ignore the added magic header
if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) result = false;
+1 -1
View File
@@ -168,7 +168,7 @@ class CreatureAI : public UnitAI
virtual void PassengerBoarded(Unit * /*who*/, int8 /*seatId*/, bool /*apply*/) {}
virtual bool CanSeeAlways(WorldObject const* obj) {return false;}
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
protected:
virtual void MoveInLineOfSight(Unit *);
@@ -1549,7 +1549,7 @@ void Creature::setDeathState(DeathState s)
if (GetCreatureInfo()->InhabitType & INHABIT_WATER)
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
ClearUnitState(UNIT_STAT_ALL_STATE);
ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
LoadCreaturesAddon(true);
Motion_Initialize();
@@ -1612,7 +1612,7 @@ void Creature::Respawn(bool force)
{
setDeathState(JUST_DIED);
i_motionMaster.Clear();
ClearUnitState(UNIT_STAT_ALL_STATE);
ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
LoadCreaturesAddon(true);
}
else
+1 -1
View File
@@ -2555,7 +2555,7 @@ void Player::SetGameMaster(bool on)
getHostileRefManager().setOnlineOfflineState(false);
CombatStopWithPets();
SetPhaseMask(PHASEMASK_ANYWHERE, false); // see and visible in all phases
SetPhaseMask(uint32(PHASEMASK_ANYWHERE), false); // see and visible in all phases
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, GetSession()->GetSecurity());
}
else
+3 -3
View File
@@ -264,7 +264,7 @@ void Guild::RankInfo::SetRights(uint32 rights)
void Guild::RankInfo::SetBankMoneyPerDay(uint32 money)
{
if (m_rankId == GR_GUILDMASTER) // Prevent loss of leader rights
money = GUILD_WITHDRAW_MONEY_UNLIMITED;
money = uint32(GUILD_WITHDRAW_MONEY_UNLIMITED);
if (m_bankMoneyPerDay == money)
return;
@@ -1397,8 +1397,8 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId)
return;
player->ModifyMoney(-int32(tabCost));
_SetRankBankMoneyPerDay(player->GetRank(), GUILD_WITHDRAW_MONEY_UNLIMITED);
_SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, GUILD_WITHDRAW_SLOT_UNLIMITED));
_SetRankBankMoneyPerDay(player->GetRank(), uint32(GUILD_WITHDRAW_MONEY_UNLIMITED));
_SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, uint32(GUILD_WITHDRAW_SLOT_UNLIMITED)));
HandleRoster(); // Broadcast for tab rights update
SendBankTabsInfo(session);
}
+3 -3
View File
@@ -228,11 +228,11 @@ struct GuildBankRightsAndSlots
GuildBankRightsAndSlots() : rights(0), slots(0) { }
GuildBankRightsAndSlots(uint8 _rights, uint32 _slots) : rights(_rights), slots(_slots) { }
inline bool IsEqual(const GuildBankRightsAndSlots& rhs) const { return rights == rhs.rights && slots == rhs.slots; }
inline bool IsEqual(GuildBankRightsAndSlots const& rhs) const { return rights == rhs.rights && slots == rhs.slots; }
void SetGuildMasterValues()
{
rights = GUILD_BANK_RIGHT_FULL;
slots = GUILD_WITHDRAW_SLOT_UNLIMITED;
slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED);
}
uint8 rights;
@@ -387,7 +387,7 @@ private:
class LogHolder
{
public:
LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(GUILD_EVENT_LOG_GUID_UNDEFINED) { }
LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { }
~LogHolder();
uint8 GetSize() const { return uint8(m_log.size()); }
@@ -60,7 +60,7 @@ HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
uint32 travel_time = i_destinationHolder.SetDestination(traveller, x, y, z);
modifyTravelTime(travel_time);
owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE);
owner.ClearUnitState(uint32(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE));
}
bool
@@ -114,7 +114,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
if (msg.empty())
return;
sScriptMgr->OnPlayerChat(GetPlayer(), CHAT_MSG_ADDON, lang, msg);
sScriptMgr->OnPlayerChat(GetPlayer(), uint32(CHAT_MSG_ADDON), lang, msg);
}
// Disabled addon channel?
@@ -307,7 +307,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL);
ChatHandler::FillMessageData(&data, this, uint8(type), lang, NULL, 0, msg.c_str(), NULL);
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
} break;
case CHAT_MSG_GUILD:
+5 -5
View File
@@ -315,10 +315,10 @@ Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * o
{
case TYPEID_UNIT:
case TYPEID_PLAYER:
aura = new UnitAura(spellproto,effMask,owner,caster,baseAmount,castItem, casterGUID);
aura = new UnitAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
break;
case TYPEID_DYNAMICOBJECT:
aura = new DynObjAura(spellproto,effMask,owner,caster,baseAmount,castItem, casterGUID);
aura = new DynObjAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
break;
default:
ASSERT(false);
@@ -330,7 +330,7 @@ Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * o
return aura;
}
Aura::Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID):
Aura::Aura(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, Item * castItem, uint64 casterGUID) :
m_spellProto(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
m_castItemGuid(castItem ? castItem->GetGUID() : 0), m_applyTime(time(NULL)),
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
@@ -1863,7 +1863,7 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect * aurEff, AuraAppl
}
UnitAura::UnitAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID)
: Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID)
: Aura(spellproto, owner, caster, castItem, casterGUID)
{
m_AuraDRGroup = DIMINISHING_NONE;
LoadScripts();
@@ -1975,7 +1975,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit * caster)
}
DynObjAura::DynObjAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID)
: Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID)
: Aura(spellproto, owner, caster, castItem, casterGUID)
{
LoadScripts();
ASSERT(GetDynobjOwner());
+1 -1
View File
@@ -84,7 +84,7 @@ class Aura
static Aura * TryCreate(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0);
static Aura * TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0);
static Aura * Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0);
explicit Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID);
explicit Aura(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, Item * castItem, uint64 casterGUID);
void _InitEffects(uint8 effMask, Unit * caster, int32 *baseAmount);
~Aura();
+1 -1
View File
@@ -6268,7 +6268,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
pet->setDeathState(ALIVE);
pet->ClearUnitState(UNIT_STAT_ALL_STATE);
pet->ClearUnitState(uint32(UNIT_STAT_ALL_STATE));
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
//pet->AIM_Initialize();
@@ -139,7 +139,7 @@ class mob_core_rager : public CreatureScript
mangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong
}
void DamageTaken(Unit* /*attacker*/, uint32& damage)
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
{
if (HealthAbovePct(50) || !instance)
return;
@@ -126,8 +126,8 @@ struct boss_twin_baseAI : public ScriptedAI
uint32 m_uiTouchTimer;
uint32 m_uiBerserkTimer;
uint32 m_uiVortexSay;
uint32 m_uiVortexEmote;
int32 m_uiVortexSay;
int32 m_uiVortexEmote;
uint32 m_uiSisterNpcId;
uint32 m_uiColorballNpcId;
uint32 m_uiEssenceNpcId;
@@ -284,7 +284,7 @@ class spell_trash_mob_glacial_strike : public SpellScriptLoader
{
PrepareAuraScript(spell_trash_mob_glacial_strike_AuraScript);
void PeriodicTick(AuraEffect const* aurEff)
void PeriodicTick(AuraEffect const* /*aurEff*/)
{
if (GetTarget()->IsFullHealth())
{
@@ -781,7 +781,7 @@ class npc_rimefang : public CreatureScript
break;
case EVENT_ICY_BLAST:
{
icyBlastCounter = RAID_MODE<uint32>(5, 7, 6, 8);
icyBlastCounter = RAID_MODE<uint8>(5, 7, 6, 8);
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->SetFlying(true);
@@ -1391,7 +1391,7 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader
{
PrepareAuraScript(spell_frostwarden_handler_focus_fire_AuraScript);
void PeriodicTick(AuraEffect const* aurEff)
void PeriodicTick(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
if (Unit* caster = GetCaster())
@@ -300,7 +300,7 @@ class spell_icc_harvest_blight_specimen : public SpellScriptLoader
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
}
void HandleQuestComplete(SpellEffIndex effIndex)
void HandleQuestComplete(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
}
@@ -286,7 +286,7 @@ enum SharedActions
// Sindragosa
ACTION_START_FROSTWYRM = -368530,
ACTION_TRIGGER_ASPHYXIATION = -368531,
ACTION_TRIGGER_ASPHYXIATION = 368531,
};
// Declaration
@@ -117,7 +117,7 @@ class boss_kologarn : public CreatureScript
bool left, right;
uint64 eyebeamTarget;
void EnterCombat(Unit * who)
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
@@ -156,7 +156,7 @@ class boss_kologarn : public CreatureScript
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me);
}
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply)
{
bool isEncounterInProgress = instance->GetBossState(TYPE_KOLOGARN) == IN_PROGRESS;
if (who->GetEntry() == NPC_LEFT_ARM)
@@ -549,7 +549,7 @@ class spell_ulduar_stone_grip_absorb : public SpellScriptLoader
//! This will be called when Right Arm (vehicle) has sustained a specific amount of damage depending on instance mode
//! What we do here is remove all harmful aura's related and teleport to safe spot.
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes mode)
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
@@ -596,7 +596,7 @@ class spell_ulduar_stone_grip : public SpellScriptLoader
pOwner->RemoveAurasDueToSpell(aurEff->GetAmount());
}
void OnRemoveVehicle(AuraEffect const* aurEff, AuraEffectHandleModes mode)
void OnRemoveVehicle(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
+4 -4
View File
@@ -674,8 +674,8 @@ public:
{
npc_icefangAI(Creature* creature) : npc_escortAI(creature) {}
void AttackStart(Unit* who) {}
void EnterCombat(Unit* who) {}
void AttackStart(Unit* /*who*/) {}
void EnterCombat(Unit* /*who*/) {}
void EnterEvadeMode() {}
void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply)
@@ -687,11 +687,11 @@ public:
}
}
void WaypointReached(uint32 wp)
void WaypointReached(uint32 /*wp*/)
{
}
void JustDied(Unit* killer)
void JustDied(Unit* /*killer*/)
{
}
+1
View File
@@ -828,6 +828,7 @@ class spell_item_create_heart_candy : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (!GetHitUnit() || !GetHitUnit()->ToPlayer())
return;
@@ -753,7 +753,7 @@ bool bWriteVariables, HANDLE pThreadHandle)
BOOL CALLBACK
WheatyExceptionReport::EnumerateSymbolsCallback(
PSYMBOL_INFO pSymInfo,
ULONG SymbolSize,
ULONG /*SymbolSize*/,
PVOID UserContext)
{
@@ -782,7 +782,7 @@ bool WheatyExceptionReport::FormatSymbolValue(
PSYMBOL_INFO pSym,
STACKFRAME * sf,
char * pszBuffer,
unsigned cbBuffer)
unsigned /*cbBuffer*/)
{
char * pszCurrBuffer = pszBuffer;
@@ -853,7 +853,7 @@ DWORD dwTypeIndex,
unsigned nestingLevel,
DWORD_PTR offset,
bool & bHandled,
char* Name)
char* /*Name*/)
{
bHandled = false;