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

View file

@ -932,21 +932,20 @@ 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 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; 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,11 +5508,11 @@ 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:
return idEntity::ClientReceiveEvent( event, time, msg ); 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" ) ); idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) );
return true; 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" ) ); // 2: table of pak URLs
Tokenize( pakList, paks ); // 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++ ) { Tokenize( dlTable, cvarSystem->GetCVarString( "net_serverDlTable" ) );
if ( i > 0 ) { Tokenize( pakList, paks );
reply += ";";
} for ( i = 0; i < pakList.Num(); i++ ) {
if ( pakList[ i ][ 0 ] == '\0' ) { if ( i > 0 ) {
if ( i == 0 ) { reply += ";";
// pak 0 will always miss when client doesn't ask for game bin }
common->DPrintf( "no game pak request\n" ); if ( pakList[ i ][ 0 ] == '\0' ) {
} else { if ( i == 0 ) {
common->DPrintf( "no pak %d\n", i ); // pak 0 will always miss when client doesn't ask for game bin
} common->DPrintf( "no game pak request\n" );
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() );
} else { } else {
idStr url = cvarSystem->GetCVarString( "net_serverDlBaseURL" ); common->DPrintf( "no pak %d\n", i );
url.AppendPath( dlTable[ j ] ); }
reply += url; continue;
common->DPrintf( "download for %s: %s\n", IP, url.c_str() ); }
for ( j = 0; j < dlTable.Num(); j++ ) {
if ( !fileSystem->FilenameCompare( pakList[ i ], dlTable[ j ] ) ) {
break;
} }
} }
if ( j == dlTable.Num() ) {
idStr::Copynz( urls, reply, MAX_STRING_CHARS ); common->Printf( "download for %s: pak not matched: %s\n", IP, pakList[ i ].c_str() );
return true; } 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(); Event_RespawnFx();
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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 ); BecomeBroken( NULL );
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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 ) { 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:
default: { break;
return idBarrel::ClientReceiveEvent( event, time, msg );
}
} }
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 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,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) // happens if the event and the spectate change are written on the server during the same frame (fraglimit)
return true; return true;
} }
return idActor::ClientReceiveEvent( event, time, msg ); break;
}
default: {
return idActor::ClientReceiveEvent( event, time, msg );
} }
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 ); DefaultDamageEffect( this, spawnArgs, collision, velocity );
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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 ); Shatter( point, dir, time );
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); break;
}
} }
return false;
return idEntity::ClientReceiveEvent( event, time, msg );
} }

View file

@ -863,21 +863,20 @@ 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 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; 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,11 +5296,11 @@ 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:
return idEntity::ClientReceiveEvent( event, time, msg ); 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" ) ); idStr::snPrintf( urls, MAX_STRING_CHARS, "1;%s", cvarSystem->GetCVarString( "si_serverURL" ) );
return true; 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" ) ); // 2: table of pak URLs
Tokenize( pakList, paks ); // 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++ ) { Tokenize( dlTable, cvarSystem->GetCVarString( "net_serverDlTable" ) );
if ( i > 0 ) { Tokenize( pakList, paks );
reply += ";";
} for ( i = 0; i < pakList.Num(); i++ ) {
if ( pakList[ i ][ 0 ] == '\0' ) { if ( i > 0 ) {
if ( i == 0 ) { reply += ";";
// pak 0 will always miss when client doesn't ask for game bin }
common->DPrintf( "no game pak request\n" ); if ( pakList[ i ][ 0 ] == '\0' ) {
} else { if ( i == 0 ) {
common->DPrintf( "no pak %d\n", i ); // pak 0 will always miss when client doesn't ask for game bin
} common->DPrintf( "no game pak request\n" );
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() );
} else { } else {
idStr url = cvarSystem->GetCVarString( "net_serverDlBaseURL" ); common->DPrintf( "no pak %d\n", i );
url.AppendPath( dlTable[ j ] ); }
reply += url; continue;
common->DPrintf( "download for %s: %s\n", IP, url.c_str() ); }
for ( j = 0; j < dlTable.Num(); j++ ) {
if ( !fileSystem->FilenameCompare( pakList[ i ], dlTable[ j ] ) ) {
break;
} }
} }
if ( j == dlTable.Num() ) {
idStr::Copynz( urls, reply, MAX_STRING_CHARS ); common->Printf( "download for %s: pak not matched: %s\n", IP, pakList[ i ].c_str() );
return true; } 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(); Event_RespawnFx();
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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 ); BecomeBroken( NULL );
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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 ) { 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:
default: { break;
return idBarrel::ClientReceiveEvent( event, time, msg );
}
} }
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) // happens if the event and the spectate change are written on the server during the same frame (fraglimit)
return true; return true;
} }
return idActor::ClientReceiveEvent( event, time, msg ); break;
}
default: {
return idActor::ClientReceiveEvent( event, time, msg );
} }
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 ); DefaultDamageEffect( this, spawnArgs, collision, velocity );
return true; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); 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; return true;
} }
default: { default:
return idEntity::ClientReceiveEvent( event, time, msg ); break;
}
} }
return false;
return idEntity::ClientReceiveEvent( event, time, msg );
} }
/*********************************************************************** /***********************************************************************

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 {