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

Checking Torque3D with PVS-Studio static analyzer
This commit is contained in:
Areloch 2017-05-08 18:21:02 -05:00 committed by GitHub
commit 63841cacb7
5 changed files with 7 additions and 7 deletions

View file

@ -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");
}

View file

@ -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--)

View file

@ -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

View file

@ -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_

View file

@ -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;