Fix -Wunused-but-set-variable warnings

variable set but not used

Removes some CollisionModel code under _DEBUG which was probably a
leftover, since it was completely useless (its done later anyways).
This commit is contained in:
dhewg 2011-12-02 19:54:23 +01:00 committed by Daniel Gibson
parent 6f0fc9fcc1
commit 74f7302c71
24 changed files with 27 additions and 93 deletions

View file

@ -814,9 +814,6 @@ idTeleporter::Event_DoAction
================
*/
void idTeleporter::Event_DoAction( idEntity *activator ) {
float angle;
angle = spawnArgs.GetFloat( "angle" );
idAngles a( 0, spawnArgs.GetFloat( "angle" ), 0 );
activator->Teleport( GetPhysics()->GetOrigin(), a, NULL );
}

View file

@ -3290,13 +3290,11 @@ idPlayer::UpdateConditions
*/
void idPlayer::UpdateConditions( void ) {
idVec3 velocity;
float fallspeed;
float forwardspeed;
float sidespeed;
// minus the push velocity to avoid playing the walking animation and sounds when riding a mover
velocity = physicsObj.GetLinearVelocity() - physicsObj.GetPushedLinearVelocity();
fallspeed = velocity * physicsObj.GetGravityNormal();
if ( influenceActive ) {
AI_FORWARD = false;
@ -5305,7 +5303,6 @@ void idPlayer::UpdateFocus( void ) {
idUserInterface *oldUI;
idAI *oldChar;
int oldTalkCursor;
idAFEntity_Vehicle *oldVehicle;
int i, j;
idVec3 start, end;
bool allowFocus;
@ -5332,7 +5329,6 @@ void idPlayer::UpdateFocus( void ) {
oldUI = focusUI;
oldChar = focusCharacter;
oldTalkCursor = talkCursor;
oldVehicle = focusVehicle;
if ( focusTime <= gameLocal.time ) {
ClearFocus();
@ -7712,11 +7708,10 @@ idPlayer::RouteGuiMouse
*/
void idPlayer::RouteGuiMouse( idUserInterface *gui ) {
sysEvent_t ev;
const char *command;
if ( usercmd.mx != oldMouseX || usercmd.my != oldMouseY ) {
ev = sys->GenerateMouseMoveEvent( usercmd.mx - oldMouseX, usercmd.my - oldMouseY );
command = gui->HandleEvent( &ev, gameLocal.time );
gui->HandleEvent( &ev, gameLocal.time );
oldMouseX = usercmd.mx;
oldMouseY = usercmd.my;
}

View file

@ -1756,7 +1756,6 @@ FullscreenFXManager::Process
*/
void FullscreenFXManager::Process( const renderView_t *view ) {
bool allpass = false;
bool atLeastOneFX = false;
if ( g_testFullscreenFX.GetInteger() == -2 ) {
allpass = true;
@ -1808,8 +1807,6 @@ void FullscreenFXManager::Process( const renderView_t *view ) {
// do the actual drawing
if ( drawIt ) {
atLeastOneFX = true;
// we need to dump to _currentRender
CaptureCurrentRender();

View file

@ -305,7 +305,6 @@ idProjectile::Launch
*/
void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3 &pushVelocity, const float timeSinceFire, const float launchPower, const float dmgPower ) {
float fuse;
float startthrust;
float endthrust;
idVec3 velocity;
idAngles angular_velocity;
@ -319,7 +318,6 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
idVec3 gravVec;
idVec3 tmp;
idMat3 axis;
int thrust_start;
int contents;
int clipMask;
@ -331,7 +329,6 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
}
thrust = spawnArgs.GetFloat( "thrust" );
startthrust = spawnArgs.GetFloat( "thrust_start" );
endthrust = spawnArgs.GetFloat( "thrust_end" );
spawnArgs.GetVector( "velocity", "0 0 0", velocity );
@ -359,7 +356,6 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
}
thrust *= mass;
thrust_start = SEC2MS( startthrust ) + gameLocal.time;
thrust_end = SEC2MS( endthrust ) + gameLocal.time;
lightStartTime = 0;

View file

@ -137,7 +137,7 @@ idAASLocal::WalkPathValid
============
*/
bool idAASLocal::WalkPathValid( int areaNum, const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin, int travelFlags, idVec3 &endPos, int &endAreaNum ) const {
int curAreaNum, lastAreaNum, lastAreas[4], lastAreaIndex;
int curAreaNum, lastAreas[4], lastAreaIndex;
idPlane pathPlane, frontPlane, farPlane;
idReachability *reach;
const aasArea_t *area;
@ -164,7 +164,6 @@ bool idAASLocal::WalkPathValid( int areaNum, const idVec3 &origin, int goalAreaN
farPlane.FitThroughPoint( goalOrigin );
curAreaNum = areaNum;
lastAreaNum = curAreaNum;
while ( 1 ) {

View file

@ -2707,16 +2707,12 @@ idAI::DeadMove
*/
void idAI::DeadMove( void ) {
idVec3 delta;
monsterMoveResult_t moveResult;
idVec3 org = physicsObj.GetOrigin();
GetMoveDelta( viewAxis, viewAxis, delta );
physicsObj.SetDelta( delta );
RunPhysics();
moveResult = physicsObj.GetMoveResult();
AI_ONGROUND = physicsObj.OnGround();
}
@ -2730,7 +2726,6 @@ void idAI::AnimMove( void ) {
idVec3 delta;
idVec3 goalDelta;
float goalDist;
monsterMoveResult_t moveResult;
idVec3 newDest;
idVec3 oldorigin = physicsObj.GetOrigin();
@ -2797,7 +2792,6 @@ void idAI::AnimMove( void ) {
gameRenderWorld->DebugLine( colorCyan, oldorigin, physicsObj.GetOrigin(), 5000 );
}
moveResult = physicsObj.GetMoveResult();
if ( !af_push_moveables && attack.Length() && TestMelee() ) {
DirectDamage( attack, enemy.GetEntity() );
} else {
@ -2852,11 +2846,9 @@ void idAI::SlideMove( void ) {
idVec3 delta;
idVec3 goalDelta;
float goalDist;
monsterMoveResult_t moveResult;
idVec3 newDest;
idVec3 oldorigin = physicsObj.GetOrigin();
idMat3 oldaxis = viewAxis;
AI_BLOCKED = false;
@ -2926,7 +2918,6 @@ void idAI::SlideMove( void ) {
gameRenderWorld->DebugLine( colorCyan, oldorigin, physicsObj.GetOrigin(), 5000 );
}
moveResult = physicsObj.GetMoveResult();
if ( !af_push_moveables && attack.Length() && TestMelee() ) {
DirectDamage( attack, enemy.GetEntity() );
} else {

View file

@ -526,14 +526,14 @@ idTestModel::TestAnim
void idTestModel::TestAnim( const idCmdArgs &args ) {
idStr name;
int animNum;
const idAnim *newanim;
//const idAnim *newanim;
if ( args.Argc() < 2 ) {
gameLocal.Printf( "usage: testanim <animname>\n" );
return;
}
newanim = NULL;
//newanim = NULL;
name = args.Argv( 1 );
#if 0

View file

@ -2009,7 +2009,6 @@ void idCompiler::ParseObjectDef( const char *objname ) {
const char *fieldname;
idTypeDef newtype( ev_field, NULL, "", 0, NULL );
idVarDef *oldscope;
int num;
int i;
oldscope = scope;
@ -2037,7 +2036,6 @@ void idCompiler::ParseObjectDef( const char *objname ) {
scope = objtype->def;
// inherit all the functions
num = parentType->NumFunctions();
for( i = 0; i < parentType->NumFunctions(); i++ ) {
const function_t *func = parentType->GetFunction( i );
objtype->AddFunction( func );
@ -2114,7 +2112,6 @@ idCompiler::ParseFunctionDef
void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
idTypeDef *type;
idVarDef *def;
const idVarDef *parm;
idVarDef *oldscope;
int i;
int numParms;
@ -2169,7 +2166,7 @@ void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
if ( gameLocal.program.GetDef( type->GetParmType( i ), type->GetParmName( i ), def ) ) {
Error( "'%s' defined more than once in function parameters", type->GetParmName( i ) );
}
parm = gameLocal.program.AllocDef( type->GetParmType( i ), type->GetParmName( i ), def, false );
gameLocal.program.AllocDef( type->GetParmType( i ), type->GetParmName( i ), def, false );
}
oldscope = scope;

View file

@ -1718,7 +1718,6 @@ called after all files are compiled to report memory usage.
void idProgram::CompileStats( void ) {
int memused;
int memallocated;
int numdefs;
int stringspace;
int funcMem;
int i;
@ -1733,7 +1732,6 @@ void idProgram::CompileStats( void ) {
}
stringspace += fileList.Size();
numdefs = varDefs.Num();
memused = varDefs.Num() * sizeof( idVarDef );
memused += types.Num() * sizeof( idTypeDef );
memused += stringspace;

View file

@ -945,9 +945,6 @@ idThread::Event_TerminateThread
================
*/
void idThread::Event_TerminateThread( int num ) {
idThread *thread;
thread = GetThread( num );
KillThread( num );
}

View file

@ -784,9 +784,6 @@ idTeleporter::Event_DoAction
================
*/
void idTeleporter::Event_DoAction( idEntity *activator ) {
float angle;
angle = spawnArgs.GetFloat( "angle" );
idAngles a( 0, spawnArgs.GetFloat( "angle" ), 0 );
activator->Teleport( GetPhysics()->GetOrigin(), a, NULL );
}

View file

@ -2695,13 +2695,11 @@ idPlayer::UpdateConditions
*/
void idPlayer::UpdateConditions( void ) {
idVec3 velocity;
float fallspeed;
float forwardspeed;
float sidespeed;
// minus the push velocity to avoid playing the walking animation and sounds when riding a mover
velocity = physicsObj.GetLinearVelocity() - physicsObj.GetPushedLinearVelocity();
fallspeed = velocity * physicsObj.GetGravityNormal();
if ( influenceActive ) {
AI_FORWARD = false;
@ -4335,7 +4333,6 @@ void idPlayer::UpdateFocus( void ) {
idUserInterface *oldUI;
idAI *oldChar;
int oldTalkCursor;
idAFEntity_Vehicle *oldVehicle;
int i, j;
idVec3 start, end;
bool allowFocus;
@ -4362,7 +4359,6 @@ void idPlayer::UpdateFocus( void ) {
oldUI = focusUI;
oldChar = focusCharacter;
oldTalkCursor = talkCursor;
oldVehicle = focusVehicle;
if ( focusTime <= gameLocal.time ) {
ClearFocus();
@ -6403,11 +6399,10 @@ idPlayer::RouteGuiMouse
*/
void idPlayer::RouteGuiMouse( idUserInterface *gui ) {
sysEvent_t ev;
const char *command;
if ( usercmd.mx != oldMouseX || usercmd.my != oldMouseY ) {
ev = sys->GenerateMouseMoveEvent( usercmd.mx - oldMouseX, usercmd.my - oldMouseY );
command = gui->HandleEvent( &ev, gameLocal.time );
gui->HandleEvent( &ev, gameLocal.time );
oldMouseX = usercmd.mx;
oldMouseY = usercmd.my;
}

View file

@ -274,7 +274,6 @@ idProjectile::Launch
*/
void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3 &pushVelocity, const float timeSinceFire, const float launchPower, const float dmgPower ) {
float fuse;
float startthrust;
float endthrust;
idVec3 velocity;
idAngles angular_velocity;
@ -288,7 +287,6 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
idVec3 gravVec;
idVec3 tmp;
idMat3 axis;
int thrust_start;
int contents;
int clipMask;
@ -300,7 +298,6 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
}
thrust = spawnArgs.GetFloat( "thrust" );
startthrust = spawnArgs.GetFloat( "thrust_start" );
endthrust = spawnArgs.GetFloat( "thrust_end" );
spawnArgs.GetVector( "velocity", "0 0 0", velocity );
@ -328,7 +325,6 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
}
thrust *= mass;
thrust_start = SEC2MS( startthrust ) + gameLocal.time;
thrust_end = SEC2MS( endthrust ) + gameLocal.time;
lightStartTime = 0;

View file

@ -137,7 +137,7 @@ idAASLocal::WalkPathValid
============
*/
bool idAASLocal::WalkPathValid( int areaNum, const idVec3 &origin, int goalAreaNum, const idVec3 &goalOrigin, int travelFlags, idVec3 &endPos, int &endAreaNum ) const {
int curAreaNum, lastAreaNum, lastAreas[4], lastAreaIndex;
int curAreaNum, lastAreas[4], lastAreaIndex;
idPlane pathPlane, frontPlane, farPlane;
idReachability *reach;
const aasArea_t *area;
@ -164,7 +164,6 @@ bool idAASLocal::WalkPathValid( int areaNum, const idVec3 &origin, int goalAreaN
farPlane.FitThroughPoint( goalOrigin );
curAreaNum = areaNum;
lastAreaNum = curAreaNum;
while ( 1 ) {

View file

@ -2625,16 +2625,12 @@ idAI::DeadMove
*/
void idAI::DeadMove( void ) {
idVec3 delta;
monsterMoveResult_t moveResult;
idVec3 org = physicsObj.GetOrigin();
GetMoveDelta( viewAxis, viewAxis, delta );
physicsObj.SetDelta( delta );
RunPhysics();
moveResult = physicsObj.GetMoveResult();
AI_ONGROUND = physicsObj.OnGround();
}
@ -2648,7 +2644,6 @@ void idAI::AnimMove( void ) {
idVec3 delta;
idVec3 goalDelta;
float goalDist;
monsterMoveResult_t moveResult;
idVec3 newDest;
idVec3 oldorigin = physicsObj.GetOrigin();
@ -2712,7 +2707,6 @@ void idAI::AnimMove( void ) {
gameRenderWorld->DebugLine( colorCyan, oldorigin, physicsObj.GetOrigin(), 5000 );
}
moveResult = physicsObj.GetMoveResult();
if ( !af_push_moveables && attack.Length() && TestMelee() ) {
DirectDamage( attack, enemy.GetEntity() );
} else {
@ -2767,11 +2761,9 @@ void idAI::SlideMove( void ) {
idVec3 delta;
idVec3 goalDelta;
float goalDist;
monsterMoveResult_t moveResult;
idVec3 newDest;
idVec3 oldorigin = physicsObj.GetOrigin();
idMat3 oldaxis = viewAxis;
AI_BLOCKED = false;
@ -2841,7 +2833,6 @@ void idAI::SlideMove( void ) {
gameRenderWorld->DebugLine( colorCyan, oldorigin, physicsObj.GetOrigin(), 5000 );
}
moveResult = physicsObj.GetMoveResult();
if ( !af_push_moveables && attack.Length() && TestMelee() ) {
DirectDamage( attack, enemy.GetEntity() );
} else {

View file

@ -526,17 +526,16 @@ idTestModel::TestAnim
void idTestModel::TestAnim( const idCmdArgs &args ) {
idStr name;
int animNum;
const idAnim *newanim;
if ( args.Argc() < 2 ) {
gameLocal.Printf( "usage: testanim <animname>\n" );
return;
}
newanim = NULL;
name = args.Argv( 1 );
#if 0
const idAnim *newanim = NULL;
if ( strstr( name, ".ma" ) || strstr( name, ".mb" ) ) {
const idMD5Anim *md5anims[ ANIM_MaxSyncedAnims ];
idModelExport exporter;

View file

@ -2009,7 +2009,6 @@ void idCompiler::ParseObjectDef( const char *objname ) {
const char *fieldname;
idTypeDef newtype( ev_field, NULL, "", 0, NULL );
idVarDef *oldscope;
int num;
int i;
oldscope = scope;
@ -2037,7 +2036,6 @@ void idCompiler::ParseObjectDef( const char *objname ) {
scope = objtype->def;
// inherit all the functions
num = parentType->NumFunctions();
for( i = 0; i < parentType->NumFunctions(); i++ ) {
const function_t *func = parentType->GetFunction( i );
objtype->AddFunction( func );
@ -2114,7 +2112,6 @@ idCompiler::ParseFunctionDef
void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
idTypeDef *type;
idVarDef *def;
const idVarDef *parm;
idVarDef *oldscope;
int i;
int numParms;
@ -2169,7 +2166,7 @@ void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
if ( gameLocal.program.GetDef( type->GetParmType( i ), type->GetParmName( i ), def ) ) {
Error( "'%s' defined more than once in function parameters", type->GetParmName( i ) );
}
parm = gameLocal.program.AllocDef( type->GetParmType( i ), type->GetParmName( i ), def, false );
gameLocal.program.AllocDef( type->GetParmType( i ), type->GetParmName( i ), def, false );
}
oldscope = scope;

View file

@ -1718,7 +1718,6 @@ called after all files are compiled to report memory usage.
void idProgram::CompileStats( void ) {
int memused;
int memallocated;
int numdefs;
int stringspace;
int funcMem;
int i;
@ -1733,7 +1732,6 @@ void idProgram::CompileStats( void ) {
}
stringspace += fileList.Size();
numdefs = varDefs.Num();
memused = varDefs.Num() * sizeof( idVarDef );
memused += types.Num() * sizeof( idTypeDef );
memused += stringspace;

View file

@ -923,9 +923,6 @@ idThread::Event_TerminateThread
================
*/
void idThread::Event_TerminateThread( int num ) {
idThread *thread;
thread = GetThread( num );
KillThread( num );
}

View file

@ -46,10 +46,8 @@ StringCRC
*/
ID_INLINE unsigned int StringCRC( const char *str ) {
unsigned int i, crc;
const unsigned char *ptr;
crc = 0;
ptr = reinterpret_cast<const unsigned char*>(str);
for ( i = 0; str[i]; i++ ) {
crc ^= str[i] << (i & 3);
}
@ -407,8 +405,7 @@ idMapBrush::ParseQ3
=================
*/
idMapBrush *idMapBrush::ParseQ3( idLexer &src, const idVec3 &origin ) {
int i, shift[2], rotate;
float scale[2];
int i;
idVec3 planepts[3];
idToken token;
idList<idMapBrushSide*> sides;
@ -448,12 +445,12 @@ idMapBrush *idMapBrush::ParseQ3( idLexer &src, const idVec3 &origin ) {
// we have an implicit 'textures/' in the old format
side->material = "textures/" + token;
// read the texture shift, rotate and scale
shift[0] = src.ParseInt();
shift[1] = src.ParseInt();
rotate = src.ParseInt();
scale[0] = src.ParseFloat();
scale[1] = src.ParseFloat();
// skip the texture shift, rotate and scale
src.ParseInt();
src.ParseInt();
src.ParseInt();
src.ParseFloat();
src.ParseFloat();
side->texMat[0] = idVec3( 0.03125f, 0.0f, 0.0f );
side->texMat[1] = idVec3( 0.0f, 0.03125f, 0.0f );
side->origin = origin;

View file

@ -1377,7 +1377,6 @@ int idParser::EvaluateTokens( idToken *tokens, signed long int *intvalue, double
int questmarkintvalue = 0;
double questmarkfloatvalue = 0;
int gotquestmarkvalue = false;
int lastoperatortype = 0;
//
operator_t operator_heap[MAX_OPERATORS];
int numoperators = 0;
@ -1736,7 +1735,6 @@ int idParser::EvaluateTokens( idToken *tokens, signed long int *intvalue, double
#endif //DEBUG_EVAL
if (error)
break;
lastoperatortype = o->op;
//if not an operator with arity 1
if (o->op != P_LOGIC_NOT && o->op != P_BIN_NOT) {
//remove the second value if not question mark operator

View file

@ -149,7 +149,6 @@ int idWinding2D::Split( const idVec3 &plane, const float epsilon, idWinding2D **
idVec2 mid;
idWinding2D * f;
idWinding2D * b;
int maxpts;
counts[0] = counts[1] = counts[2] = 0;
@ -181,8 +180,6 @@ int idWinding2D::Split( const idVec3 &plane, const float epsilon, idWinding2D **
return SIDE_FRONT;
}
maxpts = numPoints+4; // cant use counts[0]+2 because of fp grouping errors
*front = f = new idWinding2D;
*back = b = new idWinding2D;

View file

@ -5392,7 +5392,7 @@ idMatX::Cholesky_UpdateRowColumn
bool idMatX::Cholesky_UpdateRowColumn( const idVecX &v, int r ) {
int i, j;
double sum;
float *original, *y;
float *original;
idVecX addSub;
assert( numRows == numColumns );
@ -5421,7 +5421,6 @@ bool idMatX::Cholesky_UpdateRowColumn( const idVecX &v, int r ) {
} else {
original = (float *) _alloca16( numColumns * sizeof( float ) );
y = (float *) _alloca16( numColumns * sizeof( float ) );
// calculate original row/column of matrix
for ( i = 0; i < numRows; i++ ) {

View file

@ -2616,8 +2616,11 @@ void VPCALL idSIMD_Generic::DeriveUnsmoothedTangents( idDrawVert *verts, const d
for ( i = 0; i < numVerts; i++ ) {
idDrawVert *a, *b, *c;
float d0, d1, d2, d3, d4;
float d5, d6, d7, d8, d9;
#ifndef DERIVE_UNSMOOTHED_BITANGENT
float d3, d8;
#endif
float d0, d1, d2, d4;
float d5, d6, d7, d9;
float s0, s1, s2;
float n0, n1, n2;
float t0, t1, t2;
@ -2632,13 +2635,17 @@ void VPCALL idSIMD_Generic::DeriveUnsmoothedTangents( idDrawVert *verts, const d
d0 = b->xyz[0] - a->xyz[0];
d1 = b->xyz[1] - a->xyz[1];
d2 = b->xyz[2] - a->xyz[2];
#ifndef DERIVE_UNSMOOTHED_BITANGENT
d3 = b->st[0] - a->st[0];
#endif
d4 = b->st[1] - a->st[1];
d5 = c->xyz[0] - a->xyz[0];
d6 = c->xyz[1] - a->xyz[1];
d7 = c->xyz[2] - a->xyz[2];
#ifndef DERIVE_UNSMOOTHED_BITANGENT
d8 = c->st[0] - a->st[0];
#endif
d9 = c->st[1] - a->st[1];
s0 = dt.normalizationScale[0];