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" "@return True if the splash window could be successfully initialized.\n\n"
"@ingroup Platform" ) "@ingroup Platform" )
{ {
if (path == "") if (path == NULL || *path == '\0')
{ {
path = Con::getVariable("$Core::splashWindowImage"); 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 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. // Process the low order bytes, shifting the codepoint down 6 each pass.
for( S32 i = bytecount-1; i > 0; i--) for( S32 i = bytecount-1; i > 0; i--)

View file

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

View file

@ -58,7 +58,7 @@ public:
mData = cv.mData; mData = cv.mData;
mScale = cv.mScale; mScale = cv.mScale;
hullId = cv.hullId; hullId = cv.hullId;
box = box; box = cv.box;
} }
void calculateTransform( const MatrixF &worldXfrm ); void calculateTransform( const MatrixF &worldXfrm );

View file

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