more VS2012 L4 warning fixes

This commit is contained in:
Thomas Fischer 2014-03-15 11:51:36 +01:00
parent 502e346eb6
commit 2844ab6912
20 changed files with 30 additions and 8 deletions

View file

@ -2058,6 +2058,7 @@ yydestruct (yymsg, yytype, yyvaluep)
if (!yymsg) if (!yymsg)
yymsg = "Deleting"; yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
} }

View file

@ -1446,6 +1446,7 @@ void SimObject::linkNamespaces()
// No increasing parent reference counts is needed in this case. // No increasing parent reference counts is needed in this case.
bool ok = superClassNamespacePackageRoot->classLinkTo( cppNamespace ); bool ok = superClassNamespacePackageRoot->classLinkTo( cppNamespace );
TORQUE_UNUSED(ok);
AssertFatal( ok, "SimObject::linkNamespaces - failed to link new namespace to c++ class name" ); AssertFatal( ok, "SimObject::linkNamespaces - failed to link new namespace to c++ class name" );
parentNamespace = superClassNamespace; parentNamespace = superClassNamespace;
} }

View file

@ -506,6 +506,7 @@ void* String::StringData::operator new( size_t size, U32 len )
void String::StringData::operator delete(void *ptr) void String::StringData::operator delete(void *ptr)
{ {
StringData* sub = static_cast<StringData *>(ptr); StringData* sub = static_cast<StringData *>(ptr);
TORQUE_UNUSED(sub);
AssertFatal( sub->mRefCount == 0, "StringData::delete() - invalid refcount" ); AssertFatal( sub->mRefCount == 0, "StringData::delete() - invalid refcount" );
#ifdef TORQUE_DEBUG #ifdef TORQUE_DEBUG

View file

@ -436,6 +436,7 @@ bool ZipSubWStream::_write(const U32 numBytes, const void *pBuffer)
} }
S32 retVal = deflate(m_pZipStream, Z_NO_FLUSH); S32 retVal = deflate(m_pZipStream, Z_NO_FLUSH);
TORQUE_UNUSED(retVal);
AssertFatal(retVal != Z_BUF_ERROR, "ZipSubWStream::_write: invalid buffer"); AssertFatal(retVal != Z_BUF_ERROR, "ZipSubWStream::_write: invalid buffer");
} }

View file

@ -786,6 +786,7 @@ void DecalRoad::prepRenderImage( SceneRenderState* state )
U32 idxCount = ( endBatch.endIndex - startIdx ) + 1; U32 idxCount = ( endBatch.endIndex - startIdx ) + 1;
U32 triangleCount = idxCount / 3; U32 triangleCount = idxCount / 3;
TORQUE_UNUSED(vertCount);
AssertFatal( startVert + vertCount <= mVertCount, "DecalRoad, bad draw call!" ); AssertFatal( startVert + vertCount <= mVertCount, "DecalRoad, bad draw call!" );
AssertFatal( startIdx + triangleCount < mTriangleCount * 3, "DecalRoad, bad draw call!" ); AssertFatal( startIdx + triangleCount < mTriangleCount * 3, "DecalRoad, bad draw call!" );

View file

@ -198,6 +198,7 @@ bool ForestData::write( const char *path )
for ( U32 i=0; i < count; i++ ) for ( U32 i=0; i < count; i++ )
{ {
StringTableEntry localName = allDatablocks[i]->getInternalName(); StringTableEntry localName = allDatablocks[i]->getInternalName();
TORQUE_UNUSED(localName);
AssertFatal( localName != NULL && localName[0] != '\0', "ForestData::write - ForestItemData had no internal name set!" ); AssertFatal( localName != NULL && localName[0] != '\0', "ForestData::write - ForestItemData had no internal name set!" );
stream.writeString( allDatablocks[i]->getInternalName() ); stream.writeString( allDatablocks[i]->getInternalName() );
} }

View file

@ -76,6 +76,7 @@ static void pngReadDataFn(png_structp png_ptr,
Stream *strm = (Stream*)png_get_io_ptr(png_ptr); Stream *strm = (Stream*)png_get_io_ptr(png_ptr);
bool success = strm->read(length, data); bool success = strm->read(length, data);
TORQUE_UNUSED(success);
AssertFatal(success, "pngReadDataFn - failed to read from stream!"); AssertFatal(success, "pngReadDataFn - failed to read from stream!");
} }
@ -89,6 +90,7 @@ static void pngWriteDataFn(png_structp png_ptr,
Stream *strm = (Stream*)png_get_io_ptr(png_ptr); Stream *strm = (Stream*)png_get_io_ptr(png_ptr);
bool success = strm->write(length, data); bool success = strm->write(length, data);
TORQUE_UNUSED(success);
AssertFatal(success, "pngWriteDataFn - failed to write to stream!"); AssertFatal(success, "pngWriteDataFn - failed to write to stream!");
} }

View file

