From 2f48f31a6f24927a7721f229f17e7b500ef44653 Mon Sep 17 00:00:00 2001 From: Vincent Gee Date: Wed, 5 Nov 2014 23:29:08 -0500 Subject: [PATCH] Fixed String comparisons. --- Engine/source/T3D/aiClient.cpp | 2 +- Engine/source/console/consoleFunctions.cpp | 2 +- Engine/source/console/persistenceManager.cpp | 4 ++-- Engine/source/gui/controls/guiTreeViewCtrl.cpp | 2 +- Engine/source/sfx/sfxSystem.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Engine/source/T3D/aiClient.cpp b/Engine/source/T3D/aiClient.cpp index b1572c713..0fab8f428 100644 --- a/Engine/source/T3D/aiClient.cpp +++ b/Engine/source/T3D/aiClient.cpp @@ -547,7 +547,7 @@ DefineConsoleFunction( aiAddPlayer, S32, (const char * name, const char * ns), ( aiPlayer->onConnect_callback( name ); // Now execute the onAdd command and feed it the namespace - if( ns != "" ) + if(dStrcmp( ns,"" ) != 0 ) aiPlayer->onAdd( ns ); else aiPlayer->onAdd( "AIClient" ); diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index f963de8f5..17a0740a9 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -2382,7 +2382,7 @@ DefineConsoleFunction( isDefined, bool, ( const char* varName, const char* varVa // Is it an object? if (dStrcmp(varName, "0") && dStrcmp(varName, "") && (Sim::findObject(varName) != NULL)) return true; - else if (varValue != "") + else if (dStrcmp(varValue, "" ) != 0) { Con::errorf("%s() - can't assign a value to a variable of the form \"%s\"", __FUNCTION__, varValue); } diff --git a/Engine/source/console/persistenceManager.cpp b/Engine/source/console/persistenceManager.cpp index b37a293bc..19a903d43 100644 --- a/Engine/source/console/persistenceManager.cpp +++ b/Engine/source/console/persistenceManager.cpp @@ -2201,7 +2201,7 @@ DefineConsoleMethod( PersistenceManager, setDirty, void, ( const char * objName "Mark an existing SimObject as dirty (will be written out when saveDirty() is called).") { SimObject *dirtyObject = NULL; - if (objName != "") + if (dStrcmp(objName,"") != 0) { if (!Sim::findObject(objName, dirtyObject)) { @@ -2387,7 +2387,7 @@ DefineConsoleMethod( PersistenceManager, removeField, void, (const char * objNam if (dirtyObject) { - if (fieldName != "") + if (dStrcmp(fieldName,"") != 0) object->addRemoveField(dirtyObject, fieldName); } } diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index b27614e72..e103e1403 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -5114,7 +5114,7 @@ DefineConsoleMethod(GuiTreeViewCtrl, moveItemDown, void, (S32 index), , "(TreeIt DefineConsoleMethod(GuiTreeViewCtrl, getTextToRoot, const char*, (S32 itemId, const char * delimiter), , "(TreeItemId item,Delimiter=none) gets the text from the current node to the root, concatenating at each branch upward, with a specified delimiter optionally") { - if ( delimiter == "" ) + if (!dStrcmp(delimiter, "" )) { Con::warnf("GuiTreeViewCtrl::getTextToRoot - Invalid number of arguments!"); return (""); diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index 696644026..145c1f3ff 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -1566,11 +1566,11 @@ DefineConsoleFunction( sfxPlay, S32, ( const char * trackName, const char * poin } Point3F pos(0.f, 0.f, 0.f); - if ( pointOrX != "" && y == ""&& z == "" ) + if (dStrcmp( pointOrX, "" ) != 0 && dStrcmp( y, "" ) == 0 && dStrcmp( z, "" ) == 0 ) { dSscanf( pointOrX, "%g %g %g", &pos.x, &pos.y, &pos.z ); } - else if( pointOrX != "" && y != "" && z != "" ) + else if(dStrcmp( pointOrX, "" ) != 0 && dStrcmp( y, "" ) != 0 && dStrcmp( z, "" ) != 0 ) pos.set( dAtof(pointOrX), dAtof(y), dAtof(z) ); MatrixF transform;