diff --git a/engine/client/application/Miff/src/linux/parser.lex b/engine/client/application/Miff/src/linux/parser.lex index 16e30011..f80c2c9b 100644 --- a/engine/client/application/Miff/src/linux/parser.lex +++ b/engine/client/application/Miff/src/linux/parser.lex @@ -387,7 +387,7 @@ int yyerror(char *err) /* called by yyparse() */ MIFFSetError(); /* set global error flag for shell as well */ yyterminate(); } - + return 0; } /*-------------------------** diff --git a/engine/client/application/Miff/src/linux/parser.yac b/engine/client/application/Miff/src/linux/parser.yac index b40006e4..25feaf7e 100644 --- a/engine/client/application/Miff/src/linux/parser.yac +++ b/engine/client/application/Miff/src/linux/parser.yac @@ -823,7 +823,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget) sPtr++; if (numIndex > 3) { - sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)! [more then 3 digits]", *sPtr); + sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)! [more then 3 digits]"); yyerror(err_msg); exitParser = 1; } @@ -841,7 +841,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget) if (tempNum > 255) { - sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)!", tempNum); + sprintf(err_msg, "Escape sequence Octal numbers greater then\noctal o400 (256 decimal)!"); yyerror(err_msg); exitParser = 1; } @@ -865,7 +865,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget) sPtr++; if (numIndex > 3) { - sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)! [more then 3 digits]", *sPtr); + sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)! [more then 3 digits]"); yyerror(err_msg); exitParser = 1; } @@ -883,7 +883,7 @@ void parseESCstring(char *str, char *targetBuffer, int sizeOfTarget) if (tempNum > 255) { - sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)!", *sPtr); + sprintf(err_msg, "Escape sequence HEX numbers greater then 0x100\n(256 decimal)!"); yyerror(err_msg); exitParser = 1; } @@ -985,7 +985,7 @@ void addEnumSymbol(char *symString, long value) if (MAX_SYMCHARS < strlen(symString)) { /* somebody insane decided to use variable longer then max size! */ - sprintf(err_msg, "%s is longer then %d characters! [value: %d]", symString, MAX_SYMCHARS, value); + sprintf(err_msg, "%s is longer then %d characters! [value: %ld]", symString, MAX_SYMCHARS, value); yyerror(err_msg); } else diff --git a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp index a25d2c54..9f71e8c3 100644 --- a/engine/server/application/ChatServer/src/shared/ChatInterface.cpp +++ b/engine/server/application/ChatServer/src/shared/ChatInterface.cpp @@ -1851,7 +1851,7 @@ void ChatInterface::OnReceiveForcedLogout(const ChatAvatar *oldAvatar) ChatServer::fileLog(false, "ChatInterface", "OnReceiveForcedLogout() oldAvatar(%s)", ChatServer::getFullChatAvatarName(oldAvatar).c_str()); PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceiveForcedLogout"); - if ((oldAvatar == NULL)) + if (oldAvatar == NULL) { DEBUG_WARNING(true, ("We received an OnReceiveForcedLogout with a success result code but NULL data. This is an error that the API should never give.")); return; @@ -2877,7 +2877,7 @@ void ChatInterface::OnReceivePersistentMessage(const ChatAvatar *destAvatar, con ChatServer::fileLog(false, "ChatInterface", "OnReceivePersistentMessage() destAvatar(%s)", ChatServer::getFullChatAvatarName(destAvatar).c_str()); PROFILER_AUTO_BLOCK_DEFINE("ChatInterface - OnReceivePersistentMessage"); - if ((destAvatar == NULL)) + if (destAvatar == NULL) { DEBUG_WARNING(true, ("We received an OnREceivePersistentMessage with a success result code but NULL data. This is an error that the API should never give.")); return; diff --git a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserSpaceAi.cpp b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserSpaceAi.cpp index d596f78c..9972dcf5 100644 --- a/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserSpaceAi.cpp +++ b/engine/server/library/serverGame/src/shared/console/ConsoleCommandParserSpaceAi.cpp @@ -119,7 +119,8 @@ bool ConsoleCommandParserSpaceAi::performParsing(const NetworkId & userId, const { Vector const & position_w = iterTransformList->getPosition_p(); - message += formattedString.sprintf("[%d] %.2f, %.2f, %.2f%s", index++, position_w.x, position_w.y, position_w.z, (index < static_cast(transformList.size())) ? "\n" : ""); + message += formattedString.sprintf("[%d] %.2f, %.2f, %.2f%s", (index+1), position_w.x, position_w.y, position_w.z, (index < static_cast(transformList.size())) ? "\n" : ""); + index++; } Chat::sendSystemMessage(*serverObject, Unicode::narrowToWide(message.c_str()), Unicode::emptyString); diff --git a/engine/server/library/serverGame/src/shared/controller/AiShipController.cpp b/engine/server/library/serverGame/src/shared/controller/AiShipController.cpp index b14698b3..d2bf69f7 100644 --- a/engine/server/library/serverGame/src/shared/controller/AiShipController.cpp +++ b/engine/server/library/serverGame/src/shared/controller/AiShipController.cpp @@ -1648,7 +1648,7 @@ void AiShipController::sendDebugAiToClients(AiDebugString & aiDebugString) float const turretMissChance = getTurretMissChance() * 100.0f; float const turretMissAngleDegrees = convertRadiansToDegrees(getTurretMissAngle()); - aiDebugString.addText(formattedString.sprintf("turret miss(%.0f%% @ %.0f°)\n", turretMissChance, turretMissAngleDegrees)); + aiDebugString.addText(formattedString.sprintf("turret miss(%.0f%% @ %.0f)\n", turretMissChance, turretMissAngleDegrees)); } } diff --git a/engine/shared/library/sharedGame/src/shared/core/LfgCharacterData.cpp b/engine/shared/library/sharedGame/src/shared/core/LfgCharacterData.cpp index 21d8d4b5..31a0e655 100644 --- a/engine/shared/library/sharedGame/src/shared/core/LfgCharacterData.cpp +++ b/engine/shared/library/sharedGame/src/shared/core/LfgCharacterData.cpp @@ -616,7 +616,7 @@ Unicode::String const & LfgCharacterData::getProfessionDisplayString(LfgCharacte static Unicode::String empty; - if ((static_cast(profession) >= 0) && (static_cast(profession) < s_professionDisplayString.size())) + if ((static_cast(profession) >= 0) && (static_cast(profession) < s_professionDisplayString.size())) return s_professionDisplayString[static_cast(profession)]; return empty; diff --git a/engine/shared/library/sharedGame/src/shared/objectTemplate/SharedCreatureObjectTemplate.cpp b/engine/shared/library/sharedGame/src/shared/objectTemplate/SharedCreatureObjectTemplate.cpp index 36f524dc..5254f31c 100644 --- a/engine/shared/library/sharedGame/src/shared/objectTemplate/SharedCreatureObjectTemplate.cpp +++ b/engine/shared/library/sharedGame/src/shared/objectTemplate/SharedCreatureObjectTemplate.cpp @@ -343,7 +343,7 @@ float SharedCreatureObjectTemplate::getAcceleration(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_acceleration[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -392,7 +392,7 @@ float SharedCreatureObjectTemplate::getAccelerationMin(MovementTypes index) cons base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_acceleration[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -441,7 +441,7 @@ float SharedCreatureObjectTemplate::getAccelerationMax(MovementTypes index) cons base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_acceleration[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -490,7 +490,7 @@ float SharedCreatureObjectTemplate::getSpeed(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_speed[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -539,7 +539,7 @@ float SharedCreatureObjectTemplate::getSpeedMin(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_speed[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -588,7 +588,7 @@ float SharedCreatureObjectTemplate::getSpeedMax(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_speed[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -637,7 +637,7 @@ float SharedCreatureObjectTemplate::getTurnRate(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_turnRate[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -686,7 +686,7 @@ float SharedCreatureObjectTemplate::getTurnRateMin(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_turnRate[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) @@ -735,7 +735,7 @@ float SharedCreatureObjectTemplate::getTurnRateMax(MovementTypes index) const base = dynamic_cast(m_baseData); } - DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range")); + DEBUG_FATAL(static_cast(index) < 0 || static_cast(index) >= 2, ("template param index out of range")); if (!m_turnRate[index].isLoaded()) { if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL) diff --git a/engine/shared/library/sharedGame/src/shared/space/NebulaManager.cpp b/engine/shared/library/sharedGame/src/shared/space/NebulaManager.cpp index b5035cb7..568c44e2 100644 --- a/engine/shared/library/sharedGame/src/shared/space/NebulaManager.cpp +++ b/engine/shared/library/sharedGame/src/shared/space/NebulaManager.cpp @@ -200,7 +200,7 @@ void NebulaManager::loadSceneData(std::string const & sceneId) { //-- apparently not a space scene // @todo: need better way to detect this - if (!strncmp(sceneId.c_str(), "space_", 6) != 0) + if (!(strncmp(sceneId.c_str(), "space_", 6) != 0)) WARNING(true, ("NebulaManager no such datatable [%s]", filename.c_str())); return; } diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp index f8d7d1cc..cfa25007 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.cpp @@ -170,7 +170,7 @@ namespace Base return bytes; } - bool Base64::UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, unsigned *destLen) + bool Base64::UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, int *destLen) { unsigned char q[3]; unsigned index; diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.h b/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.h index 73542495..6f1d0858 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.h +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/Base64.h @@ -15,7 +15,7 @@ namespace Base public: static bool UUEncode(const unsigned char *source, unsigned sourceLen, char *dest, unsigned destLen); static bool UUEncode(const unsigned char *source, unsigned sourceLen, std::string &destString); - static bool UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, unsigned *destLen); + static bool UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, int *destLen); static bool UUDecode(const char *source, unsigned sourceLen, std::string &destString); // these don't *exactly* belong here, but it's a convenient place for them diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp index 40d5c384..efc420f3 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.cpp @@ -168,7 +168,7 @@ namespace soe return bytes; } - bool Base64::UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, unsigned *destLen) + bool Base64::UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, int *destLen) { unsigned char q[3]; unsigned index; diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.h index ac450794..3a863587 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/Base64.h @@ -13,7 +13,7 @@ namespace soe static bool UUEncode(const unsigned char *source, unsigned sourceLen, std::string &destString); static bool UUEncode(const std::vector &source, char *dest, unsigned destLen); static bool UUEncode(const std::vector &source, std::string &destString); - static bool UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, unsigned *destLen); + static bool UUDecode(const char *source, unsigned sourceLen, unsigned char *dest, int *destLen); static bool UUDecode(const char *source, unsigned sourceLen, std::vector &destVector); static bool UUDecode(const char *source, unsigned sourceLen, std::string &destString); diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeStringVector.h b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeStringVector.h index f27f37ad..7beccb4d 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeStringVector.h +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/serializeStringVector.h @@ -221,9 +221,6 @@ namespace soe return bytes; } - operator stringVector_t () { return *this; } - - //unsigned Read(const unsigned char * stream, unsigned size); //DECLARE_SCRIBE_MEMBERS };