Merge branch 'master' into 'master'

still fixing things despite debug builds being broken due to a macro firing on a null pointer



See merge request !10
This commit is contained in:
DarthArgus
2015-10-16 15:10:16 -04:00
13 changed files with 26 additions and 28 deletions
@@ -387,7 +387,7 @@ int yyerror(char *err) /* called by yyparse() */
MIFFSetError(); /* set global error flag for shell as well */
yyterminate();
}
return 0;
}
/*-------------------------**
@@ -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
@@ -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;
@@ -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<int>(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<int>(transformList.size())) ? "\n" : "");
index++;
}
Chat::sendSystemMessage(*serverObject, Unicode::narrowToWide(message.c_str()), Unicode::emptyString);
@@ -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));
}
}
@@ -616,7 +616,7 @@ Unicode::String const & LfgCharacterData::getProfessionDisplayString(LfgCharacte
static Unicode::String empty;
if ((static_cast<size_t>(profession) >= 0) && (static_cast<size_t>(profession) < s_professionDisplayString.size()))
if ((static_cast<int>(profession) >= 0) && (static_cast<int>(profession) < s_professionDisplayString.size()))
return s_professionDisplayString[static_cast<size_t>(profession)];
return empty;
@@ -343,7 +343,7 @@ float SharedCreatureObjectTemplate::getAcceleration(MovementTypes index) const
base = dynamic_cast<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(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<const SharedCreatureObjectTemplate *>(m_baseData);
}
DEBUG_FATAL(index < 0 || index >= 2, ("template param index out of range"));
DEBUG_FATAL(static_cast<int>(index) < 0 || static_cast<int>(index) >= 2, ("template param index out of range"));
if (!m_turnRate[index].isLoaded())
{
if (ms_allowDefaultTemplateParams && /*!m_versionOk &&*/ base == NULL)
@@ -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;
}
@@ -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;
@@ -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
@@ -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;
@@ -13,7 +13,7 @@ namespace soe
static bool UUEncode(const unsigned char *source, unsigned sourceLen, std::string &destString);
static bool UUEncode(const std::vector<unsigned char> &source, char *dest, unsigned destLen);
static bool UUEncode(const std::vector<unsigned char> &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<unsigned char> &destVector);
static bool UUDecode(const char *source, unsigned sourceLen, std::string &destString);
@@ -221,9 +221,6 @@ namespace soe
return bytes;
}
operator stringVector_t () { return *this; }
//unsigned Read(const unsigned char * stream, unsigned size);
//DECLARE_SCRIBE_MEMBERS
};