Fix "unreachable code" warnings

This commit is contained in:
dhewg 2012-01-15 13:39:23 +01:00 committed by Daniel Gibson
parent 9de64efa62
commit c5c5762ae4
21 changed files with 182 additions and 189 deletions

View file

@ -1374,9 +1374,9 @@ bool idBrittleFracture::ClientReceiveEvent( int event, int time, const idBitMsg
Shatter( point, dir, time ); Shatter( point, dir, time );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}

View file

@ -932,7 +932,8 @@ bool idEntity::DoDormantTests( void ) {
return false; return false;
} }
return true; return true;
} else { }
// the monster area is topologically connected to a player, but if // the monster area is topologically connected to a player, but if
// the monster hasn't been woken up before, do the more precise PVS check // the monster hasn't been woken up before, do the more precise PVS check
if ( !fl.hasAwakened ) { if ( !fl.hasAwakened ) {
@ -944,8 +945,6 @@ bool idEntity::DoDormantTests( void ) {
// wake up // wake up
dormantStart = 0; dormantStart = 0;
fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS
return false;
}
return false; return false;
} }
@ -5028,10 +5027,10 @@ bool idEntity::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
StopSound( channel, false ); StopSound( channel, false );
return true; return true;
} }
default: { default:
return false; break;
}
} }
return false; return false;
} }
@ -5509,12 +5508,12 @@ bool idAnimatedEntity::ClientReceiveEvent( int event, int time, const idBitMsg &
AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial ); AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
================ ================

View file

