Przeglądaj źródła

more VS2012 L4 warning fixes

Thomas Fischer 11 lat temu
rodzic
commit
2844ab6912

+ 1 - 0
Engine/source/console/cmdgram.cpp

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

+ 1 - 0
Engine/source/console/simObject.cpp

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

+ 1 - 0
Engine/source/core/util/str.cpp

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

+ 1 - 0
Engine/source/core/util/zip/zipSubStream.cpp

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

+ 1 - 0
Engine/source/environment/decalRoad.cpp

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

+ 1 - 0
Engine/source/forest/forestDataFile.cpp

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

+ 2 - 0
Engine/source/gfx/bitmap/loaders/bitmapPng.cpp

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

+ 2 - 0
Engine/source/gui/containers/guiSplitContainer.cpp

@@ -350,6 +350,8 @@ bool GuiSplitContainer::resize( const Point2I &newPosition, const Point2I &newEx
    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!" );
 
    // We only need to update the split point if our second panel is fixed.  

+ 2 - 0
Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp

@@ -475,6 +475,8 @@ void DeferredPixelSpecularHLSL::processPix(  Vector<ShaderComponent*> &component
    Var *d_specular = (Var*)LangElement::find( "d_specular" );
    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,
       "DeferredPixelSpecularHLSL::processPix - Something hosed the deferred features!" );
 

+ 1 - 0
Engine/source/math/mathTypes.cpp

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

+ 2 - 4
Engine/source/platform/platformMemory.cpp

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

+ 4 - 0
Engine/source/platform/platformNet.cpp

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

+ 1 - 0
Engine/source/platform/profiler.cpp

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

+ 2 - 3
Engine/source/scene/reflectionManager.cpp

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

+ 1 - 0
Engine/source/scene/zones/sceneZoneSpaceManager.cpp

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

+ 1 - 0
Engine/source/sfx/sfxWorld.h

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

+ 1 - 0
Engine/source/ts/tsCollision.cpp

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

+ 1 - 0
Engine/source/ts/tsShape.cpp

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

+ 3 - 1
Engine/source/ts/tsShapeAlloc.cpp

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

+ 1 - 0
Engine/source/ts/tsThread.cpp

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