[9381] Fixed some compile warnings.

This commit is contained in:
AlexDereka 2010-02-14 18:04:20 +03:00
parent 2bdcb1161c
commit ccfd42bf3e
55 changed files with 219 additions and 203 deletions

View file

@ -555,7 +555,7 @@ void Player::CleanupsBeforeDelete()
Unit::CleanupsBeforeDelete();
}
bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 outfitId )
bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 /*outfitId */)
{
//FIXME: outfitId not used in player creating
@ -1245,12 +1245,12 @@ void Player::Update( uint32 p_time )
{
if(roll_chance_i(3) && GetTimeInnEnter() > 0) //freeze update
{
int time_inn = time(NULL)-GetTimeInnEnter();
time_t time_inn = time(NULL)-GetTimeInnEnter();
if (time_inn >= 10) //freeze update
{
float bubble = 0.125*sWorld.getRate(RATE_REST_INGAME);
float bubble = 0.125f*sWorld.getRate(RATE_REST_INGAME);
//speed collect rest bonus (section/in hour)
SetRestBonus( GetRestBonus()+ time_inn*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble );
SetRestBonus( float(GetRestBonus()+ time_inn*(GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble ));
UpdateInnerTime(time(NULL));
}
}
@ -1946,18 +1946,18 @@ void Player::RewardRage( uint32 damage, uint32 weaponSpeedHitFactor, bool attack
{
float addRage;
float rageconversion = ((0.0091107836 * getLevel()*getLevel())+3.225598133*getLevel())+4.2652911;
float rageconversion = float((0.0091107836 * getLevel()*getLevel())+3.225598133*getLevel())+4.2652911f;
if(attacker)
{
addRage = ((damage/rageconversion*7.5 + weaponSpeedHitFactor)/2);
addRage = ((damage/rageconversion*7.5f + weaponSpeedHitFactor)/2.0f);
// talent who gave more rage on attack
addRage *= 1.0f + GetTotalAuraModifier(SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT) / 100.0f;
}
else
{
addRage = damage/rageconversion*2.5;
addRage = damage/rageconversion*2.5f;
// Berserker Rage effect
if(HasAura(18499,0))
@ -3568,13 +3568,13 @@ uint32 Player::resetTalentsCost() const
return 10*GOLD;
else
{
uint32 months = (sWorld.GetGameTime() - m_resetTalentsTime)/MONTH;
time_t months = (sWorld.GetGameTime() - m_resetTalentsTime)/MONTH;
if(months > 0)
{
// This cost will be reduced by a rate of 5 gold per month
int32 new_cost = int32(m_resetTalentsCost) - 5*GOLD*months;
int32 new_cost = int32((m_resetTalentsCost) - 5*GOLD*months);
// to a minimum of 10 gold.
return (new_cost < 10*GOLD ? 10*GOLD : new_cost);
return uint32(new_cost < 10*GOLD ? 10*GOLD : new_cost);
}
else
{
@ -14391,7 +14391,7 @@ void Player::SendPushToPartyResponse( Player *pPlayer, uint32 msg )
}
}
void Player::SendQuestUpdateAddItem( Quest const* pQuest, uint32 item_idx, uint32 count )
void Player::SendQuestUpdateAddItem( Quest const* /*pQuest*/, uint32 /*item_idx*/, uint32 /*count*/ )
{
WorldPacket data( SMSG_QUESTUPDATE_ADD_ITEM, 0 );
sLog.outDebug( "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM" );
@ -15717,7 +15717,7 @@ void Player::_LoadQuestStatus(QueryResult *result)
if (quest_time <= sWorld.GetGameTime())
questStatusData.m_timer = 1;
else
questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * IN_MILISECONDS;
questStatusData.m_timer = uint32(quest_time - sWorld.GetGameTime()) * IN_MILISECONDS;
}
else
quest_time = 0;
@ -15740,7 +15740,7 @@ void Player::_LoadQuestStatus(QueryResult *result)
questStatusData.m_status == QUEST_STATUS_FAILED) &&
(!questStatusData.m_rewarded || pQuest->IsRepeatable())))
{
SetQuestSlot(slot, quest_id, quest_time);
SetQuestSlot(slot, quest_id, uint32(quest_time));
if (questStatusData.m_status == QUEST_STATUS_COMPLETE)
SetQuestSlotState(slot, QUEST_STATE_COMPLETE);
@ -17533,7 +17533,7 @@ void Player::SetRestBonus (float rest_bonus_new)
if(rest_bonus_new < 0)
rest_bonus_new = 0;
float rest_bonus_max = (float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)*1.5/2;
float rest_bonus_max = (float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)*1.5f/2.0f;
if(rest_bonus_new > rest_bonus_max)
m_rest_bonus = rest_bonus_max;
@ -18804,7 +18804,7 @@ inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, GameObject* target)
}
template<class T>
void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow)
void Player::UpdateVisibilityOf(WorldObject const* viewPoint, T* target, UpdateData& data, UpdateDataMapType& /*data_updates*/, std::set<WorldObject*>& visibleNow)
{
if(HaveAtClient(target))
{
@ -19611,7 +19611,7 @@ bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const
// Check no reagent use mask
uint64 noReagentMask_0_1 = GetUInt64Value(PLAYER_NO_REAGENT_COST_1);
uint32 noReagentMask_2 = GetUInt64Value(PLAYER_NO_REAGENT_COST_1+2);
uint32 noReagentMask_2 = GetUInt32Value(PLAYER_NO_REAGENT_COST_1+2);
if (spellInfo->SpellFamilyFlags & noReagentMask_0_1 ||
spellInfo->SpellFamilyFlags2 & noReagentMask_2)
return true;
@ -19946,7 +19946,7 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
time_t now = time(NULL);
// 0..2 full period
uint32 count = (now < m_deathExpireTime) ? (m_deathExpireTime - now)/DEATH_EXPIRE_STEP : 0;
uint32 count = (now < m_deathExpireTime) ? uint32((m_deathExpireTime - now)/DEATH_EXPIRE_STEP) : 0;
return copseReclaimDelay[count];
}
@ -19962,7 +19962,7 @@ void Player::UpdateCorpseReclaimDelay()
if(now < m_deathExpireTime)
{
// full and partly periods 1..3
uint32 count = (m_deathExpireTime - now)/DEATH_EXPIRE_STEP +1;
uint32 count = uint32((m_deathExpireTime - now)/DEATH_EXPIRE_STEP +1);
if(count < MAX_DEATH_COUNT)
m_deathExpireTime = now+(count+1)*DEATH_EXPIRE_STEP;
else
@ -19990,7 +19990,7 @@ void Player::SendCorpseReclaimDelay(bool load)
if( pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP) ||
!pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE) )
{
count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
count = uint32(m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
if(count>=MAX_DEATH_COUNT)
count = MAX_DEATH_COUNT-1;
}
@ -20003,7 +20003,7 @@ void Player::SendCorpseReclaimDelay(bool load)
if(now >= expected_time)
return;
delay = expected_time-now;
delay = uint32(expected_time-now);
}
else
delay = GetCorpseReclaimDelay(corpse->GetType()==CORPSE_RESURRECTABLE_PVP);