From be49ad415172bba3447238c9fbd29a0748897ec1 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sat, 22 Feb 2014 18:24:25 +0100 Subject: [PATCH] Add format analysis to format functions in Common. --- neo/framework/Common.h | 4 ++-- neo/framework/Common_local.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/neo/framework/Common.h b/neo/framework/Common.h index 2eedf254..15f110a8 100644 --- a/neo/framework/Common.h +++ b/neo/framework/Common.h @@ -261,11 +261,11 @@ public: // Issues a C++ throw. Normal errors just abort to the game loop, // which is appropriate for media or dynamic logic errors. - virtual void Error( VERIFY_FORMAT_STRING const char* fmt, ... ) = 0; + virtual void Error( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ) = 0; // Fatal errors quit all the way to a system dialog box, which is appropriate for // static internal errors or cases where the system may be corrupted. - virtual void FatalError( VERIFY_FORMAT_STRING const char* fmt, ... ) = 0; + virtual void FatalError( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ) = 0; // Returns key bound to the command virtual const char* KeysFromBinding( const char* bind ) = 0; diff --git a/neo/framework/Common_local.h b/neo/framework/Common_local.h index 590f3e9b..ac52ae6f 100644 --- a/neo/framework/Common_local.h +++ b/neo/framework/Common_local.h @@ -157,15 +157,15 @@ public: virtual void BeginRedirect( char* buffer, int buffersize, void ( *flush )( const char* ) ); virtual void EndRedirect(); virtual void SetRefreshOnPrint( bool set ); - virtual void Printf( VERIFY_FORMAT_STRING const char* fmt, ... ); + virtual void Printf( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ); virtual void VPrintf( const char* fmt, va_list arg ); - virtual void DPrintf( VERIFY_FORMAT_STRING const char* fmt, ... ); - virtual void Warning( VERIFY_FORMAT_STRING const char* fmt, ... ); - virtual void DWarning( VERIFY_FORMAT_STRING const char* fmt, ... ); + virtual void DPrintf( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ); + virtual void Warning( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ); + virtual void DWarning( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ); virtual void PrintWarnings(); virtual void ClearWarnings( const char* reason ); - virtual void Error( VERIFY_FORMAT_STRING const char* fmt, ... ); - virtual void FatalError( VERIFY_FORMAT_STRING const char* fmt, ... ); + virtual void Error( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ); + virtual void FatalError( VERIFY_FORMAT_STRING const char* fmt, ... ) ID_INSTANCE_ATTRIBUTE_PRINTF( 1, 2 ); virtual bool IsShuttingDown() const { return com_shuttingDown;