diff --git a/engine/client/application/Miff/src/lex_yy.c b/engine/client/application/Miff/src/lex_yy.c index 449b767d..e9bd0436 100644 --- a/engine/client/application/Miff/src/lex_yy.c +++ b/engine/client/application/Miff/src/lex_yy.c @@ -4520,7 +4520,7 @@ static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strnlen (yyconst char * ); #endif #ifndef YY_NO_INPUT @@ -4726,9 +4726,9 @@ YY_RULE_SETUP char *s; // allocate space for string and pass the string pointer rather then yytext count(); - s = MIFFallocString(strlen(yytext) + 1); + s = MIFFallocString(strnlen(yytext) + 1); strcpy(s, yytext+1); /* strip off the double quotes */ - s[strlen(yytext+1)-1] = 0; /* strip off the ending double quotes */ + s[strnlen(yytext+1)-1] = 0; /* strip off the ending double quotes */ yylval.stype = s; return(STR_LIT); } @@ -4977,7 +4977,7 @@ YY_RULE_SETUP char *s; // allocate space for string and pass the string pointer rather then yytext count(); - s = MIFFallocString(strlen(yytext) + 1); + s = MIFFallocString(strnlen(yytext) + 1); strcpy(s, yytext); yylval.stype = s; return(IDENTIFIER); @@ -5915,7 +5915,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - return yy_scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes(yystr,strnlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will @@ -6126,7 +6126,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strnlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) @@ -6219,7 +6219,7 @@ void yyerror(char *err) /* called by yyparse() */ **-------------------------*/ int MIFFYYInput(char *buf,int max_size) { - int len = strlen(MIFFInputStream); + int len = strnlen(MIFFInputStream); int n = max_size < len ? max_size : len; if (n > 0) { diff --git a/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp b/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp index a8d33802..9b94409a 100644 --- a/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp +++ b/engine/server/library/serverGame/src/shared/core/ServerWorld.cpp @@ -199,18 +199,11 @@ void compare_results_int( std::set &results, std::setgetOwner(); - if ( &volumeOwner == NULL ) - { - LOG("SphereGrid", ("Ack null owner!")); - } - else - { - const Object* pob = getContainingPobForObjectInWorld(volume->getOwner()); - Sphere const &localSphere = volumeOwner.getLocalSphere(); - Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius()); - Vector c=world.getCenter(); - LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) )); - } + const Object* pob = getContainingPobForObjectInWorld(volume->getOwner()); + Sphere const &localSphere = volumeOwner.getLocalSphere(); + Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius()); + Vector c=world.getCenter(); + LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) )); } LOG("SphereGrid", ("------------------ Grid Results %d ------------------",results2.size())); @@ -218,18 +211,11 @@ void compare_results_int( std::set &results, std::setgetOwner(); - if ( &volumeOwner == NULL ) - { - LOG("SphereGrid", ("shit null owner.")); - } - else - { - const Object* pob = getContainingPobForObjectInWorld(volume->getOwner()); - Sphere const &localSphere = volumeOwner.getLocalSphere(); - Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius()); // o2p or o2w - Vector c=world.getCenter(); - LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) )); - } + const Object* pob = getContainingPobForObjectInWorld(volume->getOwner()); + Sphere const &localSphere = volumeOwner.getLocalSphere(); + Sphere world(volumeOwner.getTransform_o2w().rotateTranslate_l2p(localSphere.getCenter()), volume->getRadius()); // o2p or o2w + Vector c=world.getCenter(); + LOG("SphereGrid",(" (%f %f %f) %f POB = %p DIST=%f",c.x,c.y,c.z,world.getRadius(),pob, c.magnitudeBetween(v) )); } DEBUG_FATAL(true,("FATAL: SphereGrid failed to match SphereTree result set.")); diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp index 0fe535e5..2800d79b 100644 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp @@ -11892,7 +11892,7 @@ void CreatureObject::setNumberOfMissionsWantedInMissionBag(int n) { // remove mission objects from the bag int j = 0; - for (iter = container->begin(), j = 0; iter != container->end(), j < i - n; ++iter, ++j) + for (iter = container->begin(), j = 0; (iter != container->end() && j < i - n); ++iter, ++j) { Object * const o = (*iter).getObject(); if (o) diff --git a/engine/server/library/serverGame/src/shared/objectTemplate/ServerCreatureObjectTemplate.cpp b/engine/server/library/serverGame/src/shared/objectTemplate/ServerCreatureObjectTemplate.cpp index e5ba5655..babf8d0a 100644 --- a/engine/server/library/serverGame/src/shared/objectTemplate/ServerCreatureObjectTemplate.cpp +++ b/engine/server/library/serverGame/src/shared/objectTemplate/ServerCreatureObjectTemplate.cpp @@ -168,7 +168,7 @@ int ServerCreatureObjectTemplate::getAttributes(Attributes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 6, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 6, ("template param static_cast(index) getAttribModsCount(); - if (index < baseCount) + if (static_cast(index) < baseCount) { base->getAttribMods(data, index); return; @@ -1403,7 +1403,7 @@ void ServerCreatureObjectTemplate::getAttribMods(AttribMod &data, int index) con index -= baseCount; } - DEBUG_FATAL(index < 0 || static_cast(index) >= m_attribMods.size(), ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= m_attribMods.size(), ("template param static_cast(index) (structTemplate); @@ -1441,7 +1441,7 @@ void ServerCreatureObjectTemplate::getAttribModsMin(AttribMod &data, int index) if (m_attribModsAppend && base != NULL) { int baseCount = base->getAttribModsCount(); - if (index < baseCount) + if (static_cast(index) < baseCount) { base->getAttribModsMin(data, index); return; @@ -1449,7 +1449,7 @@ void ServerCreatureObjectTemplate::getAttribModsMin(AttribMod &data, int index) index -= baseCount; } - DEBUG_FATAL(index < 0 || static_cast(index) >= m_attribMods.size(), ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= m_attribMods.size(), ("template param static_cast(index) (structTemplate); @@ -1487,7 +1487,7 @@ void ServerCreatureObjectTemplate::getAttribModsMax(AttribMod &data, int index) if (m_attribModsAppend && base != NULL) { int baseCount = base->getAttribModsCount(); - if (index < baseCount) + if (static_cast(index) < baseCount) { base->getAttribModsMax(data, index); return; @@ -1495,7 +1495,7 @@ void ServerCreatureObjectTemplate::getAttribModsMax(AttribMod &data, int index) index -= baseCount; } - DEBUG_FATAL(index < 0 || static_cast(index) >= m_attribMods.size(), ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= m_attribMods.size(), ("template param static_cast(index) (structTemplate); @@ -2007,7 +2007,7 @@ float ServerCreatureObjectTemplate::getMaxMentalStates(MentalStates index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 4, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 4, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 4, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 4, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 4, ("template param static_cast(index) (m_baseData); } - DEBUG_FATAL(index < 0 || index >= 4, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 4, ("template param static_cast(index) inline T *NonNull(T *pointer, const char *name) { - FATAL(!pointer, ("%s pointer is null", name)); + WARNING(!pointer, ("%s pointer is null", name)); return pointer; } diff --git a/engine/shared/library/sharedMath/src/shared/MxCifQuadTreeBounds.h b/engine/shared/library/sharedMath/src/shared/MxCifQuadTreeBounds.h index 5ac6d4db..27006c07 100644 --- a/engine/shared/library/sharedMath/src/shared/MxCifQuadTreeBounds.h +++ b/engine/shared/library/sharedMath/src/shared/MxCifQuadTreeBounds.h @@ -20,6 +20,7 @@ class MxCifQuadTreeBounds { public: MxCifQuadTreeBounds(float minX, float minY, float maxX, float maxY, void * data = NULL); + virtual ~MxCifQuadTreeBounds(){}; const float getMinX(void) const; const float getMinY(void) const; diff --git a/engine/shared/library/sharedObject/src/shared/object/AlterScheduler.cpp b/engine/shared/library/sharedObject/src/shared/object/AlterScheduler.cpp index 9ae447a4..e09b9c37 100644 --- a/engine/shared/library/sharedObject/src/shared/object/AlterScheduler.cpp +++ b/engine/shared/library/sharedObject/src/shared/object/AlterScheduler.cpp @@ -1184,7 +1184,7 @@ void AlterScheduler::moveObjectsFromAlterNextFrameListToAlterNowList(int schedul { PROFILER_AUTO_BLOCK_DEFINE("copy next frame"); - if (s_alterNextFrameListFirst != NULL) { + //if (s_alterNextFrameListFirst != NULL) { for (Object *object = s_alterNextFrameListFirst[schedulePhaseIndex]->getNextFromAlterNextFrameList(); object != NULL; ) { //-- Add object to alter now list. This removes the object from the alter next frame list. @@ -1203,7 +1203,7 @@ void AlterScheduler::moveObjectsFromAlterNextFrameListToAlterNowList(int schedul //-- Increment loop. object = nextObject; } - } + //} } } diff --git a/game/server/application/SwgGameServer/src/shared/core/CSHandler.cpp b/game/server/application/SwgGameServer/src/shared/core/CSHandler.cpp index 622cd443..6b1d615d 100644 --- a/game/server/application/SwgGameServer/src/shared/core/CSHandler.cpp +++ b/game/server/application/SwgGameServer/src/shared/core/CSHandler.cpp @@ -80,7 +80,7 @@ namespace CSHandlerNamespace return 0; } - std::string getOneArg( std::string input, unsigned &position ) + std::string getOneArg( std::string input, int position) { unsigned pos; // where we stop looking unsigned lastpos; // the last character in our argument.