@ -1615,7 +1615,8 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
} }
idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) ); idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) );
return true; return true;
} else { }
// 2: table of pak URLs // 2: table of pak URLs
// first token is the game pak if request, empty if not requested by the client // first token is the game pak if request, empty if not requested by the client
// there may be empty tokens for paks the server couldn't pinpoint - the order matters // there may be empty tokens for paks the server couldn't pinpoint - the order matters
@ -1657,8 +1658,6 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
idStr::Copynz( urls, reply, MAX_STRING_CHARS ); idStr::Copynz( urls, reply, MAX_STRING_CHARS );
return true; return true;
} }
return false;
}
/* /*
=============== ===============

View file

@ -486,12 +486,12 @@ bool idItem::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
Event_RespawnFx(); Event_RespawnFx();
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
================ ================

View file

@ -1157,9 +1157,9 @@ bool idLight::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
BecomeBroken( NULL ); BecomeBroken( NULL );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}

View file

@ -137,12 +137,12 @@ bool idPlayerStart::ClientReceiveEvent( int event, int time, const idBitMsg &msg
} }
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
=============== ===============

View file

@ -1345,15 +1345,14 @@ idExplodingBarrel::ClientReceiveEvent
bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
switch( event ) { switch( event ) {
case EVENT_EXPLODE: { case EVENT_EXPLODE:
if ( gameLocal.realClientTime - msg.ReadLong() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { if ( gameLocal.realClientTime - msg.ReadLong() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) {
ExplodingEffects( ); ExplodingEffects( );
} }
return true; return true;
default:
break;
} }
default: {
return idBarrel::ClientReceiveEvent( event, time, msg ); return idBarrel::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}

View file

@ -7633,11 +7633,9 @@ bool idPlayer::CanGive( const char *statname, const char *value ) {
return false; return false;
} }
return true; return true;
} else {
return inventory.CanGive( this, spawnArgs, statname, value, &idealWeapon );
} }
return false; return inventory.CanGive( this, spawnArgs, statname, value, &idealWeapon );
} }
/* /*
@ -9817,14 +9815,14 @@ bool idPlayer::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
// happens if the event and the spectate change are written on the server during the same frame (fraglimit) // happens if the event and the spectate change are written on the server during the same frame (fraglimit)
return true; return true;
} }
break;
}
default:
break;
}
return idActor::ClientReceiveEvent( event, time, msg ); return idActor::ClientReceiveEvent( event, time, msg );
} }
default: {
return idActor::ClientReceiveEvent( event, time, msg );
}
}
return false;
}
/* /*
================ ================

View file

@ -1383,12 +1383,12 @@ bool idProjectile::ClientReceiveEvent( int event, int time, const idBitMsg &msg
DefaultDamageEffect( this, spawnArgs, collision, velocity ); DefaultDamageEffect( this, spawnArgs, collision, velocity );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
=============================================================================== ===============================================================================

View file

@ -2757,12 +2757,12 @@ bool idWeapon::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
} }
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/*********************************************************************** /***********************************************************************

View file

@ -1280,9 +1280,9 @@ bool idBrittleFracture::ClientReceiveEvent( int event, int time, const idBitMsg
Shatter( point, dir, time ); Shatter( point, dir, time );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}

View file

@ -863,7 +863,8 @@ bool idEntity::DoDormantTests( void ) {
return false; return false;
} }
return true; return true;
} else { }
// the monster area is topologically connected to a player, but if // the monster area is topologically connected to a player, but if
// the monster hasn't been woken up before, do the more precise PVS check // the monster hasn't been woken up before, do the more precise PVS check
if ( !fl.hasAwakened ) { if ( !fl.hasAwakened ) {
@ -875,8 +876,6 @@ bool idEntity::DoDormantTests( void ) {
// wake up // wake up
dormantStart = 0; dormantStart = 0;
fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS
return false;
}
return false; return false;
} }
@ -4854,10 +4853,10 @@ bool idEntity::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
StopSound( channel, false ); StopSound( channel, false );
return true; return true;
} }
default: { default:
return false; break;
}
} }
return false; return false;
} }
@ -5297,12 +5296,12 @@ bool idAnimatedEntity::ClientReceiveEvent( int event, int time, const idBitMsg &
AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial ); AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
================ ================

View file

@ -1570,7 +1570,8 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
} }
idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) ); idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) );
return true; return true;
} else { }
// 2: table of pak URLs // 2: table of pak URLs
// first token is the game pak if request, empty if not requested by the client // first token is the game pak if request, empty if not requested by the client
// there may be empty tokens for paks the server couldn't pinpoint - the order matters // there may be empty tokens for paks the server couldn't pinpoint - the order matters
@ -1612,8 +1613,6 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
idStr::Copynz( urls, reply, MAX_STRING_CHARS ); idStr::Copynz( urls, reply, MAX_STRING_CHARS );
return true; return true;
} }
return false;
}
/* /*
=============== ===============

View file

@ -478,12 +478,12 @@ bool idItem::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
Event_RespawnFx(); Event_RespawnFx();
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
================ ================

View file

@ -1150,9 +1150,9 @@ bool idLight::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
BecomeBroken( NULL ); BecomeBroken( NULL );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}

View file

@ -137,12 +137,12 @@ bool idPlayerStart::ClientReceiveEvent( int event, int time, const idBitMsg &msg
} }
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
=============== ===============

View file

@ -1181,15 +1181,14 @@ idExplodingBarrel::ClientReceiveEvent
bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) { bool idExplodingBarrel::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
switch( event ) { switch( event ) {
case EVENT_EXPLODE: { case EVENT_EXPLODE:
if ( gameLocal.realClientTime - msg.ReadLong() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) { if ( gameLocal.realClientTime - msg.ReadLong() < spawnArgs.GetInt( "explode_lapse", "1000" ) ) {
ExplodingEffects( ); ExplodingEffects( );
} }
return true; return true;
default:
break;
} }
default: {
return idBarrel::ClientReceiveEvent( event, time, msg ); return idBarrel::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}

View file

@ -8263,14 +8263,14 @@ bool idPlayer::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
// happens if the event and the spectate change are written on the server during the same frame (fraglimit) // happens if the event and the spectate change are written on the server during the same frame (fraglimit)
return true; return true;
} }
break;
}
default:
break;
}
return idActor::ClientReceiveEvent( event, time, msg ); return idActor::ClientReceiveEvent( event, time, msg );
} }
default: {
return idActor::ClientReceiveEvent( event, time, msg );
}
}
return false;
}
/* /*
================ ================

View file

@ -1210,12 +1210,12 @@ bool idProjectile::ClientReceiveEvent( int event, int time, const idBitMsg &msg
DefaultDamageEffect( this, spawnArgs, collision, velocity ); DefaultDamageEffect( this, spawnArgs, collision, velocity );
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/* /*
=============================================================================== ===============================================================================

View file

@ -2329,12 +2329,12 @@ bool idWeapon::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
} }
return true; return true;
} }
default: { default:
break;
}
return idEntity::ClientReceiveEvent( event, time, msg ); return idEntity::ClientReceiveEvent( event, time, msg );
} }
}
return false;
}
/*********************************************************************** /***********************************************************************

View file

@ -2649,9 +2649,10 @@ ID_INLINE bool idMatX::InverseFastSelf( void ) {
case 6: case 6:
return reinterpret_cast<idMat6 *>(mat)->InverseFastSelf(); return reinterpret_cast<idMat6 *>(mat)->InverseFastSelf();
default: default:
return InverseSelfGeneric(); break;
} }
return false;
return InverseSelfGeneric();
} }
ID_INLINE idVecX idMatX::Multiply( const idVecX &vec ) const { ID_INLINE idVecX idMatX::Multiply( const idVecX &vec ) const {