diff --git a/Code/Editor/Commands/CommandManager.cpp b/Code/Editor/Commands/CommandManager.cpp index 5f194971f5..4943621493 100644 --- a/Code/Editor/Commands/CommandManager.cpp +++ b/Code/Editor/Commands/CommandManager.cpp @@ -236,10 +236,7 @@ QString CEditorCommandManager::Execute(const AZStd::string& module, const AZStd: } else { - QString errMsg; - - errMsg = QStringLiteral("Error: Trying to execute a unknown command, '%1'!").arg(fullName.c_str()); - CryLogAlways(errMsg.toUtf8().data()); + CryLogAlways("Error: Trying to execute a unknown command, '%s'!", fullName.c_str()); } return ""; @@ -272,10 +269,7 @@ QString CEditorCommandManager::Execute(const AZStd::string& cmdLine) } else { - QString errMsg; - - errMsg = QStringLiteral("Error: Trying to execute a unknown command, '%1'!").arg(cmdLine.c_str()); - CryLogAlways(errMsg.toUtf8().data()); + CryLogAlways("Error: Trying to execute a unknown command, '%s'!", cmdLine.c_str()); } return ""; @@ -294,10 +288,7 @@ void CEditorCommandManager::Execute(int commandId) } else { - QString errMsg; - - errMsg = QStringLiteral("Error: Trying to execute a unknown command of ID '%1'!").arg(commandId); - CryLogAlways(errMsg.toUtf8().data()); + CryLogAlways("Error: Trying to execute a unknown command of ID '%d'!", commandId); } } diff --git a/Code/Editor/ConsoleDialog.cpp b/Code/Editor/ConsoleDialog.cpp index 2f1c3e6f58..7edb12c18c 100644 --- a/Code/Editor/ConsoleDialog.cpp +++ b/Code/Editor/ConsoleDialog.cpp @@ -36,7 +36,7 @@ void CConsoleDialog::SetInfoText(const char* text) { if (gEnv && gEnv->pLog) // before log system was initialized { - CryLogAlways(text); + CryLogAlways("%s", text); } } diff --git a/Code/Editor/LogFile.cpp b/Code/Editor/LogFile.cpp index 92186901d7..0812740efe 100644 --- a/Code/Editor/LogFile.cpp +++ b/Code/Editor/LogFile.cpp @@ -67,7 +67,7 @@ SANDBOX_API void ErrorV(const char* format, va_list argList) str += szBuffer; //CLogFile::WriteLine( str ); - CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, str.toUtf8().data()); + CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, "%s", str.toUtf8().data()); if (!CCryEditApp::instance()->IsInTestMode() && !CCryEditApp::instance()->IsInExportMode() && !CCryEditApp::instance()->IsInLevelLoadTestMode()) { @@ -95,7 +95,7 @@ SANDBOX_API void WarningV(const char* format, va_list argList) char szBuffer[MAX_LOGBUFFER_SIZE]; azvsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, format, argList); - CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, szBuffer); + CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", szBuffer); bool bNoUI = false; ICVar* pCVar = gEnv->pConsole->GetCVar("sys_no_crash_dialog"); @@ -478,7 +478,7 @@ void CLogFile::WriteString(const char* pszString) { if (gEnv && gEnv->pLog) { - gEnv->pLog->LogPlus(pszString); + gEnv->pLog->LogPlus("%s", pszString); } } diff --git a/Code/Editor/Objects/ObjectManager.cpp b/Code/Editor/Objects/ObjectManager.cpp index 8330c4aad7..e053d10fd1 100644 --- a/Code/Editor/Objects/ObjectManager.cpp +++ b/Code/Editor/Objects/ObjectManager.cpp @@ -709,7 +709,7 @@ void CObjectManager::ShowDuplicationMsgWarning(CBaseObject* obj, const QString& ); // If id is taken. - CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, sRenameWarning.toUtf8().data()); + CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", sRenameWarning.toUtf8().data()); if (bShowMsgBox) { diff --git a/Code/Editor/Plugins/FFMPEGPlugin/main.cpp b/Code/Editor/Plugins/FFMPEGPlugin/main.cpp index ce0e91942b..f7d3dfd57b 100644 --- a/Code/Editor/Plugins/FFMPEGPlugin/main.cpp +++ b/Code/Editor/Plugins/FFMPEGPlugin/main.cpp @@ -24,11 +24,7 @@ PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam) // Make sure the ffmpeg command can be executed before registering the command if (!CFFMPEGPlugin::RuntimeTest()) { - AZStd::string msg = - "FFMPEG plugin: Failed to execute FFmepg. Please run Setup Assistant, " - "go to the 'Optional software' section of the 'Install software' tab, " - "and make sure the FFmpeg executable is correctly configured."; - GetIEditor()->GetSystem()->GetILog()->Log(msg.c_str()); + GetIEditor()->GetSystem()->GetILog()->Log("FFMPEG plugin: Failed to execute FFmpeg. Please install FFmpeg."); } else { diff --git a/Code/Editor/PythonEditorFuncs.cpp b/Code/Editor/PythonEditorFuncs.cpp index 342cc607d7..200fd28f87 100644 --- a/Code/Editor/PythonEditorFuncs.cpp +++ b/Code/Editor/PythonEditorFuncs.cpp @@ -313,7 +313,7 @@ namespace { if (strcmp(pMessage, "") != 0) { - CryLogAlways(pMessage); + CryLogAlways("%s", pMessage); } } diff --git a/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp b/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp index 33f1b0d441..b510315995 100644 --- a/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp +++ b/Code/Editor/TrackView/SequenceBatchRenderDialog.cpp @@ -719,8 +719,7 @@ bool CSequenceBatchRenderDialog::GetResolutionFromCustomResText(const char* cust int scannedWidth = retCustomWidth; // initialize with default fall-back values - they'll be overwritten in the case of a succesful sscanf below. int scannedHeight = retCustomHeight; - QString strFormat = QString::fromLatin1(customResFormat).replace(QRegularExpression(QStringLiteral("%\\d")), QStringLiteral("%d")); - scanSuccess = (azsscanf(customResText, strFormat.toStdString().c_str(), &scannedWidth, &scannedHeight) == 2); + scanSuccess = (azsscanf(customResText, "Custom(%d x %d)...", &scannedWidth, &scannedHeight) == 2); if (scanSuccess) { retCustomWidth = scannedWidth; diff --git a/Code/Editor/Util/ImageASC.cpp b/Code/Editor/Util/ImageASC.cpp index a72ea8b9fd..1c4a8acf73 100644 --- a/Code/Editor/Util/ImageASC.cpp +++ b/Code/Editor/Util/ImageASC.cpp @@ -52,7 +52,7 @@ bool CImageASC::Save(const QString& fileName, const CFloatImage& image) } // First print the file header - fprintf(file, fileHeader.c_str()); + fprintf(file, "%s", fileHeader.c_str()); // Then print all the pixels. for (uint32 y = 0; y < height; y++) diff --git a/Code/Editor/Util/ImageUtil.cpp b/Code/Editor/Util/ImageUtil.cpp index c8432a3d1a..45d39f1f02 100644 --- a/Code/Editor/Util/ImageUtil.cpp +++ b/Code/Editor/Util/ImageUtil.cpp @@ -103,7 +103,7 @@ bool CImageUtil::SavePGM(const QString& fileName, const CImageEx& image) } // First print the file header - fprintf(file, fileHeader.c_str()); + fprintf(file, "%s", fileHeader.c_str()); // Then print all the pixels. for (uint32 y = 0; y < height; y++) diff --git a/Code/Editor/Util/MemoryBlock.cpp b/Code/Editor/Util/MemoryBlock.cpp index e840a1735e..b7ae017113 100644 --- a/Code/Editor/Util/MemoryBlock.cpp +++ b/Code/Editor/Util/MemoryBlock.cpp @@ -78,7 +78,7 @@ bool CMemoryBlock::Allocate(int size, int uncompressedSize) { QString str; str = QStringLiteral("CMemoryBlock::Allocate failed to allocate %1Mb of Memory").arg(size / (1024 * 1024)); - CryLogAlways(str.toUtf8().data()); + CryLogAlways("%s", str.toUtf8().data()); QMessageBox::critical(QApplication::activeWindow(), QString(), str + QString("\r\nSandbox will try to reduce its working memory set to free memory for this allocation.")); GetIEditor()->ReduceMemory(); diff --git a/Code/Framework/AzCore/Platform/Android/AzCore/Debug/Trace_Android.cpp b/Code/Framework/AzCore/Platform/Android/AzCore/Debug/Trace_Android.cpp index 07a132d2b9..5bd68b3ed6 100644 --- a/Code/Framework/AzCore/Platform/Android/AzCore/Debug/Trace_Android.cpp +++ b/Code/Framework/AzCore/Platform/Android/AzCore/Debug/Trace_Android.cpp @@ -18,7 +18,7 @@ namespace AZ { void OutputToDebugger([[maybe_unused]] const char* window, [[maybe_unused]] const char* message) { - __android_log_print(ANDROID_LOG_INFO, window, message); + __android_log_print(ANDROID_LOG_INFO, window, "%s", message); } } } diff --git a/Code/Framework/AzFramework/AzFramework/Logging/LogFile.cpp b/Code/Framework/AzFramework/AzFramework/Logging/LogFile.cpp index 506d4a8861..bd9b52fa86 100644 --- a/Code/Framework/AzFramework/AzFramework/Logging/LogFile.cpp +++ b/Code/Framework/AzFramework/AzFramework/Logging/LogFile.cpp @@ -311,7 +311,6 @@ namespace AzFramework // On some platforms, threadid is just a number but on other platforms it is a pointer of some kind // uintptr_t will ensure that the data will always fit uintptr_t threadID = threadId ? threadId : (uintptr_t)(AZStd::this_thread::get_id().m_id); - const char* printFormatter = m_machineReadable ? "~~%p~~%s~~" : "{%p}[%14s]"; // while it may be tempting to check the fileio Pointer here, any emit of any warning or error would be fatal // since we're already logging, and we don't want to log while you log. @@ -331,7 +330,14 @@ namespace AzFramework azsnprintf(buffer, 80, "~~%llu~~%i", rawTime, severity); m_fileIO->Write(m_fileHandle, buffer, strlen(buffer)); - azsnprintf(buffer, 80, printFormatter, threadID, categoryActual); + if (m_machineReadable) // Branching instead of using a ternary on the format string to avoid warning 4774 (format literal expected) + { + azsnprintf(buffer, 80, "~~%p~~%s~~", reinterpret_cast(threadID), categoryActual); + } + else + { + azsnprintf(buffer, 80, "{%p}[%14s]", reinterpret_cast(threadID), categoryActual); + } m_fileIO->Write(m_fileHandle, buffer, strlen(buffer)); m_fileIO->Write(m_fileHandle, dataSource, dataLength); @@ -349,8 +355,14 @@ namespace AzFramework { return; } - - azsnprintf(categorybuffer, 64, printFormatter, threadID, categoryActual); + if (m_machineReadable) // Branching instead of using a ternary on the format string to avoid warning 4774 (format literal expected) + { + azsnprintf(categorybuffer, 64, "~~%p~~%s~~", reinterpret_cast(threadID), categoryActual); + } + else + { + azsnprintf(categorybuffer, 64, "{%p}[%14s]", reinterpret_cast(threadID), categoryActual); + } if ((category) && (categoryLen)) { diff --git a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h index 11ed31e864..6ae09340e3 100644 --- a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h +++ b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ActionDispatcher.h @@ -92,8 +92,7 @@ namespace AzManipulatorTestFramework { if (m_logging) { - AZStd::string message = AZStd::string::format(format, args...); - AZ_Printf("[ActionDispatcher] %s", message.c_str()); + AZ_Printf("ActionDispatcher", format, args...); } } @@ -150,7 +149,7 @@ namespace AzManipulatorTestFramework template DerivedDispatcherT* ActionDispatcher::MouseLButtonDown() { - Log("Mouse left button down"); + Log("%s", "Mouse left button down"); MouseLButtonDownImpl(); return static_cast(this); } @@ -158,7 +157,7 @@ namespace AzManipulatorTestFramework template DerivedDispatcherT* ActionDispatcher::MouseLButtonUp() { - Log("Mouse left button up"); + Log("%s", "Mouse left button up"); MouseLButtonUpImpl(); return static_cast(this); } diff --git a/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp b/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp index ca08142371..34ae4aaf4a 100644 --- a/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp +++ b/Code/Framework/AzManipulatorTestFramework/Source/RetainedModeActionDispatcher.cpp @@ -24,7 +24,7 @@ namespace AzManipulatorTestFramework { const char* error = "Couldn't add action to sequence, dispatcher is locked (you must call ResetSequence() \ before adding actions to this dispatcher)"; - Log(error); + Log("%s", error); AZ_Assert(false, "Error: %s", error); } @@ -108,7 +108,7 @@ namespace AzManipulatorTestFramework RetainedModeActionDispatcher* RetainedModeActionDispatcher::ResetSequence() { - Log("Resetting the action sequence"); + Log("%s", "Resetting the action sequence"); m_actions.clear(); m_dispatcher.ResetEvent(); m_locked = false; diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index 07da69cbe9..f5da40ccad 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -305,10 +305,20 @@ namespace O3DELauncher m_commandLine[m_commandLineLen++] = ' '; } - azsnprintf(m_commandLine + m_commandLineLen, - AZ_COMMAND_LINE_LEN - m_commandLineLen, - needsQuote ? "\"%s\"" : "%s", - arg); + if (needsQuote) // Branching instead of using a ternary on the format string to avoid warning 4774 (format literal expected) + { + azsnprintf(m_commandLine + m_commandLineLen, + AZ_COMMAND_LINE_LEN - m_commandLineLen, + "\"%s\"", + arg); + } + else + { + azsnprintf(m_commandLine + m_commandLineLen, + AZ_COMMAND_LINE_LEN - m_commandLineLen, + "%s", + arg); + } // Inject the argument in the argument buffer to preserve/replicate argC and argV azstrncpy(&m_commandLineArgBuffer[m_nextCommandLineArgInsertPoint], diff --git a/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp b/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp index f158426184..de548a49d7 100644 --- a/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp +++ b/Code/LauncherUnified/Platform/Android/Launcher_Android.cpp @@ -426,7 +426,7 @@ void android_main(android_app* appState) if (status != ReturnCode::Success) { - MAIN_EXIT_FAILURE(appState, GetReturnCodeString(status)); + MAIN_EXIT_FAILURE(appState, "%s", GetReturnCodeString(status)); } } diff --git a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp index a9e0c3d677..a0338941b5 100644 --- a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp @@ -818,9 +818,7 @@ void CLevelSystem::LogLoadingTime() sChain = " (Chained)"; } - AZStd::string text; - text.format("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); - gEnv->pLog->Log(text.c_str()); + gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp index 72d74ea1c1..a82c4a6914 100644 --- a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp @@ -468,10 +468,7 @@ namespace LegacyLevelSystem sChain = " (Chained)"; } - AZStd::string text; - text.format( - "Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); - gEnv->pLog->Log(text.c_str()); + gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CrySystem/Log.cpp b/Code/Legacy/CrySystem/Log.cpp index 68b9621f74..c08d5870e9 100644 --- a/Code/Legacy/CrySystem/Log.cpp +++ b/Code/Legacy/CrySystem/Log.cpp @@ -593,11 +593,11 @@ void CLog::LogPlus(const char* szFormat, ...) if (bfile) { - LogToFilePlus(szTemp); + LogToFilePlus("%s", szTemp); } if (bconsole) { - LogToConsolePlus(szTemp); + LogToConsolePlus("%s", szTemp); } } diff --git a/Code/Legacy/CrySystem/SystemCFG.cpp b/Code/Legacy/CrySystem/SystemCFG.cpp index 7633a62f04..52e377db7f 100644 --- a/Code/Legacy/CrySystem/SystemCFG.cpp +++ b/Code/Legacy/CrySystem/SystemCFG.cpp @@ -188,7 +188,7 @@ void CSystem::LogVersion() #else strftime(s, 128, "Log Started at %c", today); #endif - CryLogAlways(s); + CryLogAlways("%s", s); CryLogAlways("Built on " __DATE__ " " __TIME__); diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 85983975ce..5205b19e19 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -516,95 +516,6 @@ void CSystem::ShutdownModuleLibraries() #endif // !defined(AZ_MONOLITHIC_BUILD) } -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// - -#if defined(WIN32) || defined(WIN64) -AZStd::wstring GetErrorStringUnsupportedGPU(const char* gpuName, unsigned int gpuVendorId, unsigned int gpuDeviceId) -{ - const size_t fullLangID = (size_t) GetKeyboardLayout(0); - const size_t primLangID = fullLangID & 0x3FF; - - const wchar_t* pFmt = L"Unsupported video card detected! Continuing to run might lead to unexpected results or crashes. " - L"Please check the manual for further information on hardware requirements.\n\n\"%S\" [vendor id = 0x%.4x, device id = 0x%.4x]"; - - switch (primLangID) - { - case 0x04: // Chinese - { - static const wchar_t fmt[] = {0x5075, 0x6E2C, 0x5230, 0x4E0D, 0x652F, 0x63F4, 0x7684, 0x986F, 0x793A, 0x5361, 0xFF01, 0x7E7C, 0x7E8C, 0x57F7, 0x884C, 0x53EF, 0x80FD, 0x5C0E, 0x81F4, 0x7121, 0x6CD5, 0x9810, 0x671F, 0x7684, 0x7D50, 0x679C, 0x6216, 0x7576, 0x6A5F, 0x3002, 0x8ACB, 0x6AA2, 0x67E5, 0x8AAA, 0x660E, 0x66F8, 0x4E0A, 0x7684, 0x786C, 0x9AD4, 0x9700, 0x6C42, 0x4EE5, 0x53D6, 0x5F97, 0x66F4, 0x591A, 0x76F8, 0x95DC, 0x8CC7, 0x8A0A, 0x3002, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x5EE0, 0x5546, 0x7DE8, 0x865F, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x88DD, 0x7F6E, 0x7DE8, 0x865F, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x05: // Czech - { - static const wchar_t fmt[] = {0x0042, 0x0079, 0x006C, 0x0061, 0x0020, 0x0064, 0x0065, 0x0074, 0x0065, 0x006B, 0x006F, 0x0076, 0x00E1, 0x006E, 0x0061, 0x0020, 0x0067, 0x0072, 0x0061, 0x0066, 0x0069, 0x0063, 0x006B, 0x00E1, 0x0020, 0x006B, 0x0061, 0x0072, 0x0074, 0x0061, 0x002C, 0x0020, 0x006B, 0x0074, 0x0065, 0x0072, 0x00E1, 0x0020, 0x006E, 0x0065, 0x006E, 0x00ED, 0x0020, 0x0070, 0x006F, 0x0064, 0x0070, 0x006F, 0x0072, 0x006F, 0x0076, 0x00E1, 0x006E, 0x0061, 0x002E, 0x0020, 0x0050, 0x006F, 0x006B, 0x0072, 0x0061, 0x010D, 0x006F, 0x0076, 0x00E1, 0x006E, 0x00ED, 0x0020, 0x006D, 0x016F, 0x017E, 0x0065, 0x0020, 0x0076, 0x00E9, 0x0073, 0x0074, 0x0020, 0x006B, 0x0065, 0x0020, 0x006B, 0x0072, 0x0069, 0x0074, 0x0069, 0x0063, 0x006B, 0x00FD, 0x006D, 0x0020, 0x0063, 0x0068, 0x0079, 0x0062, 0x00E1, 0x006D, 0x0020, 0x006E, 0x0065, 0x0062, 0x006F, 0x0020, 0x006E, 0x0065, 0x0073, 0x0074, 0x0061, 0x0062, 0x0069, 0x006C, 0x0069, 0x0074, 0x011B, 0x0020, 0x0073, 0x0079, 0x0073, 0x0074, 0x00E9, 0x006D, 0x0075, 0x002E, 0x0020, 0x0050, 0x0159, 0x0065, 0x010D, 0x0074, 0x011B, 0x0074, 0x0065, 0x0020, 0x0073, 0x0069, 0x0020, 0x0070, 0x0072, 0x006F, 0x0073, 0x00ED, 0x006D, 0x0020, 0x0075, 0x017E, 0x0069, 0x0076, 0x0061, 0x0074, 0x0065, 0x006C, 0x0073, 0x006B, 0x006F, 0x0075, 0x0020, 0x0070, 0x0159, 0x00ED, 0x0072, 0x0075, 0x010D, 0x006B, 0x0075, 0x0020, 0x0070, 0x0072, 0x006F, 0x0020, 0x0070, 0x006F, 0x0064, 0x0072, 0x006F, 0x0062, 0x006E, 0x00E9, 0x0020, 0x0069, 0x006E, 0x0066, 0x006F, 0x0072, 0x006D, 0x0061, 0x0063, 0x0065, 0x0020, 0x006F, 0x0020, 0x0073, 0x0079, 0x0073, 0x0074, 0x00E9, 0x006D, 0x006F, 0x0076, 0x00FD, 0x0063, 0x0068, 0x0020, 0x0070, 0x006F, 0x017E, 0x0061, 0x0064, 0x0061, 0x0076, 0x0063, 0x00ED, 0x0063, 0x0068, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x07: // German - { - static const wchar_t fmt[] = {0x004E, 0x0069, 0x0063, 0x0068, 0x0074, 0x002D, 0x0075, 0x006E, 0x0074, 0x0065, 0x0072, 0x0073, 0x0074, 0x00FC, 0x0074, 0x007A, 0x0074, 0x0065, 0x0020, 0x0056, 0x0069, 0x0064, 0x0065, 0x006F, 0x006B, 0x0061, 0x0072, 0x0074, 0x0065, 0x0020, 0x0067, 0x0065, 0x0066, 0x0075, 0x006E, 0x0064, 0x0065, 0x006E, 0x0021, 0x0020, 0x0046, 0x006F, 0x0072, 0x0074, 0x0066, 0x0061, 0x0068, 0x0072, 0x0065, 0x006E, 0x0020, 0x006B, 0x0061, 0x006E, 0x006E, 0x0020, 0x007A, 0x0075, 0x0020, 0x0075, 0x006E, 0x0065, 0x0072, 0x0077, 0x0061, 0x0072, 0x0074, 0x0065, 0x0074, 0x0065, 0x006E, 0x0020, 0x0045, 0x0072, 0x0067, 0x0065, 0x0062, 0x006E, 0x0069, 0x0073, 0x0073, 0x0065, 0x006E, 0x0020, 0x006F, 0x0064, 0x0065, 0x0072, 0x0020, 0x0041, 0x0062, 0x0073, 0x0074, 0x00FC, 0x0072, 0x007A, 0x0065, 0x006E, 0x0020, 0x0066, 0x00FC, 0x0068, 0x0072, 0x0065, 0x006E, 0x002E, 0x0020, 0x0042, 0x0069, 0x0074, 0x0074, 0x0065, 0x0020, 0x006C, 0x0069, 0x0065, 0x0073, 0x0020, 0x0064, 0x0061, 0x0073, 0x0020, 0x004D, 0x0061, 0x006E, 0x0075, 0x0061, 0x006C, 0x0020, 0x0066, 0x00FC, 0x0072, 0x0020, 0x0077, 0x0065, 0x0069, 0x0074, 0x0065, 0x0072, 0x0065, 0x0020, 0x0049, 0x006E, 0x0066, 0x006F, 0x0072, 0x006D, 0x0061, 0x0074, 0x0069, 0x006F, 0x006E, 0x0065, 0x006E, 0x0020, 0x007A, 0x0075, 0x0020, 0x0048, 0x0061, 0x0072, 0x0064, 0x0077, 0x0061, 0x0072, 0x0065, 0x002D, 0x0041, 0x006E, 0x0066, 0x006F, 0x0072, 0x0064, 0x0065, 0x0072, 0x0075, 0x006E, 0x0067, 0x0065, 0x006E, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x0a: // Spanish - { - static const wchar_t fmt[] = {0x0053, 0x0065, 0x0020, 0x0068, 0x0061, 0x0020, 0x0064, 0x0065, 0x0074, 0x0065, 0x0063, 0x0074, 0x0061, 0x0064, 0x006F, 0x0020, 0x0075, 0x006E, 0x0061, 0x0020, 0x0074, 0x0061, 0x0072, 0x006A, 0x0065, 0x0074, 0x0061, 0x0020, 0x0067, 0x0072, 0x00E1, 0x0066, 0x0069, 0x0063, 0x0061, 0x0020, 0x006E, 0x006F, 0x0020, 0x0063, 0x006F, 0x006D, 0x0070, 0x0061, 0x0074, 0x0069, 0x0062, 0x006C, 0x0065, 0x002E, 0x0020, 0x0053, 0x0069, 0x0020, 0x0073, 0x0069, 0x0067, 0x0075, 0x0065, 0x0073, 0x0020, 0x0065, 0x006A, 0x0065, 0x0063, 0x0075, 0x0074, 0x0061, 0x006E, 0x0064, 0x006F, 0x0020, 0x0065, 0x006C, 0x0020, 0x006A, 0x0075, 0x0065, 0x0067, 0x006F, 0x002C, 0x0020, 0x0065, 0x0073, 0x0020, 0x0070, 0x006F, 0x0073, 0x0069, 0x0062, 0x006C, 0x0065, 0x0020, 0x0071, 0x0075, 0x0065, 0x0020, 0x0073, 0x0065, 0x0020, 0x0070, 0x0072, 0x006F, 0x0064, 0x0075, 0x007A, 0x0063, 0x0061, 0x006E, 0x0020, 0x0065, 0x0066, 0x0065, 0x0063, 0x0074, 0x006F, 0x0073, 0x0020, 0x0069, 0x006E, 0x0065, 0x0073, 0x0070, 0x0065, 0x0072, 0x0061, 0x0064, 0x006F, 0x0073, 0x0020, 0x006F, 0x0020, 0x0071, 0x0075, 0x0065, 0x0020, 0x0065, 0x006C, 0x0020, 0x0070, 0x0072, 0x006F, 0x0067, 0x0072, 0x0061, 0x006D, 0x0061, 0x0020, 0x0064, 0x0065, 0x006A, 0x0065, 0x0020, 0x0064, 0x0065, 0x0020, 0x0066, 0x0075, 0x006E, 0x0063, 0x0069, 0x006F, 0x006E, 0x0061, 0x0072, 0x002E, 0x0020, 0x0050, 0x006F, 0x0072, 0x0020, 0x0066, 0x0061, 0x0076, 0x006F, 0x0072, 0x002C, 0x0020, 0x0063, 0x006F, 0x006D, 0x0070, 0x0072, 0x0075, 0x0065, 0x0062, 0x0061, 0x0020, 0x0065, 0x006C, 0x0020, 0x006D, 0x0061, 0x006E, 0x0075, 0x0061, 0x006C, 0x0020, 0x0070, 0x0061, 0x0072, 0x0061, 0x0020, 0x006F, 0x0062, 0x0074, 0x0065, 0x006E, 0x0065, 0x0072, 0x0020, 0x006D, 0x00E1, 0x0073, 0x0020, 0x0069, 0x006E, 0x0066, 0x006F, 0x0072, 0x006D, 0x0061, 0x0063, 0x0069, 0x00F3, 0x006E, 0x0020, 0x0061, 0x0063, 0x0065, 0x0072, 0x0063, 0x0061, 0x0020, 0x0064, 0x0065, 0x0020, 0x006C, 0x006F, 0x0073, 0x0020, 0x0072, 0x0065, 0x0071, 0x0075, 0x0069, 0x0073, 0x0069, 0x0074, 0x006F, 0x0073, 0x0020, 0x0064, 0x0065, 0x006C, 0x0020, 0x0073, 0x0069, 0x0073, 0x0074, 0x0065, 0x006D, 0x0061, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x0c: // French - { - static const wchar_t fmt[] = {0x0041, 0x0074, 0x0074, 0x0065, 0x006E, 0x0074, 0x0069, 0x006F, 0x006E, 0x002C, 0x0020, 0x006C, 0x0061, 0x0020, 0x0063, 0x0061, 0x0072, 0x0074, 0x0065, 0x0020, 0x0076, 0x0069, 0x0064, 0x00E9, 0x006F, 0x0020, 0x0064, 0x00E9, 0x0074, 0x0065, 0x0063, 0x0074, 0x00E9, 0x0065, 0x0020, 0x006E, 0x2019, 0x0065, 0x0073, 0x0074, 0x0020, 0x0070, 0x0061, 0x0073, 0x0020, 0x0073, 0x0075, 0x0070, 0x0070, 0x006F, 0x0072, 0x0074, 0x00E9, 0x0065, 0x0020, 0x0021, 0x0020, 0x0050, 0x006F, 0x0075, 0x0072, 0x0073, 0x0075, 0x0069, 0x0076, 0x0072, 0x0065, 0x0020, 0x006C, 0x2019, 0x0061, 0x0070, 0x0070, 0x006C, 0x0069, 0x0063, 0x0061, 0x0074, 0x0069, 0x006F, 0x006E, 0x0020, 0x0070, 0x006F, 0x0075, 0x0072, 0x0072, 0x0061, 0x0069, 0x0074, 0x0020, 0x0065, 0x006E, 0x0067, 0x0065, 0x006E, 0x0064, 0x0072, 0x0065, 0x0072, 0x0020, 0x0064, 0x0065, 0x0073, 0x0020, 0x0069, 0x006E, 0x0073, 0x0074, 0x0061, 0x0062, 0x0069, 0x006C, 0x0069, 0x0074, 0x00E9, 0x0073, 0x0020, 0x006F, 0x0075, 0x0020, 0x0064, 0x0065, 0x0073, 0x0020, 0x0063, 0x0072, 0x0061, 0x0073, 0x0068, 0x0073, 0x002E, 0x0020, 0x0056, 0x0065, 0x0075, 0x0069, 0x006C, 0x006C, 0x0065, 0x007A, 0x0020, 0x0076, 0x006F, 0x0075, 0x0073, 0x0020, 0x0072, 0x0065, 0x0070, 0x006F, 0x0072, 0x0074, 0x0065, 0x0072, 0x0020, 0x0061, 0x0075, 0x0020, 0x006D, 0x0061, 0x006E, 0x0075, 0x0065, 0x006C, 0x0020, 0x0070, 0x006F, 0x0075, 0x0072, 0x0020, 0x0070, 0x006C, 0x0075, 0x0073, 0x0020, 0x0064, 0x2019, 0x0069, 0x006E, 0x0066, 0x006F, 0x0072, 0x006D, 0x0061, 0x0074, 0x0069, 0x006F, 0x006E, 0x0073, 0x0020, 0x0073, 0x0075, 0x0072, 0x0020, 0x006C, 0x0065, 0x0073, 0x0020, 0x0070, 0x0072, 0x00E9, 0x002D, 0x0072, 0x0065, 0x0071, 0x0075, 0x0069, 0x0073, 0x0020, 0x006D, 0x0061, 0x0074, 0x00E9, 0x0072, 0x0069, 0x0065, 0x006C, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x10: // Italian - { - static const wchar_t fmt[] = {0x00C8, 0x0020, 0x0073, 0x0074, 0x0061, 0x0074, 0x0061, 0x0020, 0x0072, 0x0069, 0x006C, 0x0065, 0x0076, 0x0061, 0x0074, 0x0061, 0x0020, 0x0075, 0x006E, 0x0061, 0x0020, 0x0073, 0x0063, 0x0068, 0x0065, 0x0064, 0x0061, 0x0020, 0x0067, 0x0072, 0x0061, 0x0066, 0x0069, 0x0063, 0x0061, 0x0020, 0x006E, 0x006F, 0x006E, 0x0020, 0x0073, 0x0075, 0x0070, 0x0070, 0x006F, 0x0072, 0x0074, 0x0061, 0x0074, 0x0061, 0x0021, 0x0020, 0x0053, 0x0065, 0x0020, 0x0073, 0x0069, 0x0020, 0x0063, 0x006F, 0x006E, 0x0074, 0x0069, 0x006E, 0x0075, 0x0061, 0x002C, 0x0020, 0x0073, 0x0069, 0x0020, 0x0070, 0x006F, 0x0074, 0x0072, 0x0065, 0x0062, 0x0062, 0x0065, 0x0072, 0x006F, 0x0020, 0x0076, 0x0065, 0x0072, 0x0069, 0x0066, 0x0069, 0x0063, 0x0061, 0x0072, 0x0065, 0x0020, 0x0072, 0x0069, 0x0073, 0x0075, 0x006C, 0x0074, 0x0061, 0x0074, 0x0069, 0x0020, 0x0069, 0x006E, 0x0061, 0x0074, 0x0074, 0x0065, 0x0073, 0x0069, 0x0020, 0x006F, 0x0020, 0x0063, 0x0072, 0x0061, 0x0073, 0x0068, 0x002E, 0x0020, 0x0043, 0x006F, 0x006E, 0x0073, 0x0075, 0x006C, 0x0074, 0x0061, 0x0020, 0x0069, 0x006C, 0x0020, 0x006D, 0x0061, 0x006E, 0x0075, 0x0061, 0x006C, 0x0065, 0x0020, 0x0070, 0x0065, 0x0072, 0x0020, 0x0075, 0x006C, 0x0074, 0x0065, 0x0072, 0x0069, 0x006F, 0x0072, 0x0069, 0x0020, 0x0069, 0x006E, 0x0066, 0x006F, 0x0072, 0x006D, 0x0061, 0x007A, 0x0069, 0x006F, 0x006E, 0x0069, 0x0020, 0x0073, 0x0075, 0x0069, 0x0020, 0x0072, 0x0065, 0x0071, 0x0075, 0x0069, 0x0073, 0x0069, 0x0074, 0x0069, 0x0020, 0x0064, 0x0069, 0x0020, 0x0073, 0x0069, 0x0073, 0x0074, 0x0065, 0x006D, 0x0061, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x11: // Japanese - { - static const wchar_t fmt[] = {0x30B5, 0x30DD, 0x30FC, 0x30C8, 0x3055, 0x308C, 0x3066, 0x3044, 0x306A, 0x3044, 0x30D3, 0x30C7, 0x30AA, 0x30AB, 0x30FC, 0x30C9, 0x304C, 0x691C, 0x51FA, 0x3055, 0x308C, 0x307E, 0x3057, 0x305F, 0xFF01, 0x0020, 0x3053, 0x306E, 0x307E, 0x307E, 0x7D9A, 0x3051, 0x308B, 0x3068, 0x4E88, 0x671F, 0x3057, 0x306A, 0x3044, 0x7D50, 0x679C, 0x3084, 0x30AF, 0x30E9, 0x30C3, 0x30B7, 0x30E5, 0x306E, 0x6050, 0x308C, 0x304C, 0x3042, 0x308A, 0x307E, 0x3059, 0x3002, 0x0020, 0x30DE, 0x30CB, 0x30E5, 0x30A2, 0x30EB, 0x306E, 0x5FC5, 0x8981, 0x52D5, 0x4F5C, 0x74B0, 0x5883, 0x3092, 0x3054, 0x78BA, 0x8A8D, 0x304F, 0x3060, 0x3055, 0x3044, 0x3002, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x30D9, 0x30F3, 0x30C0, 0x30FC, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x30C7, 0x30D0, 0x30A4, 0x30B9, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x15: // Polish - { - static const wchar_t fmt[] = {0x0057, 0x0079, 0x006B, 0x0072, 0x0079, 0x0074, 0x006F, 0x0020, 0x006E, 0x0069, 0x0065, 0x006F, 0x0062, 0x0073, 0x0142, 0x0075, 0x0067, 0x0069, 0x0077, 0x0061, 0x006E, 0x0105, 0x0020, 0x006B, 0x0061, 0x0072, 0x0074, 0x0119, 0x0020, 0x0067, 0x0072, 0x0061, 0x0066, 0x0069, 0x0063, 0x007A, 0x006E, 0x0105, 0x0021, 0x0020, 0x0044, 0x0061, 0x006C, 0x0073, 0x007A, 0x0065, 0x0020, 0x006B, 0x006F, 0x0072, 0x007A, 0x0079, 0x0073, 0x0074, 0x0061, 0x006E, 0x0069, 0x0065, 0x0020, 0x007A, 0x0020, 0x0070, 0x0072, 0x006F, 0x0064, 0x0075, 0x006B, 0x0074, 0x0075, 0x0020, 0x006D, 0x006F, 0x017C, 0x0065, 0x0020, 0x0073, 0x0070, 0x006F, 0x0077, 0x006F, 0x0064, 0x006F, 0x0077, 0x0061, 0x0107, 0x0020, 0x006E, 0x0069, 0x0065, 0x0070, 0x006F, 0x017C, 0x0105, 0x0064, 0x0061, 0x006E, 0x0065, 0x0020, 0x007A, 0x0061, 0x0063, 0x0068, 0x006F, 0x0077, 0x0061, 0x006E, 0x0069, 0x0065, 0x0020, 0x006C, 0x0075, 0x0062, 0x0020, 0x0077, 0x0073, 0x0074, 0x0072, 0x007A, 0x0079, 0x006D, 0x0061, 0x006E, 0x0069, 0x0065, 0x0020, 0x0070, 0x0072, 0x006F, 0x0067, 0x0072, 0x0061, 0x006D, 0x0075, 0x002E, 0x0020, 0x0041, 0x0062, 0x0079, 0x0020, 0x0075, 0x007A, 0x0079, 0x0073, 0x006B, 0x0061, 0x0107, 0x0020, 0x0077, 0x0069, 0x0119, 0x0063, 0x0065, 0x006A, 0x0020, 0x0069, 0x006E, 0x0066, 0x006F, 0x0072, 0x006D, 0x0061, 0x0063, 0x006A, 0x0069, 0x002C, 0x0020, 0x0073, 0x006B, 0x006F, 0x006E, 0x0073, 0x0075, 0x006C, 0x0074, 0x0075, 0x006A, 0x0020, 0x0073, 0x0069, 0x0119, 0x0020, 0x007A, 0x0020, 0x0069, 0x006E, 0x0073, 0x0074, 0x0072, 0x0075, 0x006B, 0x0063, 0x006A, 0x0105, 0x0020, 0x006F, 0x0062, 0x0073, 0x0142, 0x0075, 0x0067, 0x0069, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x19: // Russian - { - static const wchar_t fmt[] = {0x0412, 0x0430, 0x0448, 0x0430, 0x0020, 0x0432, 0x0438, 0x0434, 0x0435, 0x043E, 0x0020, 0x043A, 0x0430, 0x0440, 0x0442, 0x0430, 0x0020, 0x043D, 0x0435, 0x0020, 0x043F, 0x043E, 0x0434, 0x0434, 0x0435, 0x0440, 0x0436, 0x0438, 0x0432, 0x0430, 0x0435, 0x0442, 0x0441, 0x044F, 0x0021, 0x0020, 0x042D, 0x0442, 0x043E, 0x0020, 0x043C, 0x043E, 0x0436, 0x0435, 0x0442, 0x0020, 0x043F, 0x0440, 0x0438, 0x0432, 0x0435, 0x0441, 0x0442, 0x0438, 0x0020, 0x043A, 0x0020, 0x043D, 0x0435, 0x043F, 0x0440, 0x0435, 0x0434, 0x0441, 0x043A, 0x0430, 0x0437, 0x0443, 0x0435, 0x043C, 0x043E, 0x043C, 0x0443, 0x0020, 0x043F, 0x043E, 0x0432, 0x0435, 0x0434, 0x0435, 0x043D, 0x0438, 0x044E, 0x0020, 0x0438, 0x0020, 0x0437, 0x0430, 0x0432, 0x0438, 0x0441, 0x0430, 0x043D, 0x0438, 0x044E, 0x0020, 0x0438, 0x0433, 0x0440, 0x044B, 0x002E, 0x0020, 0x0414, 0x043B, 0x044F, 0x0020, 0x043F, 0x043E, 0x043B, 0x0443, 0x0447, 0x0435, 0x043D, 0x0438, 0x044F, 0x0020, 0x0438, 0x043D, 0x0444, 0x043E, 0x0440, 0x043C, 0x0430, 0x0446, 0x0438, 0x0438, 0x0020, 0x043E, 0x0020, 0x0441, 0x0438, 0x0441, 0x0442, 0x0435, 0x043C, 0x043D, 0x044B, 0x0445, 0x0020, 0x0442, 0x0440, 0x0435, 0x0431, 0x043E, 0x0432, 0x0430, 0x043D, 0x0438, 0x044F, 0x0445, 0x0020, 0x043E, 0x0431, 0x0440, 0x0430, 0x0442, 0x0438, 0x0442, 0x0435, 0x0441, 0x044C, 0x0020, 0x043A, 0x0020, 0x0440, 0x0443, 0x043A, 0x043E, 0x0432, 0x043E, 0x0434, 0x0441, 0x0442, 0x0432, 0x0443, 0x0020, 0x043F, 0x043E, 0x043B, 0x044C, 0x0437, 0x043E, 0x0432, 0x0430, 0x0442, 0x0435, 0x043B, 0x044F, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - case 0x1f: // Turkish - { - static const wchar_t fmt[] = {0x0044, 0x0065, 0x0073, 0x0074, 0x0065, 0x006B, 0x006C, 0x0065, 0x006E, 0x006D, 0x0065, 0x0079, 0x0065, 0x006E, 0x0020, 0x0062, 0x0069, 0x0072, 0x0020, 0x0065, 0x006B, 0x0072, 0x0061, 0x006E, 0x0020, 0x006B, 0x0061, 0x0072, 0x0074, 0x0131, 0x0020, 0x0061, 0x006C, 0x0067, 0x0131, 0x006C, 0x0061, 0x006E, 0x0064, 0x0131, 0x0021, 0x0020, 0x0044, 0x0065, 0x0076, 0x0061, 0x006D, 0x0020, 0x0065, 0x0074, 0x006D, 0x0065, 0x006B, 0x0020, 0x0062, 0x0065, 0x006B, 0x006C, 0x0065, 0x006E, 0x006D, 0x0065, 0x0064, 0x0069, 0x006B, 0x0020, 0x0073, 0x006F, 0x006E, 0x0075, 0x00E7, 0x006C, 0x0061, 0x0072, 0x0061, 0x0020, 0x0076, 0x0065, 0x0020, 0x00E7, 0x00F6, 0x006B, 0x006D, 0x0065, 0x006C, 0x0065, 0x0072, 0x0065, 0x0020, 0x0079, 0x006F, 0x006C, 0x0020, 0x0061, 0x00E7, 0x0061, 0x0062, 0x0069, 0x006C, 0x0069, 0x0072, 0x002E, 0x0020, 0x0044, 0x006F, 0x006E, 0x0061, 0x006E, 0x0131, 0x006D, 0x0020, 0x0067, 0x0065, 0x0072, 0x0065, 0x006B, 0x006C, 0x0069, 0x006C, 0x0069, 0x006B, 0x006C, 0x0065, 0x0072, 0x0069, 0x0020, 0x0069, 0x00E7, 0x0069, 0x006E, 0x0020, 0x006C, 0x00FC, 0x0074, 0x0066, 0x0065, 0x006E, 0x0020, 0x0072, 0x0065, 0x0068, 0x0062, 0x0065, 0x0072, 0x0069, 0x006E, 0x0069, 0x007A, 0x0065, 0x0020, 0x0062, 0x0061, 0x015F, 0x0076, 0x0075, 0x0072, 0x0075, 0x006E, 0x002E, 0x000A, 0x000A, 0x0022, 0x0025, 0x0053, 0x0022, 0x0020, 0x005B, 0x0076, 0x0065, 0x006E, 0x0064, 0x006F, 0x0072, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x002C, 0x0020, 0x0064, 0x0065, 0x0076, 0x0069, 0x0063, 0x0065, 0x0020, 0x0069, 0x0064, 0x0020, 0x003D, 0x0020, 0x0030, 0x0078, 0x0025, 0x002E, 0x0034, 0x0078, 0x005D, 0}; - pFmt = fmt; - break; - } - - case 0x09: // English - default: - break; - } - - wchar_t msg[1024]; - msg[0] = L'\0'; - msg[sizeof(msg) / sizeof(msg[0]) - 1] = L'\0'; - azsnwprintf(msg, sizeof(msg) / sizeof(msg[0]) - 1, pFmt, gpuName, gpuVendorId, gpuDeviceId); - - return msg; -} -#endif - ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// bool CSystem::InitConsole() diff --git a/Code/Legacy/CrySystem/XConsole.cpp b/Code/Legacy/CrySystem/XConsole.cpp index 68cec01cc4..9f60a9dd8d 100644 --- a/Code/Legacy/CrySystem/XConsole.cpp +++ b/Code/Legacy/CrySystem/XConsole.cpp @@ -389,12 +389,12 @@ void CXConsole::LogChangeMessage(const char* name, const bool isConst, const boo if (allowChange) { - gEnv->pLog->LogWarning(logMessage.c_str()); + gEnv->pLog->LogWarning("%s", logMessage.c_str()); gEnv->pLog->LogWarning("Modifying marked variables will not be allowed in Release mode!"); } else { - gEnv->pLog->LogError(logMessage.c_str()); + gEnv->pLog->LogError("%s", logMessage.c_str()); } } diff --git a/Code/Tools/AzTestRunner/Platform/Android/platform_android.cpp b/Code/Tools/AzTestRunner/Platform/Android/platform_android.cpp index 9e0ea304ef..a1bcc1ec5f 100644 --- a/Code/Tools/AzTestRunner/Platform/Android/platform_android.cpp +++ b/Code/Tools/AzTestRunner/Platform/Android/platform_android.cpp @@ -278,7 +278,7 @@ static void *thread_logger_func(void*) --readSize; } logBuffer[readSize] = '\0'; - ((void) __android_log_print(ANDROID_LOG_INFO, s_logTag, logBuffer)); + ((void) __android_log_print(ANDROID_LOG_INFO, s_logTag, "%s", logBuffer)); } } return 0; diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp index bc9763496c..bf03342149 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzerSystemComponent.cpp @@ -30,17 +30,16 @@ namespace AssetMemoryAnalyzer if (customFilename) { - azsnprintf(sharedBuffer, sizeof(sharedBuffer), "@log@/%s", customFilename); + azsnprintf(sharedBuffer, AZ_ARRAY_SIZE(sharedBuffer), "@log@/%s", customFilename); } else { - char timestampBuffer[64]; time_t ltime; time(<ime); struct tm timeInfo; AZ_TRAIT_CTIME_LOCALTIME(&timeInfo, <ime); - strftime(timestampBuffer, sizeof(timestampBuffer), "@log@/assetmem-%Y-%m-%d-%H-%M-%S.%%s", &timeInfo); - azsnprintf(sharedBuffer, sizeof(sharedBuffer), timestampBuffer, extension); + strftime(sharedBuffer, AZ_ARRAY_SIZE(sharedBuffer), "@log@/assetmem-%Y-%m-%d-%H-%M-%S.", &timeInfo); + azstrcat(sharedBuffer, AZ_ARRAY_SIZE(sharedBuffer), extension); } return sharedBuffer; diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp index aecac5fa34..c9c123cf70 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/DebugImGUI.cpp @@ -200,7 +200,7 @@ namespace AssetMemoryAnalyzer switch (ap->m_codePoint->m_category) { case AllocationCategories::HEAP: - ImGui::Text(FormatUtils::FormatCodePoint(*ap->m_codePoint)); + ImGui::Text("%s", FormatUtils::FormatCodePoint(*ap->m_codePoint)); heapSummary.m_allocationCount = static_cast(ap->m_allocations.size()); heapSummary.m_allocatedMemory = ap->m_totalAllocatedMemory; break; @@ -247,7 +247,7 @@ namespace AssetMemoryAnalyzer { if (text) { - ImGui::Text(text); + ImGui::Text("%s", text); ImGui::SameLine(); } diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCpuProfiler.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCpuProfiler.inl index cd9e4fc2b5..61f68197b6 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCpuProfiler.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiCpuProfiler.inl @@ -288,11 +288,11 @@ namespace AZ continue; } - ImGui::Text(statistics->m_groupName.c_str()); + ImGui::Text("%s", statistics->m_groupName.c_str()); const ImVec2 topLeftBound = ImGui::GetItemRectMin(); ImGui::TableNextColumn(); - ImGui::Text(statistics->m_regionName.c_str()); + ImGui::Text("%s", statistics->m_regionName.c_str()); ImGui::TableNextColumn(); ImGui::Text("%.2f", CpuProfilerImGuiHelper::TicksToMs(statistics->m_runningAverageTicks)); @@ -313,7 +313,7 @@ namespace AZ if (ImGui::IsWindowHovered() && ImGui::IsMouseHoveringRect(topLeftBound, botRightBound, false)) { ImGui::BeginTooltip(); - ImGui::Text(statistics->GetExecutingThreadsLabel().c_str()); + ImGui::Text("%s", statistics->GetExecutingThreadsLabel().c_str()); ImGui::EndTooltip(); } } @@ -363,7 +363,7 @@ namespace AZ const auto ShowRow = [&ShowTimeInMs](const char* regionLabel, AZStd::sys_time_t duration) { - ImGui::Text(regionLabel); + ImGui::Text("%s", regionLabel); ImGui::NextColumn(); ShowTimeInMs(duration); diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl index 9b2f2b0dd9..80dcace2df 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl @@ -279,13 +279,13 @@ namespace AZ const AZStd::string totalPassCountLabel = AZStd::string::format("%s: %u", "Total Pass Count", static_cast(passEntryDatabase.size())); - ImGui::Text(totalPassCountLabel.c_str()); + ImGui::Text("%s", totalPassCountLabel.c_str()); // Display listed pass count. const AZStd::string listedPassCountLabel = AZStd::string::format("%s: %u", "Listed Pass Count", static_cast(m_passEntryReferences.size())); - ImGui::Text(listedPassCountLabel.c_str()); + ImGui::Text("%s", listedPassCountLabel.c_str()); } } @@ -404,7 +404,7 @@ namespace AZ passName = AZStd::string::format("%s (%s)", passName.c_str(), passTreeState); } - ImGui::Text(passName.c_str()); + ImGui::Text("%s", passName.c_str()); // Show a HoverMarker if the text is bigger than the column. const ImVec2 textSize = ImGui::CalcTextSize(passName.c_str()); @@ -480,7 +480,7 @@ namespace AZ } else { - ImGui::Text(label.c_str()); + ImGui::Text("%s", label.c_str()); } if (textColorChanged) @@ -683,7 +683,7 @@ namespace AZ // Draw the frame time (GPU). const AZStd::string formattedTimestamp = FormatTimestampLabel(gpuTimestamp.GetDurationInNanoseconds()); const AZStd::string headerFrameTime = AZStd::string::format("Total frame duration (GPU): %s", formattedTimestamp.c_str()); - ImGui::Text(headerFrameTime.c_str()); + ImGui::Text("%s", headerFrameTime.c_str()); // Draw the viewing option. ImGui::RadioButton("Hierarchical", reinterpret_cast(&m_viewType), static_cast(ProfilerViewType::Hierarchical)); @@ -810,7 +810,7 @@ namespace AZ { const int32_t timestampMetricUnitNumeric = static_cast(m_timestampMetricUnit); const AZStd::string metricUnitText = AZStd::string::format("Time in %s", MetricUnitText[timestampMetricUnitNumeric]); - ImGui::Text(metricUnitText.c_str()); + ImGui::Text("%s", metricUnitText.c_str()); ImGui::NextColumn(); } @@ -818,7 +818,7 @@ namespace AZ { const int32_t frameWorkloadViewNumeric = static_cast(m_frameWorkloadView); const AZStd::string frameWorkloadViewText = AZStd::string::format("Frame workload in %s FPS", FrameWorkloadUnit[frameWorkloadViewNumeric]); - ImGui::Text(frameWorkloadViewText.c_str()); + ImGui::Text("%s", frameWorkloadViewText.c_str()); ImGui::NextColumn(); } @@ -853,7 +853,7 @@ namespace AZ const int32_t frameWorkloadViewNumeric = static_cast(m_frameWorkloadView); const AZStd::string frameWorkloadViewText = AZStd::string::format("Frame workload in %s FPS", FrameWorkloadUnit[frameWorkloadViewNumeric]); - ImGui::Text(frameWorkloadViewText.c_str()); + ImGui::Text("%s", frameWorkloadViewText.c_str()); ImGui::NextColumn(); } @@ -907,7 +907,7 @@ namespace AZ } else { - ImGui::Text(entryTime.c_str()); + ImGui::Text("%s", entryTime.c_str()); ImGui::NextColumn(); DrawFrameWorkloadBar(NormalizeFrameWorkload(entry->m_interpolatedTimestampInNanoseconds)); ImGui::NextColumn(); @@ -927,7 +927,7 @@ namespace AZ if (entry->m_children.empty()) { // Draw the workload bar when it doesn't have children. - ImGui::Text(entry->m_name.GetCStr()); + ImGui::Text("%s", entry->m_name.GetCStr()); // Show a HoverMarker if the text is bigger than the column. createHoverMarker(entry->m_name.GetCStr()); @@ -991,9 +991,9 @@ namespace AZ } const AZStd::string entryTime = FormatTimestampLabel(entry->m_interpolatedTimestampInNanoseconds); - ImGui::Text(entry->m_name.GetCStr()); + ImGui::Text("%s", entry->m_name.GetCStr()); ImGui::NextColumn(); - ImGui::Text(entryTime.c_str()); + ImGui::Text("%s", entryTime.c_str()); ImGui::NextColumn(); DrawFrameWorkloadBar(NormalizeFrameWorkload(entry->m_interpolatedTimestampInNanoseconds)); ImGui::NextColumn(); @@ -1131,13 +1131,13 @@ namespace AZ continue; } - ImGui::Text(tableRow.m_parentPoolName.GetCStr()); + ImGui::Text("%s", tableRow.m_parentPoolName.GetCStr()); ImGui::TableNextColumn(); - ImGui::Text(tableRow.m_bufImgName.GetCStr()); + ImGui::Text("%s", tableRow.m_bufImgName.GetCStr()); ImGui::TableNextColumn(); ImGui::Text("%.4f", 1.0f * tableRow.m_sizeInBytes / GpuProfilerImGuiHelper::MB); ImGui::TableNextColumn(); - ImGui::Text(tableRow.m_bindFlags.c_str()); + ImGui::Text("%s", tableRow.m_bindFlags.c_str()); ImGui::TableNextColumn(); } } @@ -1244,20 +1244,20 @@ namespace AZ { if (ImGui::BeginChild(savedHeap.m_name.GetCStr(), { ImGui::GetWindowWidth() / m_savedHeaps.size(), 250 }), ImGuiWindowFlags_NoScrollbar) { - ImGui::Text(savedHeap.m_name.GetCStr()); + ImGui::Text("%s", savedHeap.m_name.GetCStr()); ImGui::Columns(2, "HeapData", true); - ImGui::Text("Resident (MB): "); + ImGui::Text("%s", "Resident (MB): "); ImGui::NextColumn(); ImGui::Text("%.2f", 1.0 * savedHeap.m_memoryUsage.m_residentInBytes.load() / GpuProfilerImGuiHelper::MB); ImGui::NextColumn(); - ImGui::Text("Reserved (MB): "); + ImGui::Text("%s", "Reserved (MB): "); ImGui::NextColumn(); ImGui::Text("%.2f", 1.0 * savedHeap.m_memoryUsage.m_reservedInBytes.load() / GpuProfilerImGuiHelper::MB); ImGui::NextColumn(); - ImGui::Text("Budget (MB): "); + ImGui::Text("%s", "Budget (MB): "); ImGui::NextColumn(); ImGui::Text("%.2f", 1.0 * savedHeap.m_memoryUsage.m_budgetInBytes / GpuProfilerImGuiHelper::MB); diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl index a9eff68c7a..fa649ed47b 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiPassTree.inl @@ -100,7 +100,7 @@ namespace AZ::Render } } - ImGui::TextWrapped(m_attachmentReadbackInfo.c_str()); + ImGui::TextWrapped("%s", m_attachmentReadbackInfo.c_str()); } if (m_previewAttachment && m_selectedChanged) @@ -211,7 +211,7 @@ namespace AZ::Render else { // Only draw text (not selectable) if there is no attachment binded to the slot. - ImGui::Text(label.c_str()); + ImGui::Text("%s", label.c_str()); } } diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiShaderMetrics.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiShaderMetrics.inl index 772be4d4a8..73517c66ca 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiShaderMetrics.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiShaderMetrics.inl @@ -61,7 +61,7 @@ namespace AZ ImGui::Text("%d", request.m_requestCount); ImGui::NextColumn(); - ImGui::Text(request.m_shaderName.GetCStr()); + ImGui::Text("%s", request.m_shaderName.GetCStr()); ImGui::NextColumn(); ImGui::Text("%d", request.m_shaderVariantStableId.GetIndex()); diff --git a/Gems/Atom/Utils/Code/atom_utils_files.cmake b/Gems/Atom/Utils/Code/atom_utils_files.cmake index 06b78a49c4..b1f8170317 100644 --- a/Gems/Atom/Utils/Code/atom_utils_files.cmake +++ b/Gems/Atom/Utils/Code/atom_utils_files.cmake @@ -19,6 +19,8 @@ set(FILES Include/Atom/Utils/ImGuiPassTree.inl Include/Atom/Utils/ImGuiFrameVisualizer.h Include/Atom/Utils/ImGuiFrameVisualizer.inl + Include/Atom/Utils/ImGuiShaderMetrics.h + Include/Atom/Utils/ImGuiShaderMetrics.inl Include/Atom/Utils/ImGuiTransientAttachmentProfiler.h Include/Atom/Utils/ImGuiTransientAttachmentProfiler.inl Include/Atom/Utils/PpmFile.h diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp index 8c88a49b12..5711e3ff6e 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp @@ -731,20 +731,14 @@ IFFont* AZ::AtomFont::LoadFont(const char* fontName) font = NewFont(fontNameLower.c_str()); if (!font) { - AZStd::string errorMsg = "Error creating a new font named "; - errorMsg += fontNameLower; - errorMsg += "."; - CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, errorMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, "Error creating a new font named %s.", fontNameLower.c_str()); } else { // creating font adds one to its refcount so no need for AddRef here if (!font->Load(fontNameLower.c_str())) { - AZStd::string errorMsg = "Error loading a font from "; - errorMsg += fontNameLower; - errorMsg += "."; - CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, errorMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, "Error loading a font from %s.", fontNameLower.c_str()); font->Release(); font = nullptr; } @@ -792,8 +786,7 @@ bool AZ::AtomFont::AddFontFamilyToMaps(const char* fontFamilyFilename, const cha AZStd::to_lower(loweredFilename.begin(), loweredFilename.end()); if (m_fontFamilies.find(loweredFilename) != m_fontFamilies.end()) { - AZStd::string warnMsg = AZStd::string::format("Couldn't load Font Family '%s': already loaded", fontFamilyFilename); - CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, warnMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "Couldn't load Font Family '%s': already loaded", fontFamilyFilename); return false; } @@ -803,8 +796,7 @@ bool AZ::AtomFont::AddFontFamilyToMaps(const char* fontFamilyFilename, const cha AZStd::to_lower(loweredFontFamilyName.begin(), loweredFontFamilyName.end()); if (m_fontFamilies.find(loweredFontFamilyName) != m_fontFamilies.end()) { - AZStd::string warnMsg = AZStd::string::format("Couldn't load Font Family '%s': already loaded", fontFamilyName); - CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, warnMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "Couldn't load Font Family '%s': already loaded", fontFamilyName); return false; } diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp index f1fc8be965..ed5e0e50bc 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp @@ -311,8 +311,7 @@ Vec2 AZ::FontRenderer::GetKerning(uint32_t leftGlyph, uint32_t rightGlyph) #if !defined(_RELEASE) if (0 != ftError) { - AZStd::string warnMsg = AZStd::string::format("FT_Get_Kerning returned %d", ftError); - CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, warnMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "FT_Get_Kerning returned %d", ftError); } #endif } diff --git a/Gems/AudioSystem/Code/Source/Engine/ATL.cpp b/Gems/AudioSystem/Code/Source/Engine/ATL.cpp index 8fbb8fffc0..e43f7beba7 100644 --- a/Gems/AudioSystem/Code/Source/Engine/ATL.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/ATL.cpp @@ -2170,25 +2170,15 @@ namespace Audio const AZ::Color yellowColor(colorMax, colorMax, colorMin, 0.9f); const AZ::Color redColor(colorMax, colorMin, colorMin, 0.9f); - constexpr const char* tableHeaderNames[] = { - "ID", - "Name", - "Curr Used", - "Peak Used", - "%% of Used", - "Allocs", - "Frees", - }; - constexpr size_t numColumns = AZStd::size(tableHeaderNames); - constexpr float xTablePositions[numColumns] = { 0.f, 40.f, 300.f, 400.f, 500.f, 600.f, 700.f }; - float posY = fPosY; - - // Draw the header info: - for (int column = 0; column < numColumns; ++column) - { - auxGeom.Draw2dLabel(fPosX + xTablePositions[column], posY, textSize, color, false, tableHeaderNames[column]); - } + constexpr float xTablePositions[7] = { 0.f, 40.f, 300.f, 400.f, 500.f, 600.f, 700.f }; + auxGeom.Draw2dLabel(fPosX + xTablePositions[0], posY, textSize, color, false, "ID"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY, textSize, color, false, "Name"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[2], posY, textSize, color, false, "Curr Used"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[3], posY, textSize, color, false, "Peak Used"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[4], posY, textSize, color, false, "%% of Used"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[5], posY, textSize, color, false, "Allocs"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[6], posY, textSize, color, false, "Frees"); // Get the memory pool information... AZStd::vector poolInfos; @@ -2232,15 +2222,15 @@ namespace Audio auxGeom.Draw2dLabel(fPosX + xTablePositions[0], posY, textSize, color, false, "%d", poolInfo.m_poolId); // Name - auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY, textSize, color, false, poolInfo.m_poolName); + auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY, textSize, color, false, "%s", poolInfo.m_poolName); // Current Used (bytes) BytesToString(poolInfo.m_memoryUsed, buffer, bufferSize); - auxGeom.Draw2dLabel(fPosX + xTablePositions[2], posY, textSize, color, false, buffer); + auxGeom.Draw2dLabel(fPosX + xTablePositions[2], posY, textSize, color, false, "%s", buffer); // Peak Used (bytes) BytesToString(poolInfo.m_peakUsed, buffer, bufferSize); - auxGeom.Draw2dLabel(fPosX + xTablePositions[3], posY, textSize, color, false, buffer); + auxGeom.Draw2dLabel(fPosX + xTablePositions[3], posY, textSize, color, false, "%s", buffer); // % of Used (percent) auxGeom.Draw2dLabel(fPosX + xTablePositions[4], posY, textSize, color, false, "%.1f %%", percentUsed); @@ -2255,20 +2245,20 @@ namespace Audio whiteColor.StoreToFloat4(color); posY += (2.f * lineHeight); - auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY, textSize, color, false, tableHeaderNames[1]); - auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY + lineHeight, textSize, color, false, globalInfo.m_poolName); + auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY, textSize, color, false, "Name"); + auxGeom.Draw2dLabel(fPosX + xTablePositions[1], posY + lineHeight, textSize, color, false, "%s", globalInfo.m_poolName); auxGeom.Draw2dLabel(fPosX + xTablePositions[2], posY, textSize, color, false, "Total Used"); BytesToString(globalInfo.m_memoryUsed, buffer, bufferSize); - auxGeom.Draw2dLabel(fPosX + xTablePositions[2], posY + lineHeight, textSize, color, false, buffer); + auxGeom.Draw2dLabel(fPosX + xTablePositions[2], posY + lineHeight, textSize, color, false, "%s", buffer); auxGeom.Draw2dLabel(fPosX + xTablePositions[3], posY, textSize, color, false, "Total Peak"); BytesToString(totalPeak, buffer, bufferSize); - auxGeom.Draw2dLabel(fPosX + xTablePositions[3], posY + lineHeight, textSize, color, false, buffer); + auxGeom.Draw2dLabel(fPosX + xTablePositions[3], posY + lineHeight, textSize, color, false, "%s", buffer); auxGeom.Draw2dLabel(fPosX + xTablePositions[4], posY, textSize, color, false, "Total Size"); BytesToString(globalInfo.m_memoryReserved, buffer, bufferSize); - auxGeom.Draw2dLabel(fPosX + xTablePositions[4], posY + lineHeight, textSize, color, false, buffer); + auxGeom.Draw2dLabel(fPosX + xTablePositions[4], posY + lineHeight, textSize, color, false, "%s", buffer); auxGeom.Draw2dLabel(fPosX + xTablePositions[5], posY, textSize, color, false, "Total Allocs"); auxGeom.Draw2dLabel(fPosX + xTablePositions[5], posY + lineHeight, textSize, color, false, "%" PRIu64, totalAllocs); diff --git a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp index b106c4f9d2..b7ed9229d8 100644 --- a/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp +++ b/Gems/AudioSystem/Code/Source/Engine/FileCacheManager.cpp @@ -446,13 +446,13 @@ namespace Audio } // Format: "relative/path/filename.ext (230 KiB) [2]" - AZStd::string displayString = AZStd::string::format("%s (%zu %s) [%zu]", + auxGeom.Draw2dLabel(positionX, positionY, entryDrawSize, color, false, + "%s (%zu %s) [%zu]", audioFileEntry->m_filePath.c_str(), fileSize, kiloBytes ? "KiB" : "Bytes", audioFileEntry->m_useCount); - auxGeom.Draw2dLabel(positionX, positionY, entryDrawSize, color, false, displayString.c_str()); color[3] = originalAlpha; positionY += entryStepSize; } diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp index 7f4877347f..2df6c9984b 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYEntityOutliner.cpp @@ -84,99 +84,99 @@ namespace ImGui ImGui::Columns(3); ImGui::TextColored(m_displayName.m_color, "Display Name"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayNameCB", &m_displayName.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayNameCol", reinterpret_cast(&m_displayName.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayChildCount.m_color, "Display Child Count"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayChildCountCB", &m_displayChildCount.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayChildCountCol", reinterpret_cast(&m_displayChildCount.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayDescentdantCount.m_color, "Display Descendant Count"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayDescendantCountCB", &m_displayDescentdantCount.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayDescendantCountCol", reinterpret_cast(&m_displayDescentdantCount.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayEntityState.m_color, "Display Entity Status"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayEntityStateCB", &m_displayEntityState.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayEntityStateCol", reinterpret_cast(&m_displayEntityState.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayParentInfo.m_color, "Display Parent Info"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayParentInfoCB", &m_displayParentInfo.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayParentInfoCol", reinterpret_cast(&m_displayParentInfo.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayLocalPos.m_color, "Display Local Position"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayLocalPosCB", &m_displayLocalPos.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayLocalPosCol", reinterpret_cast(&m_displayLocalPos.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayLocalRotation.m_color, "Display Local Rotation"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayLocalRotationCB", &m_displayLocalRotation.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayLocalRotationCol", reinterpret_cast(&m_displayLocalRotation.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayWorldPos.m_color, "Display World Position"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayWorldPosCB", &m_displayWorldPos.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayWorldPosCol", reinterpret_cast(&m_displayWorldPos.m_color)); ImGui::NextColumn(); ImGui::TextColored(m_displayWorldRotation.m_color, "Display World Rotation"); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_OnText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_OnText); ImGui::SameLine(); ImGui::Checkbox("##DisplayWorldRotationCB", &m_displayWorldRotation.m_enabled); ImGui::NextColumn(); - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, s_ColorText); + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "%s", s_ColorText); ImGui::SameLine(); ImGui::ColorEdit4("##DisplayWorldRotationCol", reinterpret_cast(&m_displayWorldRotation.m_color)); @@ -508,7 +508,7 @@ namespace ImGui } else if (sameLine) { - if (ImGui::TreeNode(childTreeNodeStr.c_str(), childTreeNodeStr.c_str())) + if (ImGui::TreeNode(childTreeNodeStr.c_str(), "%s", childTreeNodeStr.c_str())) { ImGuiUpdate_RecursivelyDisplayEntityInfoAndDecendants_DrawDisplayOptions(node, drawInspectButton, drawTargetButton, drawDebugButton, sameLine, drawComponents); @@ -528,7 +528,7 @@ namespace ImGui { ImGuiUpdate_RecursivelyDisplayEntityInfoAndDecendants_DrawDisplayOptions(node, drawInspectButton, drawTargetButton, drawDebugButton, sameLine, drawComponents); childTreeNodeStr = AZStd::string::format("Children ##%s", childTreeNodeStr.c_str()); - if (ImGui::TreeNode(childTreeNodeStr.c_str(), childTreeNodeStr.c_str())) + if (ImGui::TreeNode(childTreeNodeStr.c_str(), "%s", childTreeNodeStr.c_str())) { for (int i = 0; i < node->m_children.size(); i++) { @@ -542,7 +542,7 @@ namespace ImGui else if (!justDrawChildren) { ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "->"); ImGui::SameLine(); - ImGui::Text(childTreeNodeStr.c_str()); + ImGui::Text("%s", childTreeNodeStr.c_str()); ImGuiUpdate_RecursivelyDisplayEntityInfoAndDecendants_DrawDisplayOptions(node, drawInspectButton, drawTargetButton, drawDebugButton, sameLine, drawComponents); } } @@ -561,7 +561,7 @@ namespace ImGui { ImGui::SameLine(); } - ImGui::TextColored(m_displayName.m_color, entityName.c_str()); + ImGui::TextColored(m_displayName.m_color, "%s", entityName.c_str()); } // Draw EntityViewer Button @@ -762,7 +762,7 @@ namespace ImGui { // Draw collapsible menu for the components set AZStd::string uiLabel = AZStd::string::format("Components##%s", node->m_entityId.ToString().c_str()); - if (ImGui::TreeNode(uiLabel.c_str(), uiLabel.c_str())) + if (ImGui::TreeNode(uiLabel.c_str(), "%s", uiLabel.c_str())) { AZ::Entity::ComponentArrayType components = entity->GetComponents(); // we should sort our array of components based on their names. @@ -781,7 +781,7 @@ namespace ImGui bool hasDebug = ComponentHasDebug(component->RTTI_GetType()); // Draw a collapsible menu for each component uiLabel = AZStd::string::format("%s##%s", component->RTTI_GetTypeName(), node->m_entityId.ToString().c_str()); - if (ImGui::TreeNode(uiLabel.c_str(), uiLabel.c_str())) + if (ImGui::TreeNode(uiLabel.c_str(), "%s", uiLabel.c_str())) { if (hasDebug) { @@ -795,7 +795,7 @@ namespace ImGui // Draw a collapsible menu for all Reflected Properties uiLabel = AZStd::string::format("Reflected Properties##%s", node->m_entityId.ToString().c_str()); - if (ImGui::TreeNode(uiLabel.c_str(), uiLabel.c_str())) + if (ImGui::TreeNode(uiLabel.c_str(), "%s", uiLabel.c_str())) { AZ::SerializeContext *serializeContext = nullptr; AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); @@ -820,7 +820,7 @@ namespace ImGui if (hasDebug) { uiLabel = AZStd::string::format("Debug##%s", node->m_entityId.ToString().c_str()); - if (ImGui::TreeNode(uiLabel.c_str(), uiLabel.c_str())) + if (ImGui::TreeNode(uiLabel.c_str(), "%s", uiLabel.c_str())) { // Attempt to draw any debug information for this component ImGuiUpdateDebugComponentListenerBus::Event(ImGuiEntComponentId(node->m_entityId, component->RTTI_GetType()) diff --git a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_widgets.cpp b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_widgets.cpp index 86381358fa..d3b6f5826c 100644 --- a/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_widgets.cpp +++ b/Gems/ImGui/External/ImGui/v1.82/imgui/imgui_widgets.cpp @@ -58,6 +58,7 @@ Index of this file: #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later #pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types +#pragma warning (disable: 4774) // format string expected in argument 2 is not a string literal #endif #endif diff --git a/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp b/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp index cc4e70e010..2b31726d3e 100644 --- a/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp +++ b/Gems/LyShine/Code/Source/Animation/AzEntityNode.cpp @@ -256,20 +256,12 @@ const AZ::SerializeContext::ClassElement* CUiAnimAzEntityNode::ComputeOffsetFrom if (mismatch) { - AZStd::string warnMsg = "Data mismatch reading animation data for type "; - warnMsg += classData->m_typeId.ToString(); - warnMsg += ". The field \""; - warnMsg += paramData.GetName(); - if (!element) - { - warnMsg += "\" cannot be found."; - } - else - { - warnMsg += "\" has a different type to that in the animation data."; - } - warnMsg += " This part of the animation data will be ignored."; - CryWarning(VALIDATOR_MODULE_SHINE, VALIDATOR_WARNING, warnMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SHINE, VALIDATOR_WARNING, + "Data mismatch reading animation data for type %s. The field \"%s\" %s. This part of the animation data will be ignored.", + classData->m_typeId.ToString().c_str(), + paramData.GetName(), + (!element ? "cannot be found" : "has a different type to that in the animation data") + ); return nullptr; } } diff --git a/Gems/LyShine/Code/Source/UiInteractableState.cpp b/Gems/LyShine/Code/Source/UiInteractableState.cpp index e81c48a43a..6027ecf3d7 100644 --- a/Gems/LyShine/Code/Source/UiInteractableState.cpp +++ b/Gems/LyShine/Code/Source/UiInteractableState.cpp @@ -575,10 +575,7 @@ void UiInteractableStateFont::SetFontPathname(const AZStd::string& pathname) fontFamily = gEnv->pCryFont->LoadFontFamily(fileName.c_str()); if (!fontFamily) { - AZStd::string errorMsg = "Error loading a font from "; - errorMsg += fileName.c_str(); - errorMsg += "."; - CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, errorMsg.c_str()); + CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_ERROR, "Error loading a font from %s.", fileName.c_str()); } } diff --git a/cmake/Platform/Common/Clang/Configurations_clang.cmake b/cmake/Platform/Common/Clang/Configurations_clang.cmake index 02a94f4e72..8b6c7e611b 100644 --- a/cmake/Platform/Common/Clang/Configurations_clang.cmake +++ b/cmake/Platform/Common/Clang/Configurations_clang.cmake @@ -19,7 +19,6 @@ ly_append_configurations_options( # Disabled warnings (please do not disable any others without first consulting ly-warnings) -Wrange-loop-analysis -Wno-unknown-warning-option # used as a way to mark warnings that are MSVC only - -Wno-format-security -Wno-inconsistent-missing-override -Wno-parentheses -Wno-reorder diff --git a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake index 647ced54a2..237db5a2ce 100644 --- a/cmake/Platform/Common/MSVC/Configurations_msvc.cmake +++ b/cmake/Platform/Common/MSVC/Configurations_msvc.cmake @@ -41,12 +41,14 @@ ly_append_configurations_options( # Enabling warnings that are disabled by default from /W4 # https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019 /we4296 # 'operator': expression is always false - /we5233 # explicit lambda capture 'identifier' is not used /we4426 # optimization flags changed after including header, may be due to #pragma optimize() #/we4619 # #pragma warning: there is no warning number 'number'. Unfortunately some versions of MSVC 16.X dont filter this warning coming from external headers and Qt has a bad warning in QtCore/qvector.h(340,12) + /we4774 # 'string' : format string expected in argument number is not a string literal /we4777 # 'function' : format string 'string' requires an argument of type 'type1', but variadic argument number has type 'type2 /we5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file /we5032 # detected #pragma warning(push) with no corresponding #pragma warning(pop) + /we5233 # explicit lambda capture 'identifier' is not used + /Zc:forScope # Force Conformance in for Loop Scope /diagnostics:caret # Compiler diagnostic options: includes the column where the issue was found and places a caret (^) under the location in the line of code where the issue was detected.