浏览代码

Merge pull request #1994 from viva64/pvs-studio-fixes

Checking Torque3D with PVS-Studio static analyzer
Areloch 8 年之前
父节点
当前提交
63841cacb7

+ 1 - 1
Engine/source/console/consoleFunctions.cpp

@@ -2148,7 +2148,7 @@ DefineEngineFunction( displaySplashWindow, bool, (const char* path), (""),
    "@return True if the splash window could be successfully initialized.\n\n"
    "@ingroup Platform" )
 {
-   if (path == "")
+   if (path == NULL || *path == '\0')
    {
       path = Con::getVariable("$Core::splashWindowImage");
    }

+ 1 - 1
Engine/source/core/strings/unicode.cpp

@@ -469,7 +469,7 @@ U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf)
 
    //-----------------
    U8  mask = sgByteMask8LUT[0];            // 0011 1111
-   U8  marker = ( ~mask << 1);            // 1000 0000
+   U8  marker = ( ~static_cast<U32>(mask) << 1u);            // 1000 0000
    
    // Process the low order bytes, shifting the codepoint down 6 each pass.
    for( S32 i = bytecount-1; i > 0; i--)

+ 2 - 2
Engine/source/core/util/tSignal.h

@@ -161,8 +161,8 @@ protected:
    SignalSig *mSignal;
 
 private:
-   SignalSlot( const SignalSlot&) {}
-   SignalSlot& operator=( const SignalSlot&) {}
+   SignalSlot( const SignalSlot&);
+   SignalSlot& operator=( const SignalSlot&);
 };
 
 template<typename Signature> class SignalBaseT : public SignalBase

+ 2 - 2
Engine/source/forest/forestCollision.h

@@ -58,7 +58,7 @@ public:
       mData          = cv.mData;
       mScale         = cv.mScale;
       hullId         = cv.hullId;
-      box            = box;
+      box            = cv.box;
    }
 
    void           calculateTransform( const MatrixF &worldXfrm );
@@ -85,4 +85,4 @@ protected:
 };
 
 
-#endif // _FORESTCOLLISION_H_
+#endif // _FORESTCOLLISION_H_

+ 1 - 1
Engine/source/sfx/media/sfxVorbisStream.cpp

@@ -198,7 +198,7 @@ S32 SFXVorbisStream::read( U8 *buffer,
    // requests longer than this.
    const U32 MAXREAD = 4096;
 
-   U32 bytesRead = 0;
+   S64 bytesRead = 0;
    U32 offset = 0;
    U32 bytesToRead = 0;