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 );
return true;
}
default: {
return idEntity::ClientReceiveEvent( event, time, msg );
}
default:
break;
}
return false;
return idEntity::ClientReceiveEvent( event, time, msg );
}

View file

@ -932,21 +932,20 @@ bool idEntity::DoDormantTests( void ) {
return false;
}
return true;
} else {
// 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
if ( !fl.hasAwakened ) {
if ( !gameLocal.InPlayerPVS( this ) ) {
return true; // stay dormant
}
}
// wake up
dormantStart = 0;
fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS
return false;
}
// 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
if ( !fl.hasAwakened ) {
if ( !gameLocal.InPlayerPVS( this ) ) {
return true; // stay dormant
}
}
// wake up
dormantStart = 0;
fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS
return false;
}
@ -5028,10 +5027,10 @@ bool idEntity::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
StopSound( channel, false );
return true;
}
default: {
return false;
}
default:
break;
}
return false;
}
@ -5509,11 +5508,11 @@ bool idAnimatedEntity::ClientReceiveEvent( int event, int time, const idBitMsg &
AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial );
return true;
}
default: {
return idEntity::ClientReceiveEvent( event, time, msg );
}
default:
break;
}
return false;
return idEntity::ClientReceiveEvent( event, time, msg );
}
/*

View file

@ -1615,49 +1615,48 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
}
idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) );
return true;
} else {
// 2: table of pak URLs
// 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
idStr reply = "2;";
idStrList dlTable, pakList;
int i, j;
}
Tokenize( dlTable, cvarSystem->GetCVarString( "net_serverDlTable" ) );
Tokenize( pakList, paks );
// 2: table of pak URLs
// 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
idStr reply = "2;";
idStrList dlTable, pakList;
int i, j;
for ( i = 0; i < pakList.Num(); i++ ) {
if ( i > 0 ) {
reply += ";";
}
if ( pakList[ i ][ 0 ] == '\0' ) {
if ( i == 0 ) {
// pak 0 will always miss when client doesn't ask for game bin
common->DPrintf( "no game pak request\n" );
} else {
common->DPrintf( "no pak %d\n", i );
}
continue;
}
for ( j = 0; j < dlTable.Num(); j++ ) {
if ( !fileSystem->FilenameCompare( pakList[ i ], dlTable[ j ] ) ) {
break;
}
}
if ( j == dlTable.Num() ) {
common->Printf( "download for %s: pak not matched: %s\n", IP, pakList[ i ].c_str() );
Tokenize( dlTable, cvarSystem->GetCVarString( "net_serverDlTable" ) );
Tokenize( pakList, paks );
for ( i = 0; i < pakList.Num(); i++ ) {
if ( i > 0 ) {
reply += ";";
}
if ( pakList[ i ][ 0 ] == '\0' ) {
if ( i == 0 ) {
// pak 0 will always miss when client doesn't ask for game bin
common->DPrintf( "no game pak request\n" );
} else {
idStr url = cvarSystem->GetCVarString( "net_serverDlBaseURL" );
url.AppendPath( dlTable[ j ] );
reply += url;
common->DPrintf( "download for %s: %s\n", IP, url.c_str() );
common->DPrintf( "no pak %d\n", i );
}
continue;
}
for ( j = 0; j < dlTable.Num(); j++ ) {
if ( !fileSystem->FilenameCompare( pakList[ i ], dlTable[ j ] ) ) {
break;
}
}
idStr::Copynz( urls, reply, MAX_STRING_CHARS );
return true;
if ( j == dlTable.Num() ) {
common->Printf( "download for %s: pak not matched: %s\n", IP, pakList[ i ].c_str() );
} else {
idStr url = cvarSystem->GetCVarString( "net_serverDlBaseURL" );
url.AppendPath( dlTable[ j ] );
reply += url;
common->DPrintf( "download for %s: %s\n", IP, url.c_str() );
}
}
return false;
idStr::Copynz( urls, reply, MAX_STRING_CHARS );
return true;
}
/*

View file

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

View file

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

View file

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

View file

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

View file

@ -7633,11 +7633,9 @@ bool idPlayer::CanGive( const char *statname, const char *value ) {
return false;
}
return true;
} else {
return inventory.CanGive( this, spawnArgs, statname, value, &idealWeapon );
}
return false;
return inventory.CanGive( this, spawnArgs, statname, value, &idealWeapon );
}
/*
@ -9817,13 +9815,13 @@ 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)
return true;
}
return idActor::ClientReceiveEvent( event, time, msg );
}
default: {
return idActor::ClientReceiveEvent( event, time, msg );
break;
}
default:
break;
}
return false;
return idActor::ClientReceiveEvent( event, time, msg );
}
/*

View file

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

View file

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

View file

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

View file

@ -863,21 +863,20 @@ bool idEntity::DoDormantTests( void ) {
return false;
}
return true;
} else {
// 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
if ( !fl.hasAwakened ) {
if ( !gameLocal.InPlayerPVS( this ) ) {
return true; // stay dormant
}
}
// wake up
dormantStart = 0;
fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS
return false;
}
// 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
if ( !fl.hasAwakened ) {
if ( !gameLocal.InPlayerPVS( this ) ) {
return true; // stay dormant
}
}
// wake up
dormantStart = 0;
fl.hasAwakened = true; // only go dormant when area closed off now, not just out of PVS
return false;
}
@ -4854,10 +4853,10 @@ bool idEntity::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
StopSound( channel, false );
return true;
}
default: {
return false;
}
default:
break;
}
return false;
}
@ -5297,11 +5296,11 @@ bool idAnimatedEntity::ClientReceiveEvent( int event, int time, const idBitMsg &
AddLocalDamageEffect( jointNum, localOrigin, localNormal, localDir, damageDef, collisionMaterial );
return true;
}
default: {
return idEntity::ClientReceiveEvent( event, time, msg );
}
default:
break;
}
return false;
return idEntity::ClientReceiveEvent( event, time, msg );
}
/*

View file

@ -1570,49 +1570,48 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
}
idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) );
return true;
} else {
// 2: table of pak URLs
// 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
idStr reply = "2;";
idStrList dlTable, pakList;
int i, j;
}
Tokenize( dlTable, cvarSystem->GetCVarString( "net_serverDlTable" ) );
Tokenize( pakList, paks );
// 2: table of pak URLs
// 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
idStr reply = "2;";
idStrList dlTable, pakList;
int i, j;
for ( i = 0; i < pakList.Num(); i++ ) {
if ( i > 0 ) {
reply += ";";
}
if ( pakList[ i ][ 0 ] == '\0' ) {
if ( i == 0 ) {
// pak 0 will always miss when client doesn't ask for game bin
common->DPrintf( "no game pak request\n" );
} else {
common->DPrintf( "no pak %d\n", i );
}
continue;
}
for ( j = 0; j < dlTable.Num(); j++ ) {
if ( !fileSystem->FilenameCompare( pakList[ i ], dlTable[ j ] ) ) {
break;
}
}
if ( j == dlTable.Num() ) {
common->Printf( "download for %s: pak not matched: %s\n", IP, pakList[ i ].c_str() );
Tokenize( dlTable, cvarSystem->GetCVarString( "net_serverDlTable" ) );
Tokenize( pakList, paks );
for ( i = 0; i < pakList.Num(); i++ ) {
if ( i > 0 ) {
reply += ";";
}
if ( pakList[ i ][ 0 ] == '\0' ) {
if ( i == 0 ) {
// pak 0 will always miss when client doesn't ask for game bin
common->DPrintf( "no game pak request\n" );
} else {
idStr url = cvarSystem->GetCVarString( "net_serverDlBaseURL" );
url.AppendPath( dlTable[ j ] );
reply += url;
common->DPrintf( "download for %s: %s\n", IP, url.c_str() );
common->DPrintf( "no pak %d\n", i );
}
continue;
}
for ( j = 0; j < dlTable.Num(); j++ ) {
if ( !fileSystem->FilenameCompare( pakList[ i ], dlTable[ j ] ) ) {
break;
}
}
idStr::Copynz( urls, reply, MAX_STRING_CHARS );
return true;
if ( j == dlTable.Num() ) {
common->Printf( "download for %s: pak not matched: %s\n", IP, pakList[ i ].c_str() );
} else {
idStr url = cvarSystem->GetCVarString( "net_serverDlBaseURL" );
url.AppendPath( dlTable[ j ] );
reply += url;
common->DPrintf( "download for %s: %s\n", IP, url.c_str() );
}
}
return false;
idStr::Copynz( urls, reply, MAX_STRING_CHARS );
return true;
}
/*

View file

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

View file

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

View file

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

View file

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

View file

@ -8263,13 +8263,13 @@ 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)
return true;
}
return idActor::ClientReceiveEvent( event, time, msg );
}
default: {
return idActor::ClientReceiveEvent( event, time, msg );
break;
}
default:
break;
}
return false;
return idActor::ClientReceiveEvent( event, time, msg );
}
/*

View file

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

View file

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

View file

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