From be40e9d6618c67569958d6591bceebca07244eb6 Mon Sep 17 00:00:00 2001 From: dhewg Date: Tue, 6 Dec 2011 19:13:18 +0100 Subject: [PATCH] Mark unused variables in a non-debug build as such Variables which are only used in assert(). --- neo/d3xp/Game_local.cpp | 2 +- neo/d3xp/Game_network.cpp | 4 ++-- neo/d3xp/physics/Physics_AF.cpp | 4 ++-- neo/d3xp/physics/Physics_StaticMulti.cpp | 2 +- neo/framework/DeclManager.cpp | 2 +- neo/framework/async/MsgChannel.cpp | 2 +- neo/game/Game_local.cpp | 2 +- neo/game/Game_network.cpp | 4 ++-- neo/game/physics/Physics_AF.cpp | 4 ++-- neo/idlib/math/Matrix.h | 24 ++++++++++++------------ neo/idlib/math/Polynomial.cpp | 2 +- neo/renderer/tr_trisurf.cpp | 6 +++--- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/neo/d3xp/Game_local.cpp b/neo/d3xp/Game_local.cpp index d68b1a36..97b6b4a3 100644 --- a/neo/d3xp/Game_local.cpp +++ b/neo/d3xp/Game_local.cpp @@ -3111,7 +3111,7 @@ idGameLocal::AddAASObstacle aasHandle_t idGameLocal::AddAASObstacle( const idBounds &bounds ) { int i; aasHandle_t obstacle; - aasHandle_t check; + aasHandle_t check id_attribute((unused)); if ( !aasList.Num() ) { return -1; diff --git a/neo/d3xp/Game_network.cpp b/neo/d3xp/Game_network.cpp index 732329a6..ca979d8e 100644 --- a/neo/d3xp/Game_network.cpp +++ b/neo/d3xp/Game_network.cpp @@ -764,7 +764,7 @@ void idGameLocal::ServerProcessEntityNetworkEventQueue( void ) { } } - entityNetEvent_t* freedEvent = eventQueue.Dequeue(); + entityNetEvent_t* freedEvent id_attribute((unused)) = eventQueue.Dequeue(); assert( freedEvent == event ); eventQueue.Free( event ); } @@ -1312,7 +1312,7 @@ void idGameLocal::ClientProcessEntityNetworkEventQueue( void ) { } } - entityNetEvent_t* freedEvent = eventQueue.Dequeue(); + entityNetEvent_t* freedEvent id_attribute((unused)) = eventQueue.Dequeue(); assert( freedEvent == event ); eventQueue.Free( event ); } diff --git a/neo/d3xp/physics/Physics_AF.cpp b/neo/d3xp/physics/Physics_AF.cpp index 7bc55c66..d994571d 100644 --- a/neo/d3xp/physics/Physics_AF.cpp +++ b/neo/d3xp/physics/Physics_AF.cpp @@ -993,7 +993,7 @@ idAFConstraint_UniversalJoint::SetShafts */ void idAFConstraint_UniversalJoint::SetShafts( const idVec3 &cardanShaft1, const idVec3 &cardanShaft2 ) { idVec3 cardanAxis; - float l; + float l id_attribute((unused)); shaft1 = cardanShaft1; l = shaft1.Normalize(); @@ -7963,7 +7963,7 @@ idPhysics_AF::ReadFromSnapshot ================ */ void idPhysics_AF::ReadFromSnapshot( const idBitMsgDelta &msg ) { - int i, num; + int i, num id_attribute((unused)); idCQuat quat; current.atRest = msg.ReadLong(); diff --git a/neo/d3xp/physics/Physics_StaticMulti.cpp b/neo/d3xp/physics/Physics_StaticMulti.cpp index 7b87b5b0..df2c293e 100644 --- a/neo/d3xp/physics/Physics_StaticMulti.cpp +++ b/neo/d3xp/physics/Physics_StaticMulti.cpp @@ -1023,7 +1023,7 @@ idPhysics_StaticMulti::ReadFromSnapshot ================ */ void idPhysics_StaticMulti::ReadFromSnapshot( const idBitMsgDelta &msg ) { - int i, num; + int i, num id_attribute((unused)); idCQuat quat, localQuat; num = msg.ReadByte(); diff --git a/neo/framework/DeclManager.cpp b/neo/framework/DeclManager.cpp index b67e2493..9fa818a4 100644 --- a/neo/framework/DeclManager.cpp +++ b/neo/framework/DeclManager.cpp @@ -410,7 +410,7 @@ SetupHuffman ================ */ void SetupHuffman( void ) { - int i, height; + int i, height id_attribute((unused)); huffmanNode_t *firstNode, *node; huffmanCode_t code; diff --git a/neo/framework/async/MsgChannel.cpp b/neo/framework/async/MsgChannel.cpp index a32d608a..e85308f1 100644 --- a/neo/framework/async/MsgChannel.cpp +++ b/neo/framework/async/MsgChannel.cpp @@ -101,7 +101,7 @@ bool idMsgQueue::Get( byte *data, int &size ) { size = 0; return false; } - int sequence; + int sequence id_attribute((unused)); size = ReadShort(); sequence = ReadLong(); ReadData( data, size ); diff --git a/neo/game/Game_local.cpp b/neo/game/Game_local.cpp index 6371f4ff..3df910a7 100644 --- a/neo/game/Game_local.cpp +++ b/neo/game/Game_local.cpp @@ -2846,7 +2846,7 @@ idGameLocal::AddAASObstacle aasHandle_t idGameLocal::AddAASObstacle( const idBounds &bounds ) { int i; aasHandle_t obstacle; - aasHandle_t check; + aasHandle_t check id_attribute((unused)); if ( !aasList.Num() ) { return -1; diff --git a/neo/game/Game_network.cpp b/neo/game/Game_network.cpp index e2be04d6..28c448ed 100644 --- a/neo/game/Game_network.cpp +++ b/neo/game/Game_network.cpp @@ -750,7 +750,7 @@ void idGameLocal::ServerProcessEntityNetworkEventQueue( void ) { } } - entityNetEvent_t* freedEvent = eventQueue.Dequeue(); + entityNetEvent_t* freedEvent id_attribute((unused)) = eventQueue.Dequeue(); assert( freedEvent == event ); eventQueue.Free( event ); } @@ -1280,7 +1280,7 @@ void idGameLocal::ClientProcessEntityNetworkEventQueue( void ) { } } - entityNetEvent_t* freedEvent = eventQueue.Dequeue(); + entityNetEvent_t* freedEvent id_attribute((unused)) = eventQueue.Dequeue(); assert( freedEvent == event ); eventQueue.Free( event ); } diff --git a/neo/game/physics/Physics_AF.cpp b/neo/game/physics/Physics_AF.cpp index 8c8bc0d7..77766df3 100644 --- a/neo/game/physics/Physics_AF.cpp +++ b/neo/game/physics/Physics_AF.cpp @@ -993,7 +993,7 @@ idAFConstraint_UniversalJoint::SetShafts */ void idAFConstraint_UniversalJoint::SetShafts( const idVec3 &cardanShaft1, const idVec3 &cardanShaft2 ) { idVec3 cardanAxis; - float l; + float l id_attribute((unused)); shaft1 = cardanShaft1; l = shaft1.Normalize(); @@ -7962,7 +7962,7 @@ idPhysics_AF::ReadFromSnapshot ================ */ void idPhysics_AF::ReadFromSnapshot( const idBitMsgDelta &msg ) { - int i, num; + int i, num id_attribute((unused)); idCQuat quat; current.atRest = msg.ReadLong(); diff --git a/neo/idlib/math/Matrix.h b/neo/idlib/math/Matrix.h index 40f444c2..44fcdfda 100644 --- a/neo/idlib/math/Matrix.h +++ b/neo/idlib/math/Matrix.h @@ -295,7 +295,7 @@ ID_INLINE idMat2 idMat2::Inverse( void ) const { idMat2 invMat; invMat = *this; - int r = invMat.InverseSelf(); + int r id_attribute((unused)) = invMat.InverseSelf(); assert( r ); return invMat; } @@ -304,7 +304,7 @@ ID_INLINE idMat2 idMat2::InverseFast( void ) const { idMat2 invMat; invMat = *this; - int r = invMat.InverseFastSelf(); + int r id_attribute((unused)) = invMat.InverseFastSelf(); assert( r ); return invMat; } @@ -700,7 +700,7 @@ ID_INLINE idMat3 idMat3::Inverse( void ) const { idMat3 invMat; invMat = *this; - int r = invMat.InverseSelf(); + int r id_attribute((unused)) = invMat.InverseSelf(); assert( r ); return invMat; } @@ -709,7 +709,7 @@ ID_INLINE idMat3 idMat3::InverseFast( void ) const { idMat3 invMat; invMat = *this; - int r = invMat.InverseFastSelf(); + int r id_attribute((unused)) = invMat.InverseFastSelf(); assert( r ); return invMat; } @@ -1108,7 +1108,7 @@ ID_INLINE idMat4 idMat4::Inverse( void ) const { idMat4 invMat; invMat = *this; - int r = invMat.InverseSelf(); + int r id_attribute((unused)) = invMat.InverseSelf(); assert( r ); return invMat; } @@ -1117,7 +1117,7 @@ ID_INLINE idMat4 idMat4::InverseFast( void ) const { idMat4 invMat; invMat = *this; - int r = invMat.InverseFastSelf(); + int r id_attribute((unused)) = invMat.InverseFastSelf(); assert( r ); return invMat; } @@ -1413,7 +1413,7 @@ ID_INLINE idMat5 idMat5::Inverse( void ) const { idMat5 invMat; invMat = *this; - int r = invMat.InverseSelf(); + int r id_attribute((unused)) = invMat.InverseSelf(); assert( r ); return invMat; } @@ -1422,7 +1422,7 @@ ID_INLINE idMat5 idMat5::InverseFast( void ) const { idMat5 invMat; invMat = *this; - int r = invMat.InverseFastSelf(); + int r id_attribute((unused)) = invMat.InverseFastSelf(); assert( r ); return invMat; } @@ -1740,7 +1740,7 @@ ID_INLINE idMat6 idMat6::Inverse( void ) const { idMat6 invMat; invMat = *this; - int r = invMat.InverseSelf(); + int r id_attribute((unused)) = invMat.InverseSelf(); assert( r ); return invMat; } @@ -1749,7 +1749,7 @@ ID_INLINE idMat6 idMat6::InverseFast( void ) const { idMat6 invMat; invMat = *this; - int r = invMat.InverseFastSelf(); + int r id_attribute((unused)) = invMat.InverseFastSelf(); assert( r ); return invMat; } @@ -2584,7 +2584,7 @@ ID_INLINE idMatX idMatX::Inverse( void ) const { invMat.SetTempSize( numRows, numColumns ); memcpy( invMat.mat, mat, numRows * numColumns * sizeof( float ) ); - int r = invMat.InverseSelf(); + int r id_attribute((unused)) = invMat.InverseSelf(); assert( r ); return invMat; } @@ -2620,7 +2620,7 @@ ID_INLINE idMatX idMatX::InverseFast( void ) const { invMat.SetTempSize( numRows, numColumns ); memcpy( invMat.mat, mat, numRows * numColumns * sizeof( float ) ); - int r = invMat.InverseFastSelf(); + int r id_attribute((unused)) = invMat.InverseFastSelf(); assert( r ); return invMat; } diff --git a/neo/idlib/math/Polynomial.cpp b/neo/idlib/math/Polynomial.cpp index 4ee475f1..d539dd10 100644 --- a/neo/idlib/math/Polynomial.cpp +++ b/neo/idlib/math/Polynomial.cpp @@ -187,7 +187,7 @@ idPolynomial::Test */ void idPolynomial::Test( void ) { int i, num; - float roots[4], value; + float roots[4], value id_attribute((unused)); idComplex complexRoots[4], complexValue; idPolynomial p; diff --git a/neo/renderer/tr_trisurf.cpp b/neo/renderer/tr_trisurf.cpp index 770c693c..fd08c97c 100644 --- a/neo/renderer/tr_trisurf.cpp +++ b/neo/renderer/tr_trisurf.cpp @@ -437,7 +437,7 @@ void R_CheckStaticTriSurfMemory( const srfTriangles_t *tri ) { if ( tri->verts != NULL ) { // R_CreateLightTris points tri->verts at the verts of the ambient surface if ( tri->ambientSurface == NULL || tri->verts != tri->ambientSurface->verts ) { - const char *error = triVertexAllocator.CheckMemory( tri->verts ); + const char *error id_attribute((unused)) = triVertexAllocator.CheckMemory( tri->verts ); assert( error == NULL ); } } @@ -446,14 +446,14 @@ void R_CheckStaticTriSurfMemory( const srfTriangles_t *tri ) { if ( tri->indexes != NULL ) { // if a surface is completely inside a light volume R_CreateLightTris points tri->indexes at the indexes of the ambient surface if ( tri->ambientSurface == NULL || tri->indexes != tri->ambientSurface->indexes ) { - const char *error = triIndexAllocator.CheckMemory( tri->indexes ); + const char *error id_attribute((unused)) = triIndexAllocator.CheckMemory( tri->indexes ); assert( error == NULL ); } } } if ( tri->shadowVertexes != NULL ) { - const char *error = triShadowVertexAllocator.CheckMemory( tri->shadowVertexes ); + const char *error id_attribute((unused)) = triShadowVertexAllocator.CheckMemory( tri->shadowVertexes ); assert( error == NULL ); } }