* BugFix: Clear a lot of warnings and correct a few actual programming errors along the way.

This commit is contained in:
Robert MacGregor 2021-10-04 20:04:21 -04:00
parent ef514d0e6b
commit 1b6b803a20
61 changed files with 120 additions and 118 deletions

View file

@ -1199,7 +1199,7 @@ bool GBitmap::readBitmap( const String &bmType, Stream &ioStream )
if ( regInfo == NULL )
{
Con::errorf( "[GBitmap::readBitmap] unable to find registration for extension [%s]", bmType.c_str() );
return NULL;
return false;
}
return regInfo->readFunc( ioStream, this );
@ -1212,7 +1212,7 @@ bool GBitmap::writeBitmap( const String &bmType, Stream &ioStream, U32 compress
if ( regInfo == NULL )
{
Con::errorf( "[GBitmap::writeBitmap] unable to find registration for extension [%s]", bmType.c_str() );
return NULL;
return false;
}
return regInfo->writeFunc( this, ioStream, (compressionLevel == U32_MAX) ? regInfo->defaultCompression : compressionLevel );

View file

@ -143,7 +143,7 @@ static bool sReadPNG(Stream &stream, GBitmap *bitmap)
stream.read(cs_headerBytesChecked, header);
bool isPng = png_check_sig(header, cs_headerBytesChecked) != 0;
if (isPng == false)
if (!isPng)
{
AssertWarn(false, "GBitmap::readPNG: stream doesn't contain a PNG");
return false;

View file

@ -308,7 +308,7 @@ U8* GFXGLCubemap::getTextureData(U32 face, U32 mip)
GFXGLCubemapArray::GFXGLCubemapArray()
{
mCubemap = NULL;
mCubemap = 0;
}
GFXGLCubemapArray::~GFXGLCubemapArray()

View file

@ -101,8 +101,8 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState)
// the state value even if that value is identical to the current value.
#define STATE_CHANGE(state) (!oldState || oldState->mDesc.state != mDesc.state)
#define TOGGLE_STATE(state, enum) if(mDesc.state) glEnable(enum); else glDisable(enum)
#define CHECK_TOGGLE_STATE(state, enum) if(!oldState || oldState->mDesc.state != mDesc.state) if(mDesc.state) glEnable(enum); else glDisable(enum)
#define TOGGLE_STATE(state, enum) if(mDesc.state) { glEnable(enum); } else { glDisable(enum); }
#define CHECK_TOGGLE_STATE(state, enum) if(!oldState || oldState->mDesc.state != mDesc.state) { if(mDesc.state) { glEnable(enum); } else { glDisable(enum); }}
// Blending
CHECK_TOGGLE_STATE(blendEnable, GL_BLEND);

View file

@ -6,7 +6,7 @@
GFXGLTextureArray::GFXGLTextureArray()
{
mTextureArray = NULL;
mTextureArray = 0;
}
void GFXGLTextureArray::init()

View file

@ -13,7 +13,7 @@ public:
~GFXGLTextureArray() { Release(); };
void init();
void init() override;
void setToTexUnit(U32 tuNum) override;

View file

@ -46,7 +46,7 @@ GFXGLTextureObject::GFXGLTextureObject(GFXDevice * aDevice, GFXTextureProfile *p
{
#if TORQUE_DEBUG
mFrameAllocatorMarkGuard == FrameAllocator::getWaterMark();
mFrameAllocatorMarkGuard = FrameAllocator::getWaterMark();
#endif
dMemset(&mLockedRect, 0, sizeof(mLockedRect));

View file

@ -135,7 +135,7 @@ void CubemapData::createMap()
if( initSuccess )
{
mCubemap = GFX->createCubemap();
if (mCubeMapFace == NULL || mCubeMapFace->isNull())
if (!mCubeMapFace || mCubeMapFace->isNull())
return;
mCubemap->initStatic(mCubeMapFace);
}

View file

@ -226,7 +226,7 @@ public:
return setStatus(false);
}
ogg_stream_init(&to, Platform::getRandom() * S32_MAX);
ogg_stream_init(&to, Platform::getRandom() * double(S32_MAX));
ogg_packet op;