Fix -Wunused-variable warnings

unused variable
This commit is contained in:
dhewg 2011-12-02 17:22:12 +01:00 committed by Daniel Gibson
parent d72b17f3a2
commit 6f0fc9fcc1
30 changed files with 47 additions and 89 deletions

View file

@ -2616,7 +2616,6 @@ idEntity::RunPhysics
bool idEntity::RunPhysics( void ) {
int i, reachedTime, startTime, endTime;
idEntity * part, *blockedPart, *blockingEntity;
trace_t results;
bool moved;
// don't run physics if not enabled

View file

@ -31,6 +31,13 @@ If you have questions concerning this license or the applicable additional terms
#include "Game_local.h"
const int NUM_RENDER_PORTAL_BITS = idMath::BitsForInteger( PS_BLOCK_ALL );
const float DEFAULT_GRAVITY = 1066.0f;
const idVec3 DEFAULT_GRAVITY_VEC3( 0, 0, -DEFAULT_GRAVITY );
const int CINEMATIC_SKIP_DELAY = SEC2MS( 2.0f );
#ifdef GAME_DLL
idSys * sys = NULL;
@ -4763,8 +4770,6 @@ idGameLocal::SelectTimeGroup
============
*/
void idGameLocal::SelectTimeGroup( int timeGroup ) {
int i = 0;
if ( timeGroup ) {
fast.Get( time, previousTime, msec, framenum, realClientTime );
} else {

View file

@ -110,10 +110,11 @@ void gameError( const char *fmt, ... );
//============================================================================
const int MAX_GAME_MESSAGE_SIZE = 8192;
const int MAX_ENTITY_STATE_SIZE = 512;
const int ENTITY_PVS_SIZE = ((MAX_GENTITIES+31)>>5);
const int NUM_RENDER_PORTAL_BITS = idMath::BitsForInteger( PS_BLOCK_ALL );
#define MAX_GAME_MESSAGE_SIZE 8192
#define MAX_ENTITY_STATE_SIZE 512
#define ENTITY_PVS_SIZE ((MAX_GENTITIES+31)>>5)
extern const int NUM_RENDER_PORTAL_BITS;
typedef struct entityState_s {
int entityNumber;
@ -741,11 +742,10 @@ typedef enum {
#define MASK_SHOT_RENDERMODEL (CONTENTS_SOLID|CONTENTS_RENDERMODEL)
#define MASK_SHOT_BOUNDINGBOX (CONTENTS_SOLID|CONTENTS_BODY)
const float DEFAULT_GRAVITY = 1066.0f;
#define DEFAULT_GRAVITY_STRING "1066"
const idVec3 DEFAULT_GRAVITY_VEC3( 0, 0, -DEFAULT_GRAVITY );
const int CINEMATIC_SKIP_DELAY = SEC2MS( 2.0f );
extern const float DEFAULT_GRAVITY;
extern const idVec3 DEFAULT_GRAVITY_VEC3;
extern const int CINEMATIC_SKIP_DELAY;
//============================================================================

View file

@ -31,6 +31,8 @@ If you have questions concerning this license or the applicable additional terms
#include "Game_local.h"
const int ASYNC_PLAYER_INV_AMMO_BITS = idMath::BitsForInteger( 999 ); // 9 bits to cover the range [0, 999]
const int ASYNC_PLAYER_INV_CLIP_BITS = -7; // -7 bits to cover the range [-1, 60]
/*
===============================================================================
@ -8181,7 +8183,6 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
damage = 1;
}
int oldHealth = health;
health -= damage;
if ( health <= 0 ) {

View file

@ -70,8 +70,8 @@ const int DEATH_VOLUME = 15; // volume at death
const int SAVING_THROW_TIME = 5000; // maximum one "saving throw" every five seconds
const int ASYNC_PLAYER_INV_AMMO_BITS = idMath::BitsForInteger( 999 ); // 9 bits to cover the range [0, 999]
const int ASYNC_PLAYER_INV_CLIP_BITS = -7; // -7 bits to cover the range [-1, 60]
extern const int ASYNC_PLAYER_INV_AMMO_BITS;
extern const int ASYNC_PLAYER_INV_CLIP_BITS;
struct idItemInfo {
idStr name;

View file

@ -924,7 +924,6 @@ void idTarget_SetInfluence::Event_GatherEntities() {
int i, listedEntities;
idEntity *entityList[ MAX_GENTITIES ];
bool demonicOnly = spawnArgs.GetBool( "effect_demonic" );
bool lights = spawnArgs.GetBool( "effect_lights" );
bool sounds = spawnArgs.GetBool( "effect_sounds" );
bool guis = spawnArgs.GetBool( "effect_guis" );
@ -1794,7 +1793,6 @@ idTarget_FadeSoundClass::Event_RestoreVolume
void idTarget_FadeSoundClass::Event_RestoreVolume() {
float fadeTime = spawnArgs.GetFloat( "fadeTime" );
float fadeDB = spawnArgs.GetFloat( "fadeDB" );
int fadeClass = spawnArgs.GetInt( "fadeClass" );
// restore volume
gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime );
}

View file

@ -1253,7 +1253,6 @@ void idTrigger_Flag::Spawn( void ) {
void idTrigger_Flag::Event_Touch( idEntity *other, trace_t *trace ) {
bool bTrigger = false;
idItemTeam * flag = NULL;
if ( player ) {

View file

@ -3299,7 +3299,6 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
#ifdef _D3XP
int ammoAvail = owner->inventory.HasAmmo( ammoType, ammoRequired );
if ( ( clipSize != 0 ) && ( ammoClip <= 0 ) ) {
return;
}
@ -3500,7 +3499,6 @@ void idWeapon::Event_LaunchProjectilesEllipse( int num_projectiles, float spread
// avoid all ammo considerations on a client
if ( !gameLocal.isClient ) {
int ammoAvail = owner->inventory.HasAmmo( ammoType, ammoRequired );
if ( ( clipSize != 0 ) && ( ammoClip <= 0 ) ) {
return;
}

View file

@ -70,16 +70,6 @@ void idAASLocal::DrawReachability( const idReachability *reach ) const {
if ( gameLocal.GetLocalPlayer() ) {
gameRenderWorld->DrawText( va( "%d", reach->edgeNum ), ( reach->start + reach->end ) * 0.5f, 0.1f, colorWhite, gameLocal.GetLocalPlayer()->viewAxis );
}
switch( reach->travelType ) {
case TFL_WALK: {
const idReachability_Walk *walk = static_cast<const idReachability_Walk *>(reach);
break;
}
default: {
break;
}
}
}
/*

View file

@ -1513,7 +1513,6 @@ float idAI::TravelDistance( const idVec3 &start, const idVec3 &end ) const {
int toArea;
float dist;
idVec2 delta;
aasPath_t path;
if ( !aas ) {
// no aas, so just take the straight line distance
@ -3874,7 +3873,6 @@ void idAI::UpdateEnemyPosition( void ) {
int enemyAreaNum;
int areaNum;
aasPath_t path;
predictedPath_t predictedPath;
idVec3 enemyPos;
bool onGround;

View file

@ -1792,7 +1792,6 @@ idAI::Event_TestChargeAttack
=====================
*/
void idAI::Event_TestChargeAttack( void ) {
trace_t trace;
idActor *enemyEnt = enemy.GetEntity();
predictedPath_t path;
idVec3 end;

View file

@ -68,10 +68,6 @@ typedef struct {
} classTypeInfo_t;
static constantInfo_t constantInfo[] = {
{ NULL, NULL, NULL }
};
static enumTypeInfo_t enumTypeInfo[] = {
{ NULL, NULL }
};

View file

@ -7904,10 +7904,10 @@ const float AF_VELOCITY_MAX = 16000;
const int AF_VELOCITY_TOTAL_BITS = 16;
const int AF_VELOCITY_EXPONENT_BITS = idMath::BitsForInteger( idMath::BitsForFloat( AF_VELOCITY_MAX ) ) + 1;
const int AF_VELOCITY_MANTISSA_BITS = AF_VELOCITY_TOTAL_BITS - 1 - AF_VELOCITY_EXPONENT_BITS;
const float AF_FORCE_MAX = 1e20f;
const int AF_FORCE_TOTAL_BITS = 16;
const int AF_FORCE_EXPONENT_BITS = idMath::BitsForInteger( idMath::BitsForFloat( AF_FORCE_MAX ) ) + 1;
const int AF_FORCE_MANTISSA_BITS = AF_FORCE_TOTAL_BITS - 1 - AF_FORCE_EXPONENT_BITS;
//const float AF_FORCE_MAX = 1e20f;
//const int AF_FORCE_TOTAL_BITS = 16;
//const int AF_FORCE_EXPONENT_BITS = idMath::BitsForInteger( idMath::BitsForFloat( AF_FORCE_MAX ) ) + 1;
//const int AF_FORCE_MANTISSA_BITS = AF_FORCE_TOTAL_BITS - 1 - AF_FORCE_EXPONENT_BITS;
/*
================

View file

@ -823,7 +823,6 @@ void idPhysics_Player::SpectatorMove( void ) {
idVec3 wishdir;
float scale;
trace_t trace;
idVec3 end;
// fly movement

View file

@ -800,9 +800,6 @@ int idPush::TryRotatePushEntity( trace_t &results, idEntity *check, idClipModel
SaveEntityPosition( check );
newRotation.Set( rotation.GetOrigin(), rotation.GetVec(), checkAngle );
// NOTE: this code prevents msvc 6.0 & 7.0 from screwing up the above code in
// release builds moving less floats than it should
static float shit = checkAngle;
newRotation.RotatePoint( rotationPoint );

View file

@ -2524,7 +2524,6 @@ idEntity::RunPhysics
bool idEntity::RunPhysics( void ) {
int i, reachedTime, startTime, endTime;
idEntity * part, *blockedPart, *blockingEntity;
trace_t results;
bool moved;
// don't run physics if not enabled

View file

@ -31,6 +31,12 @@ If you have questions concerning this license or the applicable additional terms
#include "Game_local.h"
const int NUM_RENDER_PORTAL_BITS = idMath::BitsForInteger( PS_BLOCK_ALL );
const float DEFAULT_GRAVITY = 1066.0f;
const idVec3 DEFAULT_GRAVITY_VEC3( 0, 0, -DEFAULT_GRAVITY );
const int CINEMATIC_SKIP_DELAY = SEC2MS( 2.0f );
#ifdef GAME_DLL
idSys * sys = NULL;

View file

@ -110,10 +110,11 @@ void gameError( const char *fmt, ... );
//============================================================================
const int MAX_GAME_MESSAGE_SIZE = 8192;
const int MAX_ENTITY_STATE_SIZE = 512;
const int ENTITY_PVS_SIZE = ((MAX_GENTITIES+31)>>5);
const int NUM_RENDER_PORTAL_BITS = idMath::BitsForInteger( PS_BLOCK_ALL );
#define MAX_GAME_MESSAGE_SIZE 8192
#define MAX_ENTITY_STATE_SIZE 512
#define ENTITY_PVS_SIZE ((MAX_GENTITIES+31)>>5)
extern const int NUM_RENDER_PORTAL_BITS;
typedef struct entityState_s {
int entityNumber;
@ -682,11 +683,10 @@ typedef enum {
#define MASK_SHOT_RENDERMODEL (CONTENTS_SOLID|CONTENTS_RENDERMODEL)
#define MASK_SHOT_BOUNDINGBOX (CONTENTS_SOLID|CONTENTS_BODY)
const float DEFAULT_GRAVITY = 1066.0f;
#define DEFAULT_GRAVITY_STRING "1066"
const idVec3 DEFAULT_GRAVITY_VEC3( 0, 0, -DEFAULT_GRAVITY );
const int CINEMATIC_SKIP_DELAY = SEC2MS( 2.0f );
extern const float DEFAULT_GRAVITY;
extern const idVec3 DEFAULT_GRAVITY_VEC3;
extern const int CINEMATIC_SKIP_DELAY;
//============================================================================

View file

@ -31,6 +31,9 @@ If you have questions concerning this license or the applicable additional terms
#include "Game_local.h"
const int ASYNC_PLAYER_INV_AMMO_BITS = idMath::BitsForInteger( 999 ); // 9 bits to cover the range [0, 999]
const int ASYNC_PLAYER_INV_CLIP_BITS = -7; // -7 bits to cover the range [-1, 60]
/*
===============================================================================
@ -6816,7 +6819,6 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
damage = 1;
}
int oldHealth = health;
health -= damage;
if ( health <= 0 ) {

View file

@ -66,8 +66,8 @@ const int DEATH_VOLUME = 15; // volume at death
const int SAVING_THROW_TIME = 5000; // maximum one "saving throw" every five seconds
const int ASYNC_PLAYER_INV_AMMO_BITS = idMath::BitsForInteger( 999 ); // 9 bits to cover the range [0, 999]
const int ASYNC_PLAYER_INV_CLIP_BITS = -7; // -7 bits to cover the range [-1, 60]
extern const int ASYNC_PLAYER_INV_AMMO_BITS;
extern const int ASYNC_PLAYER_INV_CLIP_BITS;
struct idItemInfo {
idStr name;

View file

@ -904,7 +904,6 @@ void idTarget_SetInfluence::Event_GatherEntities() {
int i, listedEntities;
idEntity *entityList[ MAX_GENTITIES ];
bool demonicOnly = spawnArgs.GetBool( "effect_demonic" );
bool lights = spawnArgs.GetBool( "effect_lights" );
bool sounds = spawnArgs.GetBool( "effect_sounds" );
bool guis = spawnArgs.GetBool( "effect_guis" );
@ -1758,7 +1757,6 @@ idTarget_FadeSoundClass::Event_RestoreVolume
void idTarget_FadeSoundClass::Event_RestoreVolume() {
float fadeTime = spawnArgs.GetFloat( "fadeTime" );
float fadeDB = spawnArgs.GetFloat( "fadeDB" );
int fadeClass = spawnArgs.GetInt( "fadeClass" );
// restore volume
gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime );
}

View file

@ -70,16 +70,6 @@ void idAASLocal::DrawReachability( const idReachability *reach ) const {
if ( gameLocal.GetLocalPlayer() ) {
gameRenderWorld->DrawText( va( "%d", reach->edgeNum ), ( reach->start + reach->end ) * 0.5f, 0.1f, colorWhite, gameLocal.GetLocalPlayer()->viewAxis );
}
switch( reach->travelType ) {
case TFL_WALK: {
const idReachability_Walk *walk = static_cast<const idReachability_Walk *>(reach);
break;
}
default: {
break;
}
}
}
/*

View file

@ -1431,7 +1431,6 @@ float idAI::TravelDistance( const idVec3 &start, const idVec3 &end ) const {
int toArea;
float dist;
idVec2 delta;
aasPath_t path;
if ( !aas ) {
// no aas, so just take the straight line distance
@ -3758,7 +3757,6 @@ void idAI::UpdateEnemyPosition( void ) {
int enemyAreaNum;
int areaNum;
aasPath_t path;
predictedPath_t predictedPath;
idVec3 enemyPos;
bool onGround;

View file

@ -1643,7 +1643,6 @@ idAI::Event_TestChargeAttack
=====================
*/
void idAI::Event_TestChargeAttack( void ) {
trace_t trace;
idActor *enemyEnt = enemy.GetEntity();
predictedPath_t path;
idVec3 end;

View file

@ -68,10 +68,6 @@ typedef struct {
} classTypeInfo_t;
static constantInfo_t constantInfo[] = {
{ NULL, NULL, NULL }
};
static enumTypeInfo_t enumTypeInfo[] = {
{ NULL, NULL }
};

View file

@ -7903,10 +7903,10 @@ const float AF_VELOCITY_MAX = 16000;
const int AF_VELOCITY_TOTAL_BITS = 16;
const int AF_VELOCITY_EXPONENT_BITS = idMath::BitsForInteger( idMath::BitsForFloat( AF_VELOCITY_MAX ) ) + 1;
const int AF_VELOCITY_MANTISSA_BITS = AF_VELOCITY_TOTAL_BITS - 1 - AF_VELOCITY_EXPONENT_BITS;
const float AF_FORCE_MAX = 1e20f;
const int AF_FORCE_TOTAL_BITS = 16;
const int AF_FORCE_EXPONENT_BITS = idMath::BitsForInteger( idMath::BitsForFloat( AF_FORCE_MAX ) ) + 1;
const int AF_FORCE_MANTISSA_BITS = AF_FORCE_TOTAL_BITS - 1 - AF_FORCE_EXPONENT_BITS;
//const float AF_FORCE_MAX = 1e20f;
//const int AF_FORCE_TOTAL_BITS = 16;
//const int AF_FORCE_EXPONENT_BITS = idMath::BitsForInteger( idMath::BitsForFloat( AF_FORCE_MAX ) ) + 1;
//const int AF_FORCE_MANTISSA_BITS = AF_FORCE_TOTAL_BITS - 1 - AF_FORCE_EXPONENT_BITS;
/*
================

View file

@ -823,7 +823,6 @@ void idPhysics_Player::SpectatorMove( void ) {
idVec3 wishdir;
float scale;
trace_t trace;
idVec3 end;
// fly movement

View file

@ -800,9 +800,6 @@ int idPush::TryRotatePushEntity( trace_t &results, idEntity *check, idClipModel
SaveEntityPosition( check );
newRotation.Set( rotation.GetOrigin(), rotation.GetVec(), checkAngle );
// NOTE: this code prevents msvc 6.0 & 7.0 from screwing up the above code in
// release builds moving less floats than it should
static float shit = checkAngle;
newRotation.RotatePoint( rotationPoint );

View file

@ -333,7 +333,7 @@ idCurve::SetConstantSpeed
*/
template< class type >
ID_INLINE void idCurve<type>::SetConstantSpeed( const float totalTime ) {
int i, j;
int i;
float *length, totalLength, scale, t;
length = (float *) _alloca16( values.Num() * sizeof( float ) );
@ -777,7 +777,6 @@ idCurve_QuadraticBezier::BasisSecondDerivative
*/
template< class type >
ID_INLINE void idCurve_QuadraticBezier<type>::BasisSecondDerivative( const float t, float *bvals ) const {
float s1 = (float) ( t - this->times[0] ) / ( this->times[2] - this->times[0] );
bvals[0] = 2.0f;
bvals[1] = -4.0f;
bvals[2] = 2.0f;

View file

@ -3124,8 +3124,6 @@ void TestGetTextureSpaceLightVectors( void ) {
int i, j;
TIME_TYPE start, end, bestClocksGeneric, bestClocksSIMD;
ALIGN16( idDrawVert drawVerts[COUNT] );
ALIGN16( idVec4 texCoords1[COUNT] );
ALIGN16( idVec4 texCoords2[COUNT] );
ALIGN16( int indexes[COUNT*3] );
ALIGN16( idVec3 lightVectors1[COUNT] );
ALIGN16( idVec3 lightVectors2[COUNT] );
@ -3191,8 +3189,6 @@ void TestGetSpecularTextureCoords( void ) {
ALIGN16( idVec4 texCoords1[COUNT] );
ALIGN16( idVec4 texCoords2[COUNT] );
ALIGN16( int indexes[COUNT*3] );
ALIGN16( idVec3 lightVectors1[COUNT] );
ALIGN16( idVec3 lightVectors2[COUNT] );
idVec3 lightOrigin, viewOrigin;
const char *result;