@ -350,6 +350,8 @@ bool GuiSplitContainer::resize( const Point2I &newPosition, const Point2I &newEx
GuiContainer *panelTwo = dynamic_cast<GuiContainer*>( at(1) ); GuiContainer *panelTwo = dynamic_cast<GuiContainer*>( at(1) );
// //
TORQUE_UNUSED(panelOne);
TORQUE_UNUSED(panelTwo);
AssertFatal( panelOne && panelTwo, "GuiSplitContainer::resize - Missing/Invalid Subordinate Controls! Split contained controls must derive from GuiContainer!" ); AssertFatal( panelOne && panelTwo, "GuiSplitContainer::resize - Missing/Invalid Subordinate Controls! Split contained controls must derive from GuiContainer!" );
// We only need to update the split point if our second panel is fixed. // We only need to update the split point if our second panel is fixed.

View file

@ -475,6 +475,8 @@ void DeferredPixelSpecularHLSL::processPix( Vector<ShaderComponent*> &component
Var *d_specular = (Var*)LangElement::find( "d_specular" ); Var *d_specular = (Var*)LangElement::find( "d_specular" );
Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" ); Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
TORQUE_UNUSED(lightInfoSamp);
TORQUE_UNUSED(d_NL_Att);
AssertFatal( lightInfoSamp && d_specular && d_NL_Att, AssertFatal( lightInfoSamp && d_specular && d_NL_Att,
"DeferredPixelSpecularHLSL::processPix - Something hosed the deferred features!" ); "DeferredPixelSpecularHLSL::processPix - Something hosed the deferred features!" );

View file

@ -514,6 +514,7 @@ ConsoleSetType( TypeBox3F )
U32 args = dSscanf(argv[0], "%g %g %g %g %g %g", U32 args = dSscanf(argv[0], "%g %g %g %g %g %g",
&pDst->minExtents.x, &pDst->minExtents.y, &pDst->minExtents.z, &pDst->minExtents.x, &pDst->minExtents.y, &pDst->minExtents.z,
&pDst->maxExtents.x, &pDst->maxExtents.y, &pDst->maxExtents.z); &pDst->maxExtents.x, &pDst->maxExtents.y, &pDst->maxExtents.z);
TORQUE_UNUSED(args);
AssertWarn(args == 6, "Warning, box probably not read properly"); AssertWarn(args == 6, "Warning, box probably not read properly");
} }
else else

View file

@ -798,19 +798,17 @@ void checkPtr( void* ptr )
AllocatedHeader* header = ( AllocatedHeader* ) *iter; AllocatedHeader* header = ( AllocatedHeader* ) *iter;
if( header->getUserPtr() == ptr ) if( header->getUserPtr() == ptr )
{ {
char buffer[ 1024 ];
#ifdef TORQUE_DEBUG_GUARD #ifdef TORQUE_DEBUG_GUARD
char buffer[ 1024 ];
if( !checkGuard( *iter, true ) ) if( !checkGuard( *iter, true ) )
{ {
dSprintf( buffer, sizeof( buffer ), "0x%x is a valid heap pointer but has its guards corrupted", ptr ); dSprintf( buffer, sizeof( buffer ), "0x%x is a valid heap pointer but has its guards corrupted", ptr );
Platform::outputDebugString( buffer ); Platform::outputDebugString( buffer );
return; return;
} }
#endif
//dSprintf( buffer, sizeof( buffer ), "0x%x is a valid heap pointer", ptr ); //dSprintf( buffer, sizeof( buffer ), "0x%x is a valid heap pointer", ptr );
//Platform::outputDebugString( buffer ); //Platform::outputDebugString( buffer );
#endif
return; return;
} }
} }

View file

@ -27,7 +27,11 @@
#define TORQUE_USE_WINSOCK #define TORQUE_USE_WINSOCK
#include <errno.h> #include <errno.h>
#include <winsock.h> #include <winsock.h>
#ifndef EINPROGRESS
#define EINPROGRESS WSAEINPROGRESS #define EINPROGRESS WSAEINPROGRESS
#endif // EINPROGRESS
#define ioctl ioctlsocket #define ioctl ioctlsocket
typedef int socklen_t; typedef int socklen_t;

View file

@ -623,6 +623,7 @@ void Profiler::dump()
{ {
FileStream fws; FileStream fws;
bool success = fws.open(mDumpFileName, Torque::FS::File::Write); bool success = fws.open(mDumpFileName, Torque::FS::File::Write);
TORQUE_UNUSED(success);
AssertFatal(success, "Cannot write profile dump to specified file!"); AssertFatal(success, "Cannot write profile dump to specified file!");
char buffer[1024]; char buffer[1024];

View file

@ -189,11 +189,8 @@ void ReflectionManager::update( F32 timeSlice,
break; break;
} }
U32 totalElapsed = mTimer->getElapsedMs();
// Set metric/debug related script variables... // Set metric/debug related script variables...
U32 numEnabled = mReflectors.size();
U32 numVisible = 0; U32 numVisible = 0;
U32 numOccluded = 0; U32 numOccluded = 0;
@ -208,6 +205,8 @@ void ReflectionManager::update( F32 timeSlice,
} }
#ifdef TORQUE_GATHER_METRICS #ifdef TORQUE_GATHER_METRICS
U32 numEnabled = mReflectors.size();
U32 totalElapsed = mTimer->getElapsedMs();
const GFXTextureProfileStats &stats = ReflectRenderTargetProfile.getStats(); const GFXTextureProfileStats &stats = ReflectRenderTargetProfile.getStats();
F32 mb = ( stats.activeBytes / 1024.0f ) / 1024.0f; F32 mb = ( stats.activeBytes / 1024.0f ) / 1024.0f;

