fixing format strings

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-20 18:39:00 -07:00
parent 45dcbb96ba
commit e98bab8a75
6 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -288,7 +288,7 @@ AZ_POP_DISABLE_WARNING
str += "Version Unknown";
}
}
azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, " %d.%d", OSVerInfo.dwMajorVersion, OSVerInfo.dwMinorVersion);
azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, " %ld.%ld", OSVerInfo.dwMajorVersion, OSVerInfo.dwMinorVersion);
str += szBuffer;
//////////////////////////////////////////////////////////////////////
@@ -338,7 +338,7 @@ AZ_POP_DISABLE_WARNING
str += " ";
azstrdate(szBuffer);
str += szBuffer;
azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, ", system running for %d minutes", GetTickCount() / 60000);
azsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, ", system running for %ld minutes", GetTickCount() / 60000);
str += szBuffer;
CryLog("%s", str.toUtf8().data());
#else
+2 -2
View File
@@ -48,7 +48,7 @@ inline bool GuidUtil::IsEmpty(REFGUID guid)
inline const char* GuidUtil::ToString(REFGUID guid)
{
static char guidString[64];
sprintf_s(guidString, "{%.8X-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
sprintf_s(guidString, "{%.8lX-%.4X-%.4X-%.2X%.2X-%.2X%.2X%.2X%.2X%.2X%.2X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1],
guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
return guidString;
}
@@ -62,7 +62,7 @@ inline GUID GuidUtil::FromString(const char* guidString)
guid.Data1 = 0;
guid.Data2 = 0;
guid.Data3 = 0;
azsscanf(guidString, "{%8" SCNx32 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}",
azsscanf(guidString, "{%8lX-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}",
&guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]);
guid.Data4[0] = static_cast<unsigned char>(d[0]);
guid.Data4[1] = static_cast<unsigned char>(d[1]);
@@ -145,7 +145,7 @@ namespace AZ
char message[g_maxMessageLength];
Debug::Trace::Instance().Output(nullptr, "==================================================================\n");
azsnprintf(message, g_maxMessageLength, "Exception : 0x%X - '%s' [%p]\n", ExceptionInfo->ExceptionRecord->ExceptionCode, GetExeptionName(ExceptionInfo->ExceptionRecord->ExceptionCode), ExceptionInfo->ExceptionRecord->ExceptionAddress);
azsnprintf(message, g_maxMessageLength, "Exception : 0x%lX - '%s' [%p]\n", ExceptionInfo->ExceptionRecord->ExceptionCode, GetExeptionName(ExceptionInfo->ExceptionRecord->ExceptionCode), ExceptionInfo->ExceptionRecord->ExceptionAddress);
Debug::Trace::Instance().Output(nullptr, message);
EBUS_EVENT(Debug::TraceMessageDrillerBus, OnException, message);
@@ -478,7 +478,7 @@ namespace AZ {
DWORD displacement;
if (g_SymGetLineFromAddr64(g_currentProcess, pc, &displacement, &line) && line.FileName[0] != 0)
{
azsnprintf(textLine, textLineSize, "%s (%d) : ", line.FileName, line.LineNumber);
azsnprintf(textLine, textLineSize, "%s (%ld) : ", line.FileName, line.LineNumber);
}
else
{
+1 -1
View File
@@ -1707,7 +1707,7 @@ TEST_F(GridMateCarrierTestFixture, Test_GetSocketErrorString)
static constexpr char posixErrorWouldBlockPosixErrStr[] = "Resource temporarily unavailable";
azsnprintf(expectedBuffer.data(), expectedBuffer.size()-1 , "%s", posixErrorWouldBlockPosixErrStr);
#else
azsnprintf(expectedBuffer.data(), expectedBuffer.size()-1 , "%d", AZ_EWOULDBLOCK);
azsnprintf(expectedBuffer.data(), expectedBuffer.size()-1 , "%ld", AZ_EWOULDBLOCK);
#endif // !AZ_TRAIT_USE_POSIX_STRERROR_R
EXPECT_STREQ(expectedBuffer.data(), socketErrorString);
EXPECT_STREQ(expectedBuffer.data(), buffer.data());
+2 -2
View File
@@ -284,7 +284,7 @@ int DebugCallStack::handleException(EXCEPTION_POINTERS* exception_pointer)
char excAddr[80];
WriteLineToLog("<CRITICAL EXCEPTION>");
sprintf_s(excAddr, "0x%04X:0x%p", exception_pointer->ContextRecord->SegCs, exception_pointer->ExceptionRecord->ExceptionAddress);
sprintf_s(excCode, "0x%08X", exception_pointer->ExceptionRecord->ExceptionCode);
sprintf_s(excCode, "0x%08lX", exception_pointer->ExceptionRecord->ExceptionCode);
WriteLineToLog("Exception: %s, at Address: %s", excCode, excAddr);
}
@@ -445,7 +445,7 @@ void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex)
else
{
sprintf_s(excAddr, "0x%04X:0x%p", pex->ContextRecord->SegCs, pex->ExceptionRecord->ExceptionAddress);
sprintf_s(excCode, "0x%08X", pex->ExceptionRecord->ExceptionCode);
sprintf_s(excCode, "0x%08lX", pex->ExceptionRecord->ExceptionCode);
excName = TranslateExceptionCode(pex->ExceptionRecord->ExceptionCode);
azstrcpy(desc, AZ_ARRAY_SIZE(desc), "");
sprintf_s(excDesc, "%s\r\n%s", excName, desc);