[8475] fixed some gcc-warnings

all warnings from Wunused
and some from Wall

cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code

for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint

also note for coding:
if you do something like
    if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)

Signed-off-by: balrok <der-coole-carl@gmx.net>
This commit is contained in:
balrok 2009-09-05 10:42:36 +02:00
parent 56ddf40d62
commit bd30769dec
36 changed files with 96 additions and 101 deletions

View file

@ -153,7 +153,7 @@ void Creature::RemoveFromWorld()
void Creature::RemoveCorpse()
{
if( getDeathState()!=CORPSE && !m_isDeadByDefault || getDeathState()!=ALIVE && m_isDeadByDefault )
if ((getDeathState() != CORPSE && !m_isDeadByDefault) || (getDeathState() != ALIVE && m_isDeadByDefault))
return;
m_deathTimer = 0;
@ -1459,8 +1459,8 @@ float Creature::GetAttackDistance(Unit const* pl) const
if(aggroRate==0)
return 0.0f;
int32 playerlevel = pl->getLevelForTarget(this);
int32 creaturelevel = getLevelForTarget(pl);
uint32 playerlevel = pl->getLevelForTarget(this);
uint32 creaturelevel = getLevelForTarget(pl);
int32 leveldif = playerlevel - creaturelevel;
@ -1730,7 +1730,7 @@ bool Creature::IsVisibleInGridForPlayer(Player* pl) const
{
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE)
return false;
return isAlive() || m_deathTimer > 0 || m_isDeadByDefault && m_deathState==CORPSE;
return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState == CORPSE));
}
// Dead player see live creatures near own corpse