View file

@ -901,6 +901,7 @@ void SceneZoneSpaceManager::verifyState()
continue; continue;
SceneZoneSpace* otherSpace = mZoneSpaces[ n ]; SceneZoneSpace* otherSpace = mZoneSpaces[ n ];
TORQUE_UNUSED(otherSpace);
AssertFatal( otherSpace->getZoneRangeStart() >= zoneRangeStart + numZones || AssertFatal( otherSpace->getZoneRangeStart() >= zoneRangeStart + numZones ||
otherSpace->getZoneRangeStart() + otherSpace->getZoneRange() <= zoneRangeStart, otherSpace->getZoneRangeStart() + otherSpace->getZoneRange() <= zoneRangeStart,
"SceneZoneSpaceManager::verifyState - Overlap between zone ID ranges of zone spaces!" ); "SceneZoneSpaceManager::verifyState - Overlap between zone ID ranges of zone spaces!" );

View file

@ -303,6 +303,7 @@ void SFXWorld< NUM_DIMENSIONS, Object >::update()
else else
{ {
SFXAmbience* ambience = Deref( scope.mObject ).getAmbience(); SFXAmbience* ambience = Deref( scope.mObject ).getAmbience();
TORQUE_UNUSED(ambience);
AssertFatal( ambience != NULL, "SFXWorld::update() - object on stack that does not have an ambient space!" ); AssertFatal( ambience != NULL, "SFXWorld::update() - object on stack that does not have an ambient space!" );
// Listener is neither inside object nor in its // Listener is neither inside object nor in its

View file

@ -1512,6 +1512,7 @@ bool TSMesh::castRayOpcode( const Point3F &s, const Point3F &e, RayInfo *info, T
// Do collision. // Do collision.
bool safety = ray.Collide( vec, *mOptTree ); bool safety = ray.Collide( vec, *mOptTree );
TORQUE_UNUSED(safety);
AssertFatal( safety, "TSMesh::castRayOpcode - no good ray collide!" ); AssertFatal( safety, "TSMesh::castRayOpcode - no good ray collide!" );
// If no hit, just skip out. // If no hit, just skip out.

View file

@ -390,6 +390,7 @@ void TSShape::getObjectDetails(S32 objIndex, Vector<S32>& objDetails)
void TSShape::init() void TSShape::init()
{ {
S32 numSubShapes = subShapeFirstNode.size(); S32 numSubShapes = subShapeFirstNode.size();
TORQUE_UNUSED(numSubShapes);
AssertFatal(numSubShapes==subShapeFirstObject.size(),"TSShape::init"); AssertFatal(numSubShapes==subShapeFirstObject.size(),"TSShape::init");
S32 i,j; S32 i,j;

View file

@ -213,7 +213,9 @@ void TSShapeAlloc::checkGuard()
bool check32 = checkGuard32(); bool check32 = checkGuard32();
bool check16 = checkGuard16(); bool check16 = checkGuard16();
bool check8 = checkGuard8(); bool check8 = checkGuard8();
TORQUE_UNUSED(check32);
TORQUE_UNUSED(check16);
TORQUE_UNUSED(check8);
AssertFatal(check32,avar("TSShapeAlloc::checkGuard32: found %i, wanted %i",getSaveGuard32(),getPrevGuard32())); AssertFatal(check32,avar("TSShapeAlloc::checkGuard32: found %i, wanted %i",getSaveGuard32(),getPrevGuard32()));
AssertFatal(check16,avar("TSShapeAlloc::checkGuard16: found %i, wanted %i",getSaveGuard16(),getPrevGuard16())); AssertFatal(check16,avar("TSShapeAlloc::checkGuard16: found %i, wanted %i",getSaveGuard16(),getPrevGuard16()));
AssertFatal(check8 ,avar("TSShapeAlloc::checkGuard8: found %i, wanted %i",getSaveGuard8() ,getPrevGuard8())); AssertFatal(check8 ,avar("TSShapeAlloc::checkGuard8: found %i, wanted %i",getSaveGuard8() ,getPrevGuard8()));

View file

@ -163,6 +163,7 @@ void TSThread::setSequence(S32 seq, F32 toPos)
{ {
const TSShape * shape = mShapeInstance->mShape; const TSShape * shape = mShapeInstance->mShape;
TORQUE_UNUSED(shape);
AssertFatal(shape && shape->sequences.size()>seq && toPos>=0.0f && toPos<=1.0f, AssertFatal(shape && shape->sequences.size()>seq && toPos>=0.0f && toPos<=1.0f,
"TSThread::setSequence: invalid shape handle, sequence number, or position."); "TSThread::setSequence: invalid shape handle, sequence number, or position.");