From 1b6b803a20d7f58f639ff2c09e7f8bf0e7b78742 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Mon, 4 Oct 2021 20:04:21 -0400 Subject: [PATCH] * BugFix: Clear a lot of warnings and correct a few actual programming errors along the way. --- Engine/lib/collada/include/dae.h | 2 +- .../lib/collada/include/dae/daeErrorHandler.h | 2 +- .../include/dae/daeStandardURIResolver.h | 2 +- .../lib/collada/src/dae/daeErrorHandler.cpp | 2 +- Engine/source/T3D/assets/MaterialAsset.cpp | 15 ++++--- Engine/source/T3D/assets/assetImporter.cpp | 2 +- Engine/source/T3D/assets/assetImporter.h | 9 ----- Engine/source/T3D/convexShape.cpp | 4 +- Engine/source/T3D/fx/particleEmitter.cpp | 12 +++++- Engine/source/T3D/fx/precipitation.cpp | 2 +- Engine/source/T3D/gameBase/gameConnection.cpp | 2 +- Engine/source/T3D/shapeBase.h | 2 +- Engine/source/afx/util/afxAnimCurve.h | 2 +- Engine/source/afx/util/afxCurveEval.h | 1 + Engine/source/afx/xm/afxXM_WaveBase.h | 3 +- Engine/source/collision/optimizedPolyList.h | 2 +- Engine/source/collision/polytope.h | 2 +- Engine/source/console/CMDscan.cpp | 40 +++++++++---------- Engine/source/console/arrayObject.cpp | 4 +- Engine/source/console/simObject.cpp | 4 +- Engine/source/core/stringBuffer.cpp | 2 +- Engine/source/core/strings/unicode.cpp | 4 +- Engine/source/core/util/hashFunction.h | 4 +- Engine/source/environment/decalRoad.cpp | 2 +- .../editors/guiMeshRoadEditorCtrl.cpp | 2 +- .../editors/guiRiverEditorCtrl.cpp | 2 +- .../environment/editors/guiRoadEditorCtrl.cpp | 2 +- Engine/source/environment/meshRoad.cpp | 4 +- Engine/source/environment/river.cpp | 2 +- Engine/source/gfx/bitmap/gBitmap.cpp | 4 +- .../source/gfx/bitmap/loaders/bitmapPng.cpp | 2 +- Engine/source/gfx/gl/gfxGLCubemap.cpp | 2 +- Engine/source/gfx/gl/gfxGLStateBlock.cpp | 4 +- Engine/source/gfx/gl/gfxGLTextureArray.cpp | 2 +- Engine/source/gfx/gl/gfxGLTextureArray.h | 2 +- Engine/source/gfx/gl/gfxGLTextureObject.cpp | 2 +- Engine/source/gfx/sim/cubemapData.cpp | 2 +- .../source/gfx/video/videoEncoderTheora.cpp | 2 +- Engine/source/gui/core/guiCanvas.cpp | 2 +- Engine/source/gui/editor/guiInspector.cpp | 4 +- .../source/gui/editor/guiShapeEdPreview.cpp | 6 +-- .../worldEditor/guiConvexShapeEditorCtrl.h | 2 +- .../source/gui/worldEditor/guiMissionArea.h | 2 +- .../source/gui/worldEditor/terrainActions.cpp | 2 +- .../advanced/advancedLightBinManager.h | 2 +- .../source/lighting/basic/blTerrainSystem.cpp | 4 +- .../source/materials/materialDefinition.cpp | 2 +- Engine/source/math/mRandom.h | 2 +- Engine/source/navigation/guiNavEditorCtrl.h | 2 +- Engine/source/persistence/taml/taml.cpp | 2 +- Engine/source/platform/platformNet.cpp | 2 +- Engine/source/platformSDL/sdlInput.cpp | 2 +- .../source/platformX86UNIX/x86UNIXFileio.cpp | 16 ++++---- .../renderInstance/renderImposterMgr.cpp | 2 +- .../renderInstance/renderPassStateToken.cpp | 2 +- .../scene/mixin/scenePolyhedralObject.impl.h | 6 +-- Engine/source/sim/actionMap.cpp | 2 +- Engine/source/sim/actionMap.h | 2 +- Engine/source/sim/netObject.cpp | 4 +- Engine/source/ts/tsShape.cpp | 6 +-- Engine/source/ts/tsShapeConstruct.cpp | 2 +- 61 files changed, 120 insertions(+), 118 deletions(-) diff --git a/Engine/lib/collada/include/dae.h b/Engine/lib/collada/include/dae.h index d6f217ed8..d5d16f125 100644 --- a/Engine/lib/collada/include/dae.h +++ b/Engine/lib/collada/include/dae.h @@ -195,7 +195,7 @@ private: daeRawRefCache rawRefCache; daeSidRefCache sidRefCache; - std::auto_ptr localCharEncoding; + std::unique_ptr localCharEncoding; static charEncoding globalCharEncoding; }; diff --git a/Engine/lib/collada/include/dae/daeErrorHandler.h b/Engine/lib/collada/include/dae/daeErrorHandler.h index 6d6499486..edc20ee31 100644 --- a/Engine/lib/collada/include/dae/daeErrorHandler.h +++ b/Engine/lib/collada/include/dae/daeErrorHandler.h @@ -60,7 +60,7 @@ public: private: static daeErrorHandler *_instance; - static std::auto_ptr _defaultInstance; + static std::unique_ptr _defaultInstance; }; #endif diff --git a/Engine/lib/collada/include/dae/daeStandardURIResolver.h b/Engine/lib/collada/include/dae/daeStandardURIResolver.h index 0c92bcc6e..6d9bcf15d 100644 --- a/Engine/lib/collada/include/dae/daeStandardURIResolver.h +++ b/Engine/lib/collada/include/dae/daeStandardURIResolver.h @@ -12,7 +12,7 @@ */ #ifndef __DAE_STANDARD_URI_RESOLVER__ -#define __DAE_STANDARD_URI_RESOVLER__ +#define __DAE_STANDARD_URI_RESOLVER__ #include #include "dae/daeURI.h" diff --git a/Engine/lib/collada/src/dae/daeErrorHandler.cpp b/Engine/lib/collada/src/dae/daeErrorHandler.cpp index 843bbbae3..2e7edcf9c 100644 --- a/Engine/lib/collada/src/dae/daeErrorHandler.cpp +++ b/Engine/lib/collada/src/dae/daeErrorHandler.cpp @@ -15,7 +15,7 @@ #include daeErrorHandler *daeErrorHandler::_instance = NULL; -std::auto_ptr daeErrorHandler::_defaultInstance(new stdErrPlugin); +std::unique_ptr daeErrorHandler::_defaultInstance(new stdErrPlugin); daeErrorHandler::daeErrorHandler() { } diff --git a/Engine/source/T3D/assets/MaterialAsset.cpp b/Engine/source/T3D/assets/MaterialAsset.cpp index 8fd2b6ecf..57008b025 100644 --- a/Engine/source/T3D/assets/MaterialAsset.cpp +++ b/Engine/source/T3D/assets/MaterialAsset.cpp @@ -19,7 +19,6 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- -#pragma once #ifndef MATERIALASSET_H #include "MaterialAsset.h" @@ -171,10 +170,16 @@ void MaterialAsset::initializeAsset() if (Torque::FS::IsScriptFile(mScriptPath)) { if (!Sim::findObject(mMatDefinitionName)) - if (Con::executeFile(mScriptPath, false, false)) - mLoadedState = ScriptLoaded; - else - mLoadedState = Failed; + { + if (Con::executeFile(mScriptPath, false, false)) + { + mLoadedState = ScriptLoaded; + } + else + { + mLoadedState = Failed; + } + } } loadMaterial(); diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index 5df1ca8ab..c9ed8a211 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -1409,7 +1409,7 @@ void AssetImporter::processImportAssets(AssetImportObject* assetItem) Con::executef(this, processCommand.c_str(), item); } - item->importStatus == AssetImportObject::Processed; + item->importStatus = AssetImportObject::Processed; //try recusing on the children(if any) processImportAssets(item); diff --git a/Engine/source/T3D/assets/assetImporter.h b/Engine/source/T3D/assets/assetImporter.h index 0c176840a..b03c89c40 100644 --- a/Engine/source/T3D/assets/assetImporter.h +++ b/Engine/source/T3D/assets/assetImporter.h @@ -931,15 +931,6 @@ public: return imagePath; } - static inline const char* makeFullPath(const String& path) - { - char qualifiedFilePath[2048]; - - Platform::makeFullPathName(path.c_str(), qualifiedFilePath, sizeof(qualifiedFilePath)); - - return qualifiedFilePath; - } - // void setTargetModuleId(const String& moduleId) { targetModuleId = moduleId; } const String& getTargetModuleId() { return targetModuleId; } diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index 99f3f418a..e0184f2f4 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -318,10 +318,10 @@ void ConvexShape::initPersistFields() addGroup( "Internal" ); - addProtectedField( "surface", TypeRealString, NULL, &protectedSetSurface, &defaultProtectedGetFn, + addProtectedField( "surface", TypeRealString, 0, &protectedSetSurface, &defaultProtectedGetFn, "Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors ); - addProtectedField( "surfaceTexture", TypeRealString, NULL, &protectedSetSurfaceTexture, &defaultProtectedGetFn, + addProtectedField( "surfaceTexture", TypeRealString, 0, &protectedSetSurfaceTexture, &defaultProtectedGetFn, "Do not modify, for internal use.", AbstractClassRep::FIELD_HideInInspectors ); endGroup( "Internal" ); diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index 45acd1ecb..c60dc6d49 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -1914,7 +1914,11 @@ void ParticleEmitter::copyToVB( const Point3F &camPos, const LinearColorF &ambie { SortParticle* partPtr = orderedVector.address(); for (U32 i = 0; i < n_parts - 1; i++, partPtr++, buffPtr -= 4) - setupRibbon(partPtr->p, partPtr++->p, partPtr--->p, camPos, ambientColor, buffPtr); + { + SortParticle* part = partPtr; + partPtr++; + setupRibbon(part->p, partPtr->p, partPtr->p, camPos, ambientColor, buffPtr); + } } // do unsorted-oriented particles else @@ -1933,7 +1937,11 @@ void ParticleEmitter::copyToVB( const Point3F &camPos, const LinearColorF &ambie { SortParticle* partPtr = orderedVector.address(); for (U32 i = 0; i < n_parts - 1; i++, partPtr++, buffPtr += 4) - setupRibbon(partPtr->p, partPtr++->p, partPtr--->p, camPos, ambientColor, buffPtr); + { + SortParticle* part = partPtr; + partPtr++; + setupRibbon(part->p, partPtr->p, partPtr->p, camPos, ambientColor, buffPtr); + } } // do unsorted-oriented particles else diff --git a/Engine/source/T3D/fx/precipitation.cpp b/Engine/source/T3D/fx/precipitation.cpp index 4356cd45f..5740edae6 100644 --- a/Engine/source/T3D/fx/precipitation.cpp +++ b/Engine/source/T3D/fx/precipitation.cpp @@ -996,7 +996,7 @@ void Precipitation::initRenderObjects() // entire or a partially filled vb. mRainIB.set(GFX, mMaxVBDrops * 6, 0, GFXBufferTypeStatic); U16 *idxBuff; - mRainIB.lock(&idxBuff, NULL, NULL, NULL); + mRainIB.lock(&idxBuff, NULL, 0, 0); for( U32 i=0; i < mMaxVBDrops; i++ ) { // diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index 09cfa13cf..f759a03da 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -807,7 +807,7 @@ bool GameConnection::isValidControlCameraFov(F32 fov) return cObj->isValidCameraFov(fov); } - return NULL; + return false; } bool GameConnection::setControlCameraFov(F32 fov) diff --git a/Engine/source/T3D/shapeBase.h b/Engine/source/T3D/shapeBase.h index 4d3286b5c..2deb7996c 100644 --- a/Engine/source/T3D/shapeBase.h +++ b/Engine/source/T3D/shapeBase.h @@ -116,7 +116,7 @@ class ShapeBaseConvex : public Convex Box3F box; public: - ShapeBaseConvex() :pShapeBase(NULL), transform(NULL), hullId(NULL), nodeTransform(0) { mType = ShapeBaseConvexType; } + ShapeBaseConvex() :pShapeBase(NULL), transform(NULL), hullId(0), nodeTransform(0) { mType = ShapeBaseConvexType; } ShapeBaseConvex(const ShapeBaseConvex& cv) { mObject = cv.mObject; pShapeBase = cv.pShapeBase; diff --git a/Engine/source/afx/util/afxAnimCurve.h b/Engine/source/afx/util/afxAnimCurve.h index 158203b44..6ed7dbfd0 100644 --- a/Engine/source/afx/util/afxAnimCurve.h +++ b/Engine/source/afx/util/afxAnimCurve.h @@ -56,7 +56,7 @@ class afxAnimCurve public: afxAnimCurve(); - ~afxAnimCurve(); + virtual ~afxAnimCurve(); void addKey( Point2F &v ); void addKey( F32 time, F32 value ); diff --git a/Engine/source/afx/util/afxCurveEval.h b/Engine/source/afx/util/afxCurveEval.h index 0a8765c19..d5c6853b9 100644 --- a/Engine/source/afx/util/afxCurveEval.h +++ b/Engine/source/afx/util/afxCurveEval.h @@ -32,6 +32,7 @@ class afxCurveEval { public: + virtual ~afxCurveEval() { } virtual Point2F evaluateCurve(Point2F& v0, Point2F& v1, F32 t)=0; virtual Point2F evaluateCurve(Point2F& v0, Point2F& v1, Point2F& t0, Point2F& t1, F32 t)=0; virtual Point2F evaluateCurveTangent(Point2F& v0, Point2F& v1, F32 t)=0; diff --git a/Engine/source/afx/xm/afxXM_WaveBase.h b/Engine/source/afx/xm/afxXM_WaveBase.h index f7dd26f31..e231ef2b8 100644 --- a/Engine/source/afx/xm/afxXM_WaveBase.h +++ b/Engine/source/afx/xm/afxXM_WaveBase.h @@ -81,6 +81,7 @@ public: class afxXM_WaveInterp { public: + virtual ~afxXM_WaveInterp() { } virtual void interpolate(F32 t, afxXM_Params& params)=0; virtual void pulse()=0; @@ -250,7 +251,7 @@ protected: public: /*C*/ afxXM_WaveBase(afxXM_WaveBaseData*, afxEffectWrapper*, afxXM_WaveInterp*); - /*D*/ ~afxXM_WaveBase(); + /*D*/ virtual ~afxXM_WaveBase(); virtual void updateParams(F32 dt, F32 elapsed, afxXM_Params& params); }; diff --git a/Engine/source/collision/optimizedPolyList.h b/Engine/source/collision/optimizedPolyList.h index b66cc76c0..b42469fe1 100644 --- a/Engine/source/collision/optimizedPolyList.h +++ b/Engine/source/collision/optimizedPolyList.h @@ -87,7 +87,7 @@ class OptimizedPolyList : public AbstractPolyList Poly() : plane( -1 ), - material( NULL ), + material( 0 ), vertexStart(0), vertexCount( 0 ), surfaceKey(0), diff --git a/Engine/source/collision/polytope.h b/Engine/source/collision/polytope.h index 347a85c70..34483c976 100644 --- a/Engine/source/collision/polytope.h +++ b/Engine/source/collision/polytope.h @@ -76,7 +76,7 @@ public: Collision() { object = NULL; - material = NULL; + material = 0; distance = 0.0; } }; diff --git a/Engine/source/console/CMDscan.cpp b/Engine/source/console/CMDscan.cpp index 43a864570..787b4e845 100644 --- a/Engine/source/console/CMDscan.cpp +++ b/Engine/source/console/CMDscan.cpp @@ -774,9 +774,9 @@ YY_MALLOC_DECL YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; #line 105 "CMDscan.l" @@ -823,7 +823,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1430,9 +1430,9 @@ case YY_STATE_EOF(INITIAL): static int yy_get_next_buffer() { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; + char *dest = yy_current_buffer->yy_ch_buf; + char *source = yytext_ptr; + int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) @@ -1560,14 +1560,14 @@ static int yy_get_next_buffer() static yy_state_type yy_get_previous_state() { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1599,10 +1599,10 @@ static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + int yy_is_jam; + char *yy_cp = yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; @@ -1623,14 +1623,14 @@ yy_state_type yy_current_state; #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) +static void yyunput( int c, char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; -register char *yy_bp; +char *yy_bp; #endif { - register char *yy_cp = yy_c_buf_p; + char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; @@ -1638,10 +1638,10 @@ register char *yy_bp; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ + int number_to_move = yy_n_chars + 2; + char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; - register char *source = + char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) @@ -2095,7 +2095,7 @@ yyconst char *s2; int n; #endif { - register int i; + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } diff --git a/Engine/source/console/arrayObject.cpp b/Engine/source/console/arrayObject.cpp index 68b34059e..4c18ac306 100644 --- a/Engine/source/console/arrayObject.cpp +++ b/Engine/source/console/arrayObject.cpp @@ -125,7 +125,7 @@ S32 QSORT_CALLBACK ArrayObject::_valueFunctionCompare( const void* a, const void ArrayObject::ArrayObject() : mCaseSensitive( false ), - mCurrentIndex( NULL ) + mCurrentIndex( 0 ) { } @@ -137,7 +137,7 @@ void ArrayObject::initPersistFields() "Makes the keys and values case-sensitive.\n" "By default, comparison of key and value strings will be case-insensitive." ); - addProtectedField( "key", TypeCaseString, NULL, &_addKeyFromField, &emptyStringProtectedGetFn, + addProtectedField( "key", TypeCaseString, 0, &_addKeyFromField, &emptyStringProtectedGetFn, "Helper field which allows you to add new key['keyname'] = value pairs." ); Parent::initPersistFields(); diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 6b54bdd1d..3d485354c 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -179,10 +179,10 @@ void SimObject::initPersistFields() addGroup( "Editing" ); - addProtectedField( "hidden", TypeBool, NULL, + addProtectedField( "hidden", TypeBool, 0, &_setHidden, &_getHidden, "Whether the object is visible." ); - addProtectedField( "locked", TypeBool, NULL, + addProtectedField( "locked", TypeBool, 0, &_setLocked, &_getLocked, "Whether the object can be edited." ); diff --git a/Engine/source/core/stringBuffer.cpp b/Engine/source/core/stringBuffer.cpp index 2bc3fb069..66983fcf2 100644 --- a/Engine/source/core/stringBuffer.cpp +++ b/Engine/source/core/stringBuffer.cpp @@ -371,7 +371,7 @@ void StringBuffer::getCopy(UTF16 *buff, const U32 buffSize) const AssertFatal(mBuffer.last() == 0, "StringBuffer::get UTF8 - not a null terminated string!"); dMemcpy(buff, mBuffer.address(), sizeof(UTF16) * getMin(buffSize, (U32)mBuffer.size())); // ensure null termination. - buff[buffSize-1] = NULL; + buff[buffSize-1] = 0; } UTF8* StringBuffer::createCopy8() const diff --git a/Engine/source/core/strings/unicode.cpp b/Engine/source/core/strings/unicode.cpp index fd2341b7b..ad43ad3e1 100644 --- a/Engine/source/core/strings/unicode.cpp +++ b/Engine/source/core/strings/unicode.cpp @@ -236,8 +236,8 @@ U32 convertUTF16toUTF8DoubleNULL( const UTF16 *unistring, UTF8 *outbuffer, U32 } nCodeunits = getMin(nCodeunits,len - 1); - outbuffer[nCodeunits] = NULL; - outbuffer[nCodeunits+1] = NULL; + outbuffer[nCodeunits] = '\0'; + outbuffer[nCodeunits+1] = '\0'; PROFILE_END(); return nCodeunits; diff --git a/Engine/source/core/util/hashFunction.h b/Engine/source/core/util/hashFunction.h index d2e1d5b4a..02ecd019b 100644 --- a/Engine/source/core/util/hashFunction.h +++ b/Engine/source/core/util/hashFunction.h @@ -30,9 +30,9 @@ namespace Torque { -extern U32 hash(register const U8 *k, register U32 length, register U32 initval); +extern U32 hash(const U8 *k, U32 length, U32 initval); -extern U64 hash64(register const U8 *k, register U32 length, register U64 initval); +extern U64 hash64(const U8 *k, U32 length, U64 initval); } diff --git a/Engine/source/environment/decalRoad.cpp b/Engine/source/environment/decalRoad.cpp index e1d9a27ee..33d137a83 100644 --- a/Engine/source/environment/decalRoad.cpp +++ b/Engine/source/environment/decalRoad.cpp @@ -320,7 +320,7 @@ void DecalRoad::initPersistFields() addGroup( "Internal" ); - addProtectedField( "node", TypeString, NULL, &addNodeFromField, &emptyStringProtectedGetFn, + addProtectedField( "node", TypeString, 0, &addNodeFromField, &emptyStringProtectedGetFn, "Do not modify, for internal use." ); endGroup( "Internal" ); diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index b0812f738..6433332d7 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -1757,7 +1757,7 @@ DefineEngineMethod( GuiMeshRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) { MeshRoad *road = object->getSelectedRoad(); if ( !road ) - return NULL; + return 0; return road->getId(); } diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index e650fdf59..983c8a01e 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -1472,7 +1472,7 @@ DefineEngineMethod( GuiRiverEditorCtrl, getSelectedRiver, S32, (), , "" ) { River *river = object->getSelectedRiver(); if ( !river ) - return NULL; + return 0; return river->getId(); } diff --git a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp index 3f111a80e..67b6ef883 100644 --- a/Engine/source/environment/editors/guiRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRoadEditorCtrl.cpp @@ -1097,7 +1097,7 @@ DefineEngineMethod( GuiRoadEditorCtrl, getSelectedRoad, S32, (), , "" ) if ( road ) return road->getId(); - return NULL; + return 0; } DefineEngineMethod( GuiRoadEditorCtrl, getSelectedNode, S32, (), , "" ) diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index f27d2d84a..01f8017de 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -954,10 +954,10 @@ void MeshRoad::initPersistFields() addGroup( "Internal" ); - addProtectedField( "Node", TypeString, NULL, &addNodeFromField, &emptyStringProtectedGetFn, + addProtectedField( "Node", TypeString, 0, &addNodeFromField, &emptyStringProtectedGetFn, "Do not modify, for internal use." ); - addProtectedField( "ProfileNode", TypeString, NULL, &addProfileNodeFromField, &emptyStringProtectedGetFn, + addProtectedField( "ProfileNode", TypeString, 0, &addProfileNodeFromField, &emptyStringProtectedGetFn, "Do not modify, for internal use." ); endGroup( "Internal" ); diff --git a/Engine/source/environment/river.cpp b/Engine/source/environment/river.cpp index 9bb1d7aac..0213f9d1d 100644 --- a/Engine/source/environment/river.cpp +++ b/Engine/source/environment/river.cpp @@ -647,7 +647,7 @@ void River::initPersistFields() addGroup( "Internal" ); - addProtectedField( "Node", TypeString, NULL, &addNodeFromField, &emptyStringProtectedGetFn, "For internal use, do not modify." ); + addProtectedField( "Node", TypeString, 0, &addNodeFromField, &emptyStringProtectedGetFn, "For internal use, do not modify." ); endGroup( "Internal" ); diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index 9560586dd..b7045d129 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -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 ); diff --git a/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp b/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp index 65586caa8..9eb1d7b2c 100644 --- a/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp +++ b/Engine/source/gfx/bitmap/loaders/bitmapPng.cpp @@ -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; diff --git a/Engine/source/gfx/gl/gfxGLCubemap.cpp b/Engine/source/gfx/gl/gfxGLCubemap.cpp index 99f3f02a8..db23a0fc2 100644 --- a/Engine/source/gfx/gl/gfxGLCubemap.cpp +++ b/Engine/source/gfx/gl/gfxGLCubemap.cpp @@ -308,7 +308,7 @@ U8* GFXGLCubemap::getTextureData(U32 face, U32 mip) GFXGLCubemapArray::GFXGLCubemapArray() { - mCubemap = NULL; + mCubemap = 0; } GFXGLCubemapArray::~GFXGLCubemapArray() diff --git a/Engine/source/gfx/gl/gfxGLStateBlock.cpp b/Engine/source/gfx/gl/gfxGLStateBlock.cpp index 5be2e43d5..12eab71b0 100644 --- a/Engine/source/gfx/gl/gfxGLStateBlock.cpp +++ b/Engine/source/gfx/gl/gfxGLStateBlock.cpp @@ -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); diff --git a/Engine/source/gfx/gl/gfxGLTextureArray.cpp b/Engine/source/gfx/gl/gfxGLTextureArray.cpp index f2b403bb0..e0137a448 100644 --- a/Engine/source/gfx/gl/gfxGLTextureArray.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureArray.cpp @@ -6,7 +6,7 @@ GFXGLTextureArray::GFXGLTextureArray() { - mTextureArray = NULL; + mTextureArray = 0; } void GFXGLTextureArray::init() diff --git a/Engine/source/gfx/gl/gfxGLTextureArray.h b/Engine/source/gfx/gl/gfxGLTextureArray.h index 65e1d9729..7073b1653 100644 --- a/Engine/source/gfx/gl/gfxGLTextureArray.h +++ b/Engine/source/gfx/gl/gfxGLTextureArray.h @@ -13,7 +13,7 @@ public: ~GFXGLTextureArray() { Release(); }; - void init(); + void init() override; void setToTexUnit(U32 tuNum) override; diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index 9eabc8114..1d5c043e4 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -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)); diff --git a/Engine/source/gfx/sim/cubemapData.cpp b/Engine/source/gfx/sim/cubemapData.cpp index a6833de5c..bf9390dfe 100644 --- a/Engine/source/gfx/sim/cubemapData.cpp +++ b/Engine/source/gfx/sim/cubemapData.cpp @@ -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); } diff --git a/Engine/source/gfx/video/videoEncoderTheora.cpp b/Engine/source/gfx/video/videoEncoderTheora.cpp index d64f76487..ef88787f8 100644 --- a/Engine/source/gfx/video/videoEncoderTheora.cpp +++ b/Engine/source/gfx/video/videoEncoderTheora.cpp @@ -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; diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 96022edaa..0b894f7c3 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -2438,7 +2438,7 @@ DefineEngineMethod( GuiCanvas, getMouseControl, S32, (),, if (control) return control->getId(); - return NULL; + return 0; } DefineEngineFunction(excludeOtherInstance, bool, (const char* appIdentifer),, diff --git a/Engine/source/gui/editor/guiInspector.cpp b/Engine/source/gui/editor/guiInspector.cpp index 48c4dcc94..47d1e3c85 100644 --- a/Engine/source/gui/editor/guiInspector.cpp +++ b/Engine/source/gui/editor/guiInspector.cpp @@ -908,12 +908,12 @@ DefineEngineMethod( GuiInspector, findByObject, S32, (SimObject* obj), , "@return id of an awake inspector that is inspecting the passed object if one exists, else NULL or 0.") { if ( !obj) - return NULL; + return 0; SimObject *inspector = GuiInspector::findByObject(obj); if ( !inspector ) - return NULL; + return 0; return inspector->getId(); } diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index 5ea20ec13..eba775edb 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -160,11 +160,11 @@ void GuiShapeEdPreview::initPersistFields() addGroup( "Animation" ); addField( "activeThread", TypeS32, Offset( mActiveThread, GuiShapeEdPreview ), "Index of the active thread, or -1 if none" ); - addProtectedField( "threadPos", TypeF32, NULL, &setFieldThreadPos, &getFieldThreadPos, + addProtectedField( "threadPos", TypeF32, 0, &setFieldThreadPos, &getFieldThreadPos, "Current position of the active thread (0-1)" ); - addProtectedField( "threadDirection", TypeS32, NULL, &setFieldThreadDir, &getFieldThreadDir, + addProtectedField( "threadDirection", TypeS32, 0, &setFieldThreadDir, &getFieldThreadDir, "Playback direction of the active thread" ); - addProtectedField( "threadPingPong", TypeBool, NULL, &setFieldThreadPingPong, &getFieldThreadPingPong, + addProtectedField( "threadPingPong", TypeBool, 0, &setFieldThreadPingPong, &getFieldThreadPingPong, "'PingPong' mode of the active thread" ); endGroup( "Animation" ); diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h index 6ede0cf61..1600a4e50 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.h @@ -248,7 +248,7 @@ class GuiConvexEditorUndoAction : public UndoAction friend class GuiConvexEditorCtrl; public: - GuiConvexEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mEditor(NULL), mObjId(NULL) + GuiConvexEditorUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mEditor(NULL), mObjId(0) { } diff --git a/Engine/source/gui/worldEditor/guiMissionArea.h b/Engine/source/gui/worldEditor/guiMissionArea.h index 885f85107..9c3dec0a5 100644 --- a/Engine/source/gui/worldEditor/guiMissionArea.h +++ b/Engine/source/gui/worldEditor/guiMissionArea.h @@ -145,7 +145,7 @@ class GuiMissionAreaUndoAction : public UndoAction { public: - GuiMissionAreaUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mMissionAreaEditor(NULL), mObjId(NULL) + GuiMissionAreaUndoAction( const UTF8* actionName ) : UndoAction( actionName ), mMissionAreaEditor(NULL), mObjId(0) { } diff --git a/Engine/source/gui/worldEditor/terrainActions.cpp b/Engine/source/gui/worldEditor/terrainActions.cpp index 3fc07205d..a6fbb5c21 100644 --- a/Engine/source/gui/worldEditor/terrainActions.cpp +++ b/Engine/source/gui/worldEditor/terrainActions.cpp @@ -773,7 +773,7 @@ ConsoleDocClass( TerrainSmoothAction, ); TerrainSmoothAction::TerrainSmoothAction() - : UndoAction("Terrain Smoothing"), mFactor(1.0), mSteps(1), mTerrainId(NULL) + : UndoAction("Terrain Smoothing"), mFactor(1.0), mSteps(1), mTerrainId(0) { } diff --git a/Engine/source/lighting/advanced/advancedLightBinManager.h b/Engine/source/lighting/advanced/advancedLightBinManager.h index 4f97e4239..4d04f3cfc 100644 --- a/Engine/source/lighting/advanced/advancedLightBinManager.h +++ b/Engine/source/lighting/advanced/advancedLightBinManager.h @@ -70,7 +70,7 @@ protected: GFXStateBlockRef mLitState[NUM_LIT_STATES][2]; public: - LightMatInstance(Material &mat) : Parent(mat), mLightMapParamsSC(NULL), mInternalPass(false), mSpecialLight(NULL) {} + LightMatInstance(Material &mat) : Parent(mat), mLightMapParamsSC(NULL), mInternalPass(false), mSpecialLight(false) {} virtual bool init( const FeatureSet &features, const GFXVertexFormat *vertexFormat ); virtual bool setupPass( SceneRenderState *state, const SceneData &sgData ); diff --git a/Engine/source/lighting/basic/blTerrainSystem.cpp b/Engine/source/lighting/basic/blTerrainSystem.cpp index d6fb3f9d5..1cf077575 100644 --- a/Engine/source/lighting/basic/blTerrainSystem.cpp +++ b/Engine/source/lighting/basic/blTerrainSystem.cpp @@ -682,9 +682,9 @@ bool blTerrainSystem::createPersistChunkFromProxy(SceneLighting::ObjectProxy* ob { *ret = new blTerrainChunk(); return true; - } else { - return NULL; } + + return false; } // Given a ray, this will return the color from the lightmap of this object, return true if handled diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index 7eb49ffc0..3c3cb5898 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -218,7 +218,7 @@ Material::Material() mPlanarReflection = false; mCubemapData = NULL; - mDynamicCubemap = NULL; + mDynamicCubemap = false; mLastUpdateTime = 0; diff --git a/Engine/source/math/mRandom.h b/Engine/source/math/mRandom.h index c69c06477..dbd4a2328 100644 --- a/Engine/source/math/mRandom.h +++ b/Engine/source/math/mRandom.h @@ -54,7 +54,7 @@ public: inline F32 MRandomGenerator::randF() { // default: multiply by 1/(2^31) - return F32(randI()) * (1.0f / S32_MAX); + return F32(randI()) * (1.0f / F64(S32_MAX)); } inline S32 MRandomGenerator::randI(S32 i, S32 n) diff --git a/Engine/source/navigation/guiNavEditorCtrl.h b/Engine/source/navigation/guiNavEditorCtrl.h index 4a6780b33..2d4c96bce 100644 --- a/Engine/source/navigation/guiNavEditorCtrl.h +++ b/Engine/source/navigation/guiNavEditorCtrl.h @@ -168,7 +168,7 @@ protected: class GuiNavEditorUndoAction : public UndoAction { public: - GuiNavEditorUndoAction(const UTF8* actionName) : UndoAction(actionName), mNavEditor(NULL), mObjId(NULL) + GuiNavEditorUndoAction(const UTF8* actionName) : UndoAction(actionName), mNavEditor(NULL), mObjId(0) { } diff --git a/Engine/source/persistence/taml/taml.cpp b/Engine/source/persistence/taml/taml.cpp index 837843c72..0454e102a 100644 --- a/Engine/source/persistence/taml/taml.cpp +++ b/Engine/source/persistence/taml/taml.cpp @@ -335,7 +335,7 @@ ImplementEnumType(_TamlFormatMode, // Write. //return writer.write( stream, pRootNode ); - return NULL; + return false; } /// Invalid. diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index 1e5cb0a5a..db7c26604 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -241,7 +241,7 @@ namespace PlatformNetState struct addrinfo* pickAddressByProtocol(struct addrinfo* addr, int protocol) { - for (addr; addr != NULL; addr = addr->ai_next) + for (; addr != NULL; addr = addr->ai_next) { if (addr->ai_family == protocol) return addr; diff --git a/Engine/source/platformSDL/sdlInput.cpp b/Engine/source/platformSDL/sdlInput.cpp index a60a0e7b5..67d86b277 100644 --- a/Engine/source/platformSDL/sdlInput.cpp +++ b/Engine/source/platformSDL/sdlInput.cpp @@ -102,7 +102,7 @@ U16 Input::getKeyCode( U16 asciiCode ) char c[2]; c[0]= asciiCode; - c[1] = NULL; + c[1] = 0; return KeyMapSDL::getTorqueScanCodeFromSDL( SDL_GetScancodeFromKey( SDL_GetKeyFromName(c) ) ); } diff --git a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp index 77419a96a..eee06a84e 100644 --- a/Engine/source/platformX86UNIX/x86UNIXFileio.cpp +++ b/Engine/source/platformX86UNIX/x86UNIXFileio.cpp @@ -594,20 +594,20 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) return currentStatus; U32 finalPos = 0; - switch (absolutePos) + + if (absolutePos) { - case true: // absolute position AssertFatal(0 <= position, "File::setPosition: negative absolute position"); // position beyond EOS is OK finalPos = lseek(*((int *)handle), position, SEEK_SET); - break; - case false: // relative position + } + else + { AssertFatal((getPosition() >= (U32)abs(position) && 0 > position) || 0 <= position, "File::setPosition: negative relative position"); // position beyond EOS is OK finalPos = lseek(*((int *)handle), position, SEEK_CUR); - break; } if (0xffffffff == finalPos) @@ -1110,7 +1110,7 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) if (dip == NULL) return false; - while (d = readdir(dip)) + while ((d = readdir(dip))) { bool isDir = false; if (d->d_type == DT_UNKNOWN) @@ -1229,14 +1229,14 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite) // Iterate through and grab valid directories ////////////////////////////////////////////////////////////////////////// - while (d = readdir(dip)) + while ((d = readdir(dip))) { bool isDir; isDir = false; if (d->d_type == DT_UNKNOWN) { char child [1024]; - if ((Path[dStrlen(Path) - 1] == '/')) + if (Path[dStrlen(Path) - 1] == '/') dSprintf(child, 1024, "%s%s", Path, d->d_name); else dSprintf(child, 1024, "%s/%s", Path, d->d_name); diff --git a/Engine/source/renderInstance/renderImposterMgr.cpp b/Engine/source/renderInstance/renderImposterMgr.cpp index d93c6c620..e0b8b3156 100644 --- a/Engine/source/renderInstance/renderImposterMgr.cpp +++ b/Engine/source/renderInstance/renderImposterMgr.cpp @@ -152,7 +152,7 @@ void RenderImposterMgr::_innerRender( const SceneRenderState *state, RenderDefer // Setup a static index buffer for rendering. mIB.set( GFX, smImposterBatchSize * 6, 0, GFXBufferTypeStatic ); U16 *idxBuff; - mIB.lock(&idxBuff, NULL, NULL, NULL); + mIB.lock(&idxBuff, NULL, 0, 0); for ( U32 i=0; i < smImposterBatchSize; i++ ) { // diff --git a/Engine/source/renderInstance/renderPassStateToken.cpp b/Engine/source/renderInstance/renderPassStateToken.cpp index 560fb40f3..c00b05cdf 100644 --- a/Engine/source/renderInstance/renderPassStateToken.cpp +++ b/Engine/source/renderInstance/renderPassStateToken.cpp @@ -86,7 +86,7 @@ static const char *_get_enable(void* obj, const char* data) void RenderPassStateToken::initPersistFields() { - addProtectedField("enabled", TypeBool, NULL, &_set_enable, &_get_enable, "Enables or disables this token."); + addProtectedField("enabled", TypeBool, 0, &_set_enable, &_get_enable, "Enables or disables this token."); Parent::initPersistFields(); } diff --git a/Engine/source/scene/mixin/scenePolyhedralObject.impl.h b/Engine/source/scene/mixin/scenePolyhedralObject.impl.h index 4ce8998f0..32ec98e71 100644 --- a/Engine/source/scene/mixin/scenePolyhedralObject.impl.h +++ b/Engine/source/scene/mixin/scenePolyhedralObject.impl.h @@ -44,15 +44,15 @@ void ScenePolyhedralObject< Base, P >::initPersistFields() { Parent::addGroup( "Internal" ); - Parent::addProtectedField( "plane", TypeRealString, NULL, + Parent::addProtectedField( "plane", TypeRealString, 0, &_setPlane, &defaultProtectedGetFn, "For internal use only.", AbstractClassRep::FIELD_HideInInspectors ); - Parent::addProtectedField( "point", TypeRealString, NULL, + Parent::addProtectedField( "point", TypeRealString, 0, &_setPoint, &defaultProtectedGetFn, "For internal use only.", AbstractClassRep::FIELD_HideInInspectors ); - Parent::addProtectedField( "edge", TypeRealString, NULL, + Parent::addProtectedField( "edge", TypeRealString, 0, &_setEdge, &defaultProtectedGetFn, "For internal use only.", AbstractClassRep::FIELD_HideInInspectors ); diff --git a/Engine/source/sim/actionMap.cpp b/Engine/source/sim/actionMap.cpp index 40a41aa06..117278aff 100644 --- a/Engine/source/sim/actionMap.cpp +++ b/Engine/source/sim/actionMap.cpp @@ -1962,7 +1962,7 @@ void ContextAction::processTick() if (mActive) { F32 currTime = Sim::getCurrentTime(); - static const char *argv[2]; + static const char *argv[3]; //see if this key even is still active if (!mBreakEvent) diff --git a/Engine/source/sim/actionMap.h b/Engine/source/sim/actionMap.h index 26caffe7b..840dd70f9 100644 --- a/Engine/source/sim/actionMap.h +++ b/Engine/source/sim/actionMap.h @@ -92,7 +92,7 @@ class ActionMap : public SimObject U32 deviceInst; Vector nodeMap; - DeviceMap():deviceType(NULL), deviceInst(NULL){ + DeviceMap():deviceType(0), deviceInst(0){ VECTOR_SET_ASSOCIATION(nodeMap); } ~DeviceMap(); diff --git a/Engine/source/sim/netObject.cpp b/Engine/source/sim/netObject.cpp index 25c5e3657..0a33379ec 100644 --- a/Engine/source/sim/netObject.cpp +++ b/Engine/source/sim/netObject.cpp @@ -407,7 +407,7 @@ DefineEngineMethod( NetObject, getClientObject, S32, (),, if ( obj ) return obj->getId(); - return NULL; + return 0; } //ConsoleMethod( NetObject, getClientObject, S32, 2, 2, "Short-Circuit-Netorking: this is only valid for a local-client / singleplayer situation." ) @@ -439,7 +439,7 @@ DefineEngineMethod( NetObject, getServerObject, S32, (),, if ( obj ) return obj->getId(); - return NULL; + return 0; } //ConsoleMethod( NetObject, getServerObject, S32, 2, 2, "Short-Circuit-Netorking: this is only valid for a local-client / singleplayer situation." ) diff --git a/Engine/source/ts/tsShape.cpp b/Engine/source/ts/tsShape.cpp index b3026a98a..36825014b 100644 --- a/Engine/source/ts/tsShape.cpp +++ b/Engine/source/ts/tsShape.cpp @@ -74,7 +74,7 @@ TSShape::TSShape() mRadius = 0; mFlags = 0; tubeRadius = 0; - data = NULL; + data = 0; materialList = NULL; mReadVersion = -1; // -1 means constructed from scratch (e.g., in exporter or no read yet) mSequencesConstructed = false; @@ -225,11 +225,7 @@ const String& TSShape::getTargetName( S32 mapToNameIndex ) const S32 TSShape::getTargetCount() const { - if(!this) - return -1; - return materialList->getMaterialNameList().size(); - } S32 TSShape::findNode(S32 nameIndex) const diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index 08dbc21c2..6f53670b8 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -357,7 +357,7 @@ void TSShapeConstructor::initPersistFields() endGroup("Collada"); addGroup("Sequences"); - addProtectedField("sequence", TypeStringFilename, NULL, &addSequenceFromField, &emptyStringProtectedGetFn, + addProtectedField("sequence", TypeStringFilename, 0, &addSequenceFromField, &emptyStringProtectedGetFn, "Legacy method of adding sequences to a DTS or DAE shape after loading.\n\n" "@tsexample\n" "singleton TSShapeConstructor(MyShapeDae)\n"