Checking Torque3D with PVS-Studio static analyzer
@@ -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");
}
@@ -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--)
@@ -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
@@ -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_
@@ -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;