diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 58f04cee9..571b3c163 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -3158,9 +3158,9 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream) stream->writeFlag(image.triggerDown); stream->writeFlag(image.altTriggerDown); - for (U32 i=0; iwriteFlag(image.genericTrigger[i]); + stream->writeFlag(image.genericTrigger[j]); } stream->writeInt(image.fireCount,3); diff --git a/Engine/source/console/CMDscan.cpp b/Engine/source/console/CMDscan.cpp index 4ce606638..f81c040a4 100644 --- a/Engine/source/console/CMDscan.cpp +++ b/Engine/source/console/CMDscan.cpp @@ -1910,8 +1910,7 @@ extern int isatty (int ); b->yy_bs_column = 0; } - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } diff --git a/Engine/source/console/cmdgram.cpp b/Engine/source/console/cmdgram.cpp index 35ed58bd0..33dc24203 100644 --- a/Engine/source/console/cmdgram.cpp +++ b/Engine/source/console/cmdgram.cpp @@ -2059,12 +2059,6 @@ yydestruct (yymsg, yytype, yyvaluep) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } } diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 537f583ba..96f340f25 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -479,7 +479,7 @@ DefineConsoleFunction( strreplace, const char*, ( const char* source, const char if(!scan) { dStrcpy(ret + dstp, source + scanp); - return ret; + break; } U32 len = scan - (source + scanp); dStrncpy(ret + dstp, source + scanp, len); diff --git a/Engine/source/core/strings/stringFunctions.cpp b/Engine/source/core/strings/stringFunctions.cpp index 25c7e22b1..b84f378ff 100644 --- a/Engine/source/core/strings/stringFunctions.cpp +++ b/Engine/source/core/strings/stringFunctions.cpp @@ -108,7 +108,7 @@ compare_right(const nat_char* a, const nat_char* b) remember it in BIAS. */ for (;; a++, b++) { if (!nat_isdigit(*a) && !nat_isdigit(*b)) - return bias; + break; else if (!nat_isdigit(*a)) return -1; else if (!nat_isdigit(*b)) @@ -123,7 +123,7 @@ compare_right(const nat_char* a, const nat_char* b) return bias; } - return 0; + return bias; } @@ -134,7 +134,7 @@ compare_left(const nat_char* a, const nat_char* b) different value wins. */ for (;; a++, b++) { if (!nat_isdigit(*a) && !nat_isdigit(*b)) - return 0; + break; else if (!nat_isdigit(*a)) return -1; else if (!nat_isdigit(*b)) diff --git a/Engine/source/platform/platformAssert.h b/Engine/source/platform/platformAssert.h index 4865d387c..60ed7d3d5 100644 --- a/Engine/source/platform/platformAssert.h +++ b/Engine/source/platform/platformAssert.h @@ -96,8 +96,8 @@ public: { if ( ::PlatformAssert::processAssert(::PlatformAssert::Fatal, __FILE__, __LINE__, y) ) { ::Platform::debugBreak(); } } } #else - #define AssertFatal(x, y) { (void)sizeof(x); (void)sizeof(y); } - #define AssertWarn(x, y) { (void)sizeof(x); (void)sizeof(y); } + #define AssertFatal(x, y) { TORQUE_UNUSED(x); TORQUE_UNUSED(y); } + #define AssertWarn(x, y) { TORQUE_UNUSED(x); TORQUE_UNUSED(y); } #endif /*! diff --git a/Engine/source/platform/platformCPUCount.cpp b/Engine/source/platform/platformCPUCount.cpp index 116251e08..3e3e3df11 100644 --- a/Engine/source/platform/platformCPUCount.cpp +++ b/Engine/source/platform/platformCPUCount.cpp @@ -99,12 +99,11 @@ namespace CPUInfo { // static unsigned int CpuIDSupported(void) { - unsigned int MaxInputValue; + unsigned int maxInputValue = 0; // If CPUID instruction is supported #ifdef TORQUE_COMPILER_GCC try { - MaxInputValue = 0; // call cpuid with eax = 0 asm ( @@ -112,7 +111,7 @@ namespace CPUInfo { "xorl %%eax,%%eax\n\t" "cpuid\n\t" "popl %%ebx\n\t" - : "=a" (MaxInputValue) + : "=a" (maxInputValue) : : "%ecx", "%edx" ); @@ -124,25 +123,23 @@ namespace CPUInfo { #elif defined( TORQUE_COMPILER_VISUALC ) try { - MaxInputValue = 0; // call cpuid with eax = 0 __asm { xor eax, eax cpuid - mov MaxInputValue, eax + mov maxInputValue, eax } } catch (...) { - return(0); // cpuid instruction is unavailable + // cpuid instruction is unavailable } #else # error Not implemented. #endif - return MaxInputValue; - + return maxInputValue; } diff --git a/Engine/source/platform/platformMemory.cpp b/Engine/source/platform/platformMemory.cpp index 925a15422..3ad831dc1 100644 --- a/Engine/source/platform/platformMemory.cpp +++ b/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; } } diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index 786fcf62d..d957949e2 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -27,7 +27,11 @@ #define TORQUE_USE_WINSOCK #include #include + +#ifndef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS +#endif // EINPROGRESS + #define ioctl ioctlsocket typedef int socklen_t; diff --git a/Engine/source/platform/types.h b/Engine/source/platform/types.h index c53bd87fc..720010e91 100644 --- a/Engine/source/platform/types.h +++ b/Engine/source/platform/types.h @@ -40,7 +40,7 @@ typedef double F64; ///< Compiler independent 64-bit float struct EmptyType {}; ///< "Null" type used by templates -#define TORQUE_UNUSED(var) (void)var +#define TORQUE_UNUSED(var) (void)(var) //------------------------------------------------------------------------------ //------------------------------------- String Types diff --git a/Engine/source/scene/reflectionManager.cpp b/Engine/source/scene/reflectionManager.cpp index c6b78ad65..3fd24648a 100644 --- a/Engine/source/scene/reflectionManager.cpp +++ b/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; diff --git a/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp b/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp index f7d2c740a..6c94e0743 100644 --- a/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp +++ b/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp @@ -800,7 +800,7 @@ void TerrainMacroMapFeatHLSL::processPix( Vector &componentL meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n", detailColor, detailInfo, inDet ) ); - Var *baseColor = (Var*)LangElement::find( "baseColor" ); + //Var *baseColor = (Var*)LangElement::find( "baseColor" ); Var *outColor = (Var*)LangElement::find( "col" ); meta->addStatement( new GenOp( " @ = lerp( @, @ + @, @ );\r\n", diff --git a/Engine/source/ts/tsShapeAlloc.cpp b/Engine/source/ts/tsShapeAlloc.cpp index 8908b84cf..b9f461c99 100644 --- a/Engine/source/ts/tsShapeAlloc.cpp +++ b/Engine/source/ts/tsShapeAlloc.cpp @@ -213,7 +213,6 @@ void TSShapeAlloc::checkGuard() bool check32 = checkGuard32(); bool check16 = checkGuard16(); bool check8 = checkGuard8(); - 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()));