Fix some format errors. (PR #1042)

This commit is contained in:
Andrea 2022-02-26 17:15:09 +00:00 committed by GitHub
parent 5a5d0e2df4
commit 9ad6b11cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 13 deletions

View File

@ -76,7 +76,7 @@ static LPSTR GetNextArg(LPSTR lpCmdLine)
{
*lpCmdLine++ = 0x00;
while ((*lpCmdLine == ' ')) // Skip multiple spaces between args
while (*lpCmdLine == ' ') // Skip multiple spaces between args
lpCmdLine++;
break;
}

View File

@ -4163,7 +4163,7 @@ Update_t CmdMemoryLoad (int nArgs)
CmdConfigGetDebugDir( 0 );
ConsoleBufferPushFormat( "File: ", g_sMemoryLoadSaveFileName.c_str() );
ConsoleBufferPushFormat( "File: %s", g_sMemoryLoadSaveFileName.c_str() );
}
return ConsoleUpdate();
@ -7479,7 +7479,7 @@ int FindCommand( LPCTSTR pName, CmdFuncPtr_t & pFunction_, int * iCommand_ )
//===========================================================================
void DisplayAmbigiousCommands( int nFound )
{
ConsolePrintFormat("Ambiguous %s%d%s Commands:"
ConsolePrintFormat("Ambiguous %s%" SIZE_T_FMT "%s Commands:"
, CHC_NUM_DEC
, g_vPotentialCommands.size()
, CHC_DEFAULT

View File

@ -263,7 +263,8 @@
std::string strText = StrFormatV(pFormat, va);
ConsolePrint(strText.c_str());
}
inline void ConsolePrintFormat( const char* pFormat, ... ) ATTRIBUTE_FORMAT_PRINTF(1, 2)
inline void ConsolePrintFormat( const char* pFormat, ... ) ATTRIBUTE_FORMAT_PRINTF(1, 2);
inline void ConsolePrintFormat( const char* pFormat, ... )
{
va_list va;
va_start(va, pFormat);
@ -281,7 +282,8 @@
std::string strText = StrFormatV(pFormat, va);
ConsoleBufferPush(strText.c_str());
}
inline void ConsoleBufferPushFormat( const char* pFormat, ... ) ATTRIBUTE_FORMAT_PRINTF(1, 2)
inline void ConsoleBufferPushFormat( const char* pFormat, ... ) ATTRIBUTE_FORMAT_PRINTF(1, 2);
inline void ConsoleBufferPushFormat( const char* pFormat, ... )
{
va_list va;
va_start(va, pFormat);
@ -298,7 +300,8 @@
std::string strText = StrFormatV(pFormat, va);
return ConsoleDisplayError(strText.c_str());
}
inline Update_t ConsoleDisplayErrorFormat(const char* pFormat, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2)
inline Update_t ConsoleDisplayErrorFormat(const char* pFormat, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
inline Update_t ConsoleDisplayErrorFormat(const char* pFormat, ...)
{
va_list va;
va_start(va, pFormat);
@ -313,7 +316,8 @@
std::string strText = StrFormatV(pFormat, va);
ConsoleDisplayPush(strText.c_str());
}
inline void ConsoleDisplayPushFormat(const char* pFormat, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2)
inline void ConsoleDisplayPushFormat(const char* pFormat, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
inline void ConsoleDisplayPushFormat(const char* pFormat, ...)
{
va_list va;
va_start(va, pFormat);

View File

@ -496,7 +496,9 @@ inline bool ConsoleColorizePrintVa( const char* format, va_list va )
return ConsoleColorizePrint(strText.c_str());
}
inline bool ConsoleColorizePrintFormat( const char* format, ... ) ATTRIBUTE_FORMAT_PRINTF(1, 2)
inline bool ConsoleColorizePrintFormat( const char* format, ... ) ATTRIBUTE_FORMAT_PRINTF(1, 2);
inline bool ConsoleColorizePrintFormat( const char* format, ... )
{
va_list va;
va_start(va, format);
@ -1071,7 +1073,7 @@ Update_t CmdHelpSpecific (int nArgs)
{
ConsoleColorizePrint( " Note: All arguments effect the disassembly view" );
ConsoleColorizePrintFormat( " Usage: [%s%s | %s | %s%s | %s%s | %s%s | %s%s]"
ConsoleColorizePrintFormat( " Usage: [%s%s | %s%s | %s%s | %s%s | %s%s | %s%s]"
, CHC_COMMAND
, g_aParameters[ PARAM_CONFIG_BRANCH ].m_sName
, CHC_COMMAND
@ -1592,10 +1594,10 @@ Update_t CmdVersion (int nArgs)
if ((! _tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName )) ||
(! _tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName )) )
{
ConsoleBufferPushFormat( " Arg: %d bytes * %d = %d bytes",
ConsoleBufferPushFormat( " Arg: %" SIZE_T_FMT " bytes * %d = %" SIZE_T_FMT " bytes",
sizeof(Arg_t), MAX_ARGS, sizeof(g_aArgs) );
ConsoleBufferPushFormat( " Console: %d bytes * %d height = %d bytes",
ConsoleBufferPushFormat( " Console: %" SIZE_T_FMT " bytes * %d height = %" SIZE_T_FMT " bytes",
sizeof( g_aConsoleDisplay[0] ), CONSOLE_HEIGHT, sizeof(g_aConsoleDisplay) );
ConsoleBufferPushFormat( " Commands: %d (Aliased: %d) Params: %d",

View File

@ -214,7 +214,7 @@ public:
delete[] m_pMbStr;
}
void Save(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
void Save(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3); // 1 is "this"
void SaveInt(const char* key, int value);
void SaveUint(const char* key, UINT value);
@ -235,7 +235,7 @@ public:
class Label
{
public:
Label(YamlSaveHelper& rYamlSaveHelper, const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3) :
Label(YamlSaveHelper& rYamlSaveHelper, const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(3, 4) : // 1 is "this"
yamlSaveHelper(rYamlSaveHelper)
{
fwrite(yamlSaveHelper.m_szIndent, 1, yamlSaveHelper.m_indent, yamlSaveHelper.m_hFile);