diff --git a/code/asm/snapvector.c b/code/asm/snapvector.c index da4a430d..3678bbec 100644 --- a/code/asm/snapvector.c +++ b/code/asm/snapvector.c @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * See MASM snapvector.asm for commentary */ -static unsigned char ssemask[16] __attribute__((aligned(16))) = +static unsigned char ssemask[16] Q_ALIGN(16) = { "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00" }; diff --git a/code/botlib/be_aas_main.h b/code/botlib/be_aas_main.h index fce17800..2f172ebb 100644 --- a/code/botlib/be_aas_main.h +++ b/code/botlib/be_aas_main.h @@ -34,7 +34,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA extern aas_t aasworld; //AAS error message -void QDECL AAS_Error(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void QDECL AAS_Error(char *fmt, ...) Q_PRINTF_FUNC(1, 2); //set AAS initialized void AAS_SetInitialized(void); //setup AAS with the given number of entities and clients diff --git a/code/botlib/botlib.h b/code/botlib/botlib.h index 1b1c4bdd..0dbc9609 100644 --- a/code/botlib/botlib.h +++ b/code/botlib/botlib.h @@ -170,7 +170,7 @@ typedef struct bot_entitystate_s typedef struct botlib_import_s { //print messages from the bot library - void (QDECL *Print)(int type, char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + void (QDECL *Print)(int type, char *fmt, ...) Q_PRINTF_FUNC(2, 3); //trace a bbox through the world void (*Trace)(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); //trace a bbox against a specific entity diff --git a/code/botlib/l_log.h b/code/botlib/l_log.h index 8b3153d1..792d6b27 100644 --- a/code/botlib/l_log.h +++ b/code/botlib/l_log.h @@ -36,9 +36,9 @@ void Log_Close(void); //close log file if present void Log_Shutdown(void); //write to the current opened log file -void QDECL Log_Write(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void QDECL Log_Write(char *fmt, ...) Q_PRINTF_FUNC(1, 2); //write to the current opened log file with a time stamp -void QDECL Log_WriteTimeStamped(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void QDECL Log_WriteTimeStamped(char *fmt, ...) Q_PRINTF_FUNC(1, 2); //returns a pointer to the log file FILE *Log_FilePointer(void); //flush log file diff --git a/code/botlib/l_precomp.h b/code/botlib/l_precomp.h index cce79db9..55c3d0bd 100644 --- a/code/botlib/l_precomp.h +++ b/code/botlib/l_precomp.h @@ -148,9 +148,9 @@ source_t *LoadSourceMemory(char *ptr, int length, char *name); //free the given source void FreeSource(source_t *source); //print a source error -void QDECL SourceError(source_t *source, char *str, ...) __attribute__ ((format (printf, 2, 3))); +void QDECL SourceError(source_t *source, char *str, ...) Q_PRINTF_FUNC(2, 3); //print a source warning -void QDECL SourceWarning(source_t *source, char *str, ...) __attribute__ ((format (printf, 2, 3))); +void QDECL SourceWarning(source_t *source, char *str, ...) Q_PRINTF_FUNC(2, 3); #ifdef BSPC // some of BSPC source does include game/q_shared.h and some does not diff --git a/code/botlib/l_script.h b/code/botlib/l_script.h index f8b7483a..816e0b10 100644 --- a/code/botlib/l_script.h +++ b/code/botlib/l_script.h @@ -240,8 +240,8 @@ void FreeScript(script_t *script); //set the base folder to load files from void PS_SetBaseFolder(char *path); //print a script error with filename and line number -void QDECL ScriptError(script_t *script, char *str, ...) __attribute__ ((format (printf, 2, 3))); +void QDECL ScriptError(script_t *script, char *str, ...) Q_PRINTF_FUNC(2, 3); //print a script warning with filename and line number -void QDECL ScriptWarning(script_t *script, char *str, ...) __attribute__ ((format (printf, 2, 3))); +void QDECL ScriptWarning(script_t *script, char *str, ...) Q_PRINTF_FUNC(2, 3); diff --git a/code/cgame/cg_local.h b/code/cgame/cg_local.h index 0416824d..6546d4d5 100644 --- a/code/cgame/cg_local.h +++ b/code/cgame/cg_local.h @@ -1198,8 +1198,8 @@ extern vmCvar_t cg_obeliskRespawnDelay; const char *CG_ConfigString( int index ); const char *CG_Argv( int arg ); -void QDECL CG_Printf( const char *msg, ... ) __attribute__ ((format (printf, 1, 2))); -void QDECL CG_Error( const char *msg, ... ) __attribute__ ((noreturn, format (printf, 1, 2))); +void QDECL CG_Printf( const char *msg, ... ) Q_PRINTF_FUNC(1, 2); +void QDECL CG_Error( const char *msg, ... ) Q_NO_RETURN Q_PRINTF_FUNC(1, 2); void CG_StartMusic( void ); @@ -1483,7 +1483,7 @@ void CG_CheckChangedPredictableEvents( playerState_t *ps ); void trap_Print( const char *fmt ); // abort the game -void trap_Error(const char *fmt) __attribute__((noreturn)); +void trap_Error(const char *fmt) Q_NO_RETURN; // milliseconds should only be used for performance tuning, never // for anything game related. Get time from the CG_DrawActiveFrame parameter diff --git a/code/client/cl_main.c b/code/client/cl_main.c index 57ae9a83..6d56e9df 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -3121,7 +3121,7 @@ CL_RefPrintf DLL glue ================ */ -static __attribute__ ((format (printf, 2, 3))) void QDECL CL_RefPrintf( int print_level, const char *fmt, ...) { +static Q_PRINTF_FUNC(2, 3) void QDECL CL_RefPrintf( int print_level, const char *fmt, ...) { va_list argptr; char msg[MAXPRINTMSG]; diff --git a/code/game/ai_main.h b/code/game/ai_main.h index 40f5bb47..9c3f3c71 100644 --- a/code/game/ai_main.h +++ b/code/game/ai_main.h @@ -284,7 +284,7 @@ extern float floattime; #define FloatTime() floattime // from the game source -void QDECL BotAI_Print(int type, char *fmt, ...) __attribute__ ((format (printf, 2, 3))); +void QDECL BotAI_Print(int type, char *fmt, ...) Q_PRINTF_FUNC(2, 3); void QDECL QDECL BotAI_BotInitialChat( bot_state_t *bs, char *type, ... ); void BotAI_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); int BotAI_GetClientState( int clientNum, playerState_t *state ); diff --git a/code/game/bg_lib.h b/code/game/bg_lib.h index 75e3a44e..924e92bb 100644 --- a/code/game/bg_lib.h +++ b/code/game/bg_lib.h @@ -26,13 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #if !defined( BG_LIB_H ) && defined( Q3_VM ) #define BG_LIB_H -//Ignore __attribute__ on non-gcc platforms -#ifndef __GNUC__ -#ifndef __attribute__ -#define __attribute__(x) -#endif -#endif - #ifndef NULL #define NULL ((void *)0) #endif @@ -103,7 +96,7 @@ long strtol( const char *nptr, char **endptr, int base ); int Q_vsnprintf( char *buffer, size_t length, const char *fmt, va_list argptr ); -int sscanf( const char *buffer, const char *fmt, ... ) __attribute__ ((format (scanf, 2, 3))); +int sscanf( const char *buffer, const char *fmt, ... ) Q_SCANF_FUNC(2, 3); // Memory functions void *memmove( void *dest, const void *src, size_t count ); diff --git a/code/game/g_local.h b/code/game/g_local.h index d6511922..10ec8dbf 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -604,10 +604,10 @@ void SetLeader(int team, int client); void CheckTeamLeader( int team ); void G_RunThink (gentity_t *ent); void AddTournamentQueue(gclient_t *client); -void QDECL G_LogPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); +void QDECL G_LogPrintf( const char *fmt, ... ) Q_PRINTF_FUNC(1, 2); void SendScoreboardMessageToAllClients( void ); -void QDECL G_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); -void QDECL G_Error( const char *fmt, ... ) __attribute__ ((noreturn, format (printf, 1, 2))); +void QDECL G_Printf( const char *fmt, ... ) Q_PRINTF_FUNC(1, 2); +void QDECL G_Error( const char *fmt, ... ) Q_NO_RETURN Q_PRINTF_FUNC(1, 2); // // g_client.c @@ -747,7 +747,7 @@ extern vmCvar_t g_proxMineTimeout; extern vmCvar_t g_localTeamPref; void trap_Print( const char *text ); -void trap_Error( const char *text ) __attribute__((noreturn)); +void trap_Error( const char *text ) Q_NO_RETURN; int trap_Milliseconds( void ); int trap_RealTime( qtime_t *qtime ); int trap_Argc( void ); diff --git a/code/game/g_team.c b/code/game/g_team.c index 0f5a34c5..ada16f11 100644 --- a/code/game/g_team.c +++ b/code/game/g_team.c @@ -92,7 +92,7 @@ const char *TeamColorString(int team) { } // NULL for everyone -static __attribute__ ((format (printf, 2, 3))) void QDECL PrintMsg( gentity_t *ent, const char *fmt, ... ) { +static Q_PRINTF_FUNC(2, 3) void QDECL PrintMsg( gentity_t *ent, const char *fmt, ... ) { char msg[1024]; va_list argptr; char *p; diff --git a/code/q3_ui/ui_local.h b/code/q3_ui/ui_local.h index 1135a52d..33217bf0 100644 --- a/code/q3_ui/ui_local.h +++ b/code/q3_ui/ui_local.h @@ -626,7 +626,7 @@ void UI_SPSkillMenu_Cache( void ); // ui_syscalls.c // void trap_Print( const char *string ); -void trap_Error( const char *string ) __attribute__((noreturn)); +void trap_Error( const char *string ) Q_NO_RETURN; int trap_Milliseconds( void ); void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags ); void trap_Cvar_Update( vmCvar_t *vmCvar ); diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 313bc5a2..c5b1f00d 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -2280,7 +2280,7 @@ Just throw a fatal error to test error shutdown procedures ============= */ -static void __attribute__((__noreturn__)) Com_Error_f (void) { +static void Q_NO_RETURN Com_Error_f (void) { if ( Cmd_Argc() > 1 ) { Com_Error( ERR_DROP, "Testing drop error" ); } else { diff --git a/code/qcommon/q_shared.c b/code/qcommon/q_shared.c index e845c283..e75fa2f0 100644 --- a/code/qcommon/q_shared.c +++ b/code/qcommon/q_shared.c @@ -753,7 +753,7 @@ int Q_isalpha( int c ) qboolean Q_isanumber( const char *s ) { char *p; - double UNUSED_VAR d; + double Q_UNUSED_VAR d; if( *s == '\0' ) return qfalse; diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index 5af3c3b5..262a9eb9 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -105,17 +105,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA //#pragma intrinsic( memset, memcpy ) #endif -//Ignore __attribute__ on non-gcc platforms -#ifndef __GNUC__ -#ifndef __attribute__ -#define __attribute__(x) -#endif -#endif - #ifdef __GNUC__ -#define UNUSED_VAR __attribute__((unused)) +#define Q_UNUSED_VAR __attribute__((unused)) +#define Q_NO_RETURN __attribute__((noreturn)) +#define Q_PRINTF_FUNC(fmt, va) __attribute__((format(printf, fmt, va))) +#define Q_SCANF_FUNC(fmt, va) __attribute__((format(scanf, fmt, va))) +#define Q_ALIGN(x) __attribute__((aligned(x))) #else -#define UNUSED_VAR +#define Q_UNUSED_VAR +#define Q_NO_RETURN +#define Q_PRINTF_FUNC(fmt, va) +#define Q_SCANF_FUNC(fmt, va) +#define Q_ALIGN(x) #endif #if (defined _MSC_VER) @@ -199,12 +200,6 @@ typedef int clipHandle_t; #define PADP(base, alignment) ((void *) PAD((intptr_t) (base), (alignment))) -#ifdef __GNUC__ -#define QALIGN(x) __attribute__((aligned(x))) -#else -#define QALIGN(x) -#endif - #ifndef NULL #define NULL ((void *)0) #endif @@ -733,8 +728,8 @@ int COM_GetCurrentParseLine( void ); char *COM_Parse( char **data_p ); char *COM_ParseExt( char **data_p, qboolean allowLineBreak ); int COM_Compress( char *data_p ); -void COM_ParseError( char *format, ... ) __attribute__ ((format (printf, 1, 2))); -void COM_ParseWarning( char *format, ... ) __attribute__ ((format (printf, 1, 2))); +void COM_ParseError( char *format, ... ) Q_PRINTF_FUNC(1, 2); +void COM_ParseWarning( char *format, ... ) Q_PRINTF_FUNC(1, 2); //int COM_ParseInfos( char *buf, int max, char infos[][MAX_INFO_STRING] ); #define MAX_TOKENLENGTH 1024 @@ -769,7 +764,7 @@ void Parse2DMatrix (char **buf_p, int y, int x, float *m); void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m); int Com_HexStrToInt( const char *str ); -int QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); +int QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) Q_PRINTF_FUNC(3, 4); char *Com_SkipTokens( char *s, int numTokens, char *sep ); char *Com_SkipCharset( char *s, char *sep ); @@ -847,7 +842,7 @@ float LittleFloat (const float *l); void Swap_Init (void); */ -char * QDECL va(char *format, ...) __attribute__ ((format (printf, 1, 2))); +char * QDECL va(char *format, ...) Q_PRINTF_FUNC(1, 2); #define TRUNCATE_LENGTH 64 void Com_TruncateLongString( char *buffer, const char *s ); @@ -866,8 +861,8 @@ qboolean Info_Validate( const char *s ); void Info_NextPair( const char **s, char *key, char *value ); // this is only here so the functions in q_shared.c and bg_*.c can link -void QDECL Com_Error( int level, const char *error, ... ) __attribute__ ((noreturn, format(printf, 2, 3))); -void QDECL Com_Printf( const char *msg, ... ) __attribute__ ((format (printf, 1, 2))); +void QDECL Com_Error( int level, const char *error, ... ) Q_NO_RETURN Q_PRINTF_FUNC(2, 3); +void QDECL Com_Printf( const char *msg, ... ) Q_PRINTF_FUNC(1, 2); /* diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h index de05cfd9..a6751c67 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h @@ -25,13 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "../qcommon/cm_public.h" -//Ignore __attribute__ on non-gcc platforms -#ifndef __GNUC__ -#ifndef __attribute__ -#define __attribute__(x) -#endif -#endif - //#define PRE_RELEASE_DEMO //============================================================================ @@ -172,7 +165,7 @@ void NET_Restart_f( void ); void NET_Config( qboolean enableNetworking ); void NET_FlushPacketQueue(void); void NET_SendPacket (netsrc_t sock, int length, const void *data, netadr_t to); -void QDECL NET_OutOfBandPrint( netsrc_t net_socket, netadr_t adr, const char *format, ...) __attribute__ ((format (printf, 3, 4))); +void QDECL NET_OutOfBandPrint( netsrc_t net_socket, netadr_t adr, const char *format, ...) Q_PRINTF_FUNC(3, 4); void QDECL NET_OutOfBandData( netsrc_t sock, netadr_t adr, byte *format, int len ); qboolean NET_CompareAdr (netadr_t a, netadr_t b); @@ -692,7 +685,7 @@ int FS_FTell( fileHandle_t f ); void FS_Flush( fileHandle_t f ); -void QDECL FS_Printf( fileHandle_t f, const char *fmt, ... ) __attribute__ ((format (printf, 2, 3))); +void QDECL FS_Printf( fileHandle_t f, const char *fmt, ... ) Q_PRINTF_FUNC(2, 3); // like fprintf int FS_FOpenFileByMode( const char *qpath, fileHandle_t *f, fsMode_t mode ); @@ -821,10 +814,10 @@ void Info_Print( const char *s ); void Com_BeginRedirect (char *buffer, int buffersize, void (*flush)(char *)); void Com_EndRedirect( void ); -void QDECL Com_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); -void QDECL Com_DPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); -void QDECL Com_Error( int code, const char *fmt, ... ) __attribute__ ((noreturn, format(printf, 2, 3))); -void Com_Quit_f( void ) __attribute__ ((noreturn)); +void QDECL Com_Printf( const char *fmt, ... ) Q_PRINTF_FUNC(1, 2); +void QDECL Com_DPrintf( const char *fmt, ... ) Q_PRINTF_FUNC(1, 2); +void QDECL Com_Error( int code, const char *fmt, ... ) Q_NO_RETURN Q_PRINTF_FUNC(2, 3); +void Com_Quit_f( void ) Q_NO_RETURN; void Com_GameRestart(int checksumFeed, qboolean disconnect); int Com_Milliseconds( void ); // will be journaled properly @@ -1087,8 +1080,8 @@ qboolean Sys_DllExtension( const char *name ); char *Sys_GetCurrentUser( void ); -void QDECL Sys_Error( const char *error, ...) __attribute__ ((noreturn, format (printf, 1, 2))); -void Sys_Quit (void) __attribute__ ((noreturn)); +void QDECL Sys_Error( const char *error, ...) Q_NO_RETURN Q_PRINTF_FUNC(1, 2); +void Sys_Quit (void) Q_NO_RETURN; char *Sys_GetClipboardData( void ); // note that this isn't journaled... void Sys_Print( const char *msg ); diff --git a/code/qcommon/qfiles.h b/code/qcommon/qfiles.h index 9f2b5fb2..329d4004 100644 --- a/code/qcommon/qfiles.h +++ b/code/qcommon/qfiles.h @@ -27,13 +27,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // This file must be identical in the quake and utils directories // -//Ignore __attribute__ on non-gcc platforms -#ifndef __GNUC__ -#ifndef __attribute__ -#define __attribute__(x) -#endif -#endif - // surface geometry should not exceed these limits #define SHADER_MAX_VERTEXES 1000 #define SHADER_MAX_INDEXES (6*SHADER_MAX_VERTEXES) diff --git a/code/qcommon/vm_armv7l.c b/code/qcommon/vm_armv7l.c index acee582f..932761d8 100644 --- a/code/qcommon/vm_armv7l.c +++ b/code/qcommon/vm_armv7l.c @@ -217,7 +217,7 @@ Error handler for jump/call to invalid instruction number ================= */ -static void __attribute__((__noreturn__)) ErrJump(unsigned num) +static void NO_RETURN ErrJump(unsigned num) { Com_Error(ERR_DROP, "program tried to execute code outside VM (%x)", num); } diff --git a/code/qcommon/vm_x86.c b/code/qcommon/vm_x86.c index 661149d0..5e075f86 100644 --- a/code/qcommon/vm_x86.c +++ b/code/qcommon/vm_x86.c @@ -389,7 +389,7 @@ Error handler for jump/call to invalid instruction number ================= */ -static void __attribute__((__noreturn__)) ErrJump(void) +static void Q_NO_RETURN ErrJump(void) { Com_Error(ERR_DROP, "program tried to execute code outside VM"); } diff --git a/code/renderercommon/tr_public.h b/code/renderercommon/tr_public.h index 8573860b..21739f99 100644 --- a/code/renderercommon/tr_public.h +++ b/code/renderercommon/tr_public.h @@ -106,10 +106,10 @@ typedef struct { // typedef struct { // print message on the local console - void (QDECL *Printf)( int printLevel, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); + void (QDECL *Printf)( int printLevel, const char *fmt, ...) Q_PRINTF_FUNC(2, 3); // abort the game - void (QDECL *Error)( int errorLevel, const char *fmt, ...) __attribute__ ((noreturn, format (printf, 2, 3))); + void (QDECL *Error)( int errorLevel, const char *fmt, ...) Q_NO_RETURN Q_PRINTF_FUNC(2, 3); // milliseconds should only be used for profiling, never // for anything game related. Get time from the refdef diff --git a/code/renderergl1/tr_altivec.c b/code/renderergl1/tr_altivec.c index 914aa448..1666d2b0 100644 --- a/code/renderergl1/tr_altivec.c +++ b/code/renderergl1/tr_altivec.c @@ -287,10 +287,10 @@ void LerpMeshVertexes_altivec(md3Surface_t *surf, float backlerp) { short *oldXyz, *newXyz, *oldNormals, *newNormals; float *outXyz, *outNormal; - float oldXyzScale QALIGN(16); - float newXyzScale QALIGN(16); - float oldNormalScale QALIGN(16); - float newNormalScale QALIGN(16); + float oldXyzScale Q_ALIGN(16); + float newXyzScale Q_ALIGN(16); + float oldNormalScale Q_ALIGN(16); + float newNormalScale Q_ALIGN(16); int vertNum; unsigned lat, lng; int numVerts; diff --git a/code/renderergl1/tr_local.h b/code/renderergl1/tr_local.h index e07f575b..678f7b4e 100644 --- a/code/renderergl1/tr_local.h +++ b/code/renderergl1/tr_local.h @@ -1226,16 +1226,16 @@ typedef struct stageVars typedef struct shaderCommands_s { - glIndex_t indexes[SHADER_MAX_INDEXES] QALIGN(16); - vec4_t xyz[SHADER_MAX_VERTEXES] QALIGN(16); - vec4_t normal[SHADER_MAX_VERTEXES] QALIGN(16); - vec2_t texCoords[SHADER_MAX_VERTEXES][2] QALIGN(16); - color4ub_t vertexColors[SHADER_MAX_VERTEXES] QALIGN(16); - int vertexDlightBits[SHADER_MAX_VERTEXES] QALIGN(16); + glIndex_t indexes[SHADER_MAX_INDEXES] Q_ALIGN(16); + vec4_t xyz[SHADER_MAX_VERTEXES] Q_ALIGN(16); + vec4_t normal[SHADER_MAX_VERTEXES] Q_ALIGN(16); + vec2_t texCoords[SHADER_MAX_VERTEXES][2] Q_ALIGN(16); + color4ub_t vertexColors[SHADER_MAX_VERTEXES] Q_ALIGN(16); + int vertexDlightBits[SHADER_MAX_VERTEXES] Q_ALIGN(16); - stageVars_t svars QALIGN(16); + stageVars_t svars Q_ALIGN(16); - color4ub_t constantColor255[SHADER_MAX_VERTEXES] QALIGN(16); + color4ub_t constantColor255[SHADER_MAX_VERTEXES] Q_ALIGN(16); shader_t *shader; double shaderTime; diff --git a/code/renderergl2/tr_local.h b/code/renderergl2/tr_local.h index 687a8ef0..1f0c80dc 100644 --- a/code/renderergl2/tr_local.h +++ b/code/renderergl2/tr_local.h @@ -2046,24 +2046,24 @@ typedef struct stageVars typedef struct shaderCommands_s { - glIndex_t indexes[SHADER_MAX_INDEXES] QALIGN(16); - vec4_t xyz[SHADER_MAX_VERTEXES] QALIGN(16); - int16_t normal[SHADER_MAX_VERTEXES][4] QALIGN(16); - int16_t tangent[SHADER_MAX_VERTEXES][4] QALIGN(16); - vec2_t texCoords[SHADER_MAX_VERTEXES] QALIGN(16); - vec2_t lightCoords[SHADER_MAX_VERTEXES] QALIGN(16); - uint16_t color[SHADER_MAX_VERTEXES][4] QALIGN(16); - int16_t lightdir[SHADER_MAX_VERTEXES][4] QALIGN(16); - //int vertexDlightBits[SHADER_MAX_VERTEXES] QALIGN(16); + glIndex_t indexes[SHADER_MAX_INDEXES] Q_ALIGN(16); + vec4_t xyz[SHADER_MAX_VERTEXES] Q_ALIGN(16); + int16_t normal[SHADER_MAX_VERTEXES][4] Q_ALIGN(16); + int16_t tangent[SHADER_MAX_VERTEXES][4] Q_ALIGN(16); + vec2_t texCoords[SHADER_MAX_VERTEXES] Q_ALIGN(16); + vec2_t lightCoords[SHADER_MAX_VERTEXES] Q_ALIGN(16); + uint16_t color[SHADER_MAX_VERTEXES][4] Q_ALIGN(16); + int16_t lightdir[SHADER_MAX_VERTEXES][4] Q_ALIGN(16); + //int vertexDlightBits[SHADER_MAX_VERTEXES] Q_ALIGN(16); void *attribPointers[ATTR_INDEX_COUNT]; vao_t *vao; qboolean useInternalVao; qboolean useCacheVao; - stageVars_t svars QALIGN(16); + stageVars_t svars Q_ALIGN(16); - //color4ub_t constantColor255[SHADER_MAX_VERTEXES] QALIGN(16); + //color4ub_t constantColor255[SHADER_MAX_VERTEXES] Q_ALIGN(16); shader_t *shader; double shaderTime; diff --git a/code/server/server.h b/code/server/server.h index ec1620aa..9526d4ab 100644 --- a/code/server/server.h +++ b/code/server/server.h @@ -333,7 +333,7 @@ qboolean SVC_RateLimit( leakyBucket_t *bucket, int burst, int period ); qboolean SVC_RateLimitAddress( netadr_t from, int burst, int period ); void SV_FinalMessage (char *message); -void QDECL SV_SendServerCommand( client_t *cl, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); +void QDECL SV_SendServerCommand( client_t *cl, const char *fmt, ...) Q_PRINTF_FUNC(2, 3); void SV_AddOperatorCommands (void); diff --git a/code/server/sv_bot.c b/code/server/sv_bot.c index 58503542..44d283d2 100644 --- a/code/server/sv_bot.c +++ b/code/server/sv_bot.c @@ -133,7 +133,7 @@ void BotDrawDebugPolygons(void (*drawPoly)(int color, int numPoints, float *poin BotImport_Print ================== */ -static __attribute__ ((format (printf, 2, 3))) void QDECL BotImport_Print(int type, char *fmt, ...) +static Q_PRINTF_FUNC(2, 3) void QDECL BotImport_Print(int type, char *fmt, ...) { char str[2048]; va_list ap; diff --git a/code/server/sv_rankings.c b/code/server/sv_rankings.c index 63a38870..2eb01560 100644 --- a/code/server/sv_rankings.c +++ b/code/server/sv_rankings.c @@ -68,7 +68,7 @@ static void SV_RankEncodeGameID( uint64_t game_id, char* result, static uint64_t SV_RankDecodePlayerID( const char* string ); static void SV_RankDecodePlayerKey( const char* string, GR_PLAYER_TOKEN key ); static char* SV_RankStatusString( GR_STATUS status ); -static void SV_RankError( const char* fmt, ... ) __attribute__ ((format (printf, 1, 2))); +static void SV_RankError( const char* fmt, ... ) Q_PRINTF_FUNC(1, 2); static char SV_RankGameKey[64]; /* diff --git a/code/sys/con_tty.c b/code/sys/con_tty.c index 58f178ad..d780f55c 100644 --- a/code/sys/con_tty.c +++ b/code/sys/con_tty.c @@ -87,7 +87,7 @@ send "\b \b" static void CON_Back( void ) { char key; - size_t UNUSED_VAR size; + size_t Q_UNUSED_VAR size; key = '\b'; size = write(STDOUT_FILENO, &key, 1); @@ -148,7 +148,7 @@ static void CON_Show( void ) ttycon_hide--; if (ttycon_hide == 0) { - size_t UNUSED_VAR size; + size_t Q_UNUSED_VAR size; size = write(STDOUT_FILENO, TTY_CONSOLE_PROMPT, strlen(TTY_CONSOLE_PROMPT)); if (TTY_con.cursor) { @@ -337,7 +337,7 @@ char *CON_Input( void ) int avail; char key; field_t *history; - size_t UNUSED_VAR size; + size_t Q_UNUSED_VAR size; if(ttycon_on) { diff --git a/code/sys/sys_local.h b/code/sys/sys_local.h index ce9f99b3..7003bb8f 100644 --- a/code/sys/sys_local.h +++ b/code/sys/sys_local.h @@ -61,7 +61,7 @@ void Sys_GLimpSafeInit( void ); void Sys_GLimpInit( void ); void Sys_PlatformInit( void ); void Sys_PlatformExit( void ); -void Sys_SigHandler( int signal ) __attribute__ ((noreturn)); +void Sys_SigHandler( int signal ) Q_NO_RETURN; void Sys_ErrorDialog( const char *error ); void Sys_AnsiColorPrint( const char *msg ); diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c index 6101fded..623a197f 100644 --- a/code/sys/sys_main.c +++ b/code/sys/sys_main.c @@ -284,7 +284,7 @@ Sys_Exit Single exit point (regular exit or in case of error) ================= */ -static __attribute__ ((noreturn)) void Sys_Exit( int exitCode ) +static Q_NO_RETURN void Sys_Exit( int exitCode ) { CON_Shutdown( ); @@ -453,7 +453,7 @@ void Sys_Error( const char *error, ... ) Sys_Warn ================= */ -static __attribute__ ((format (printf, 1, 2))) void Sys_Warn( char *warning, ... ) +static Q_PRINTF_FUNC(1, 2) void Sys_Warn( char *warning, ... ) { va_list argptr; char string[1024]; diff --git a/code/ui/ui_local.h b/code/ui/ui_local.h index ae181823..4773196b 100644 --- a/code/ui/ui_local.h +++ b/code/ui/ui_local.h @@ -918,7 +918,7 @@ void UI_SPSkillMenu_Cache( void ); // ui_syscalls.c // void trap_Print( const char *string ); -void trap_Error(const char *string) __attribute__((noreturn)); +void trap_Error(const char *string) Q_NO_RETURN; int trap_Milliseconds( void ); void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags ); void trap_Cvar_Update( vmCvar_t *vmCvar ); diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c index e8b3a10e..8c79faf1 100644 --- a/code/ui/ui_shared.c +++ b/code/ui/ui_shared.c @@ -255,7 +255,7 @@ void String_Init(void) { PC_SourceWarning ================= */ -static __attribute__ ((format (printf, 2, 3))) void PC_SourceWarning(int handle, char *format, ...) { +static Q_PRINTF_FUNC(2, 3) void PC_SourceWarning(int handle, char *format, ...) { int line; char filename[128]; va_list argptr; @@ -278,7 +278,7 @@ static __attribute__ ((format (printf, 2, 3))) void PC_SourceWarning(int handle, PC_SourceError ================= */ -static __attribute__ ((format (printf, 2, 3))) void PC_SourceError(int handle, char *format, ...) { +static Q_PRINTF_FUNC(2, 3) void PC_SourceError(int handle, char *format, ...) { int line; char filename[128]; va_list argptr; diff --git a/code/ui/ui_shared.h b/code/ui/ui_shared.h index e70c716f..ceddda46 100644 --- a/code/ui/ui_shared.h +++ b/code/ui/ui_shared.h @@ -355,8 +355,8 @@ typedef struct { void (*getBindingBuf)( int keynum, char *buf, int buflen ); void (*setBinding)( int keynum, const char *binding ); void (*executeText)(int exec_when, const char *text ); - void (*Error)(int level, const char *error, ...) __attribute__ ((noreturn, format (printf, 2, 3))); - void (*Print)(const char *msg, ...) __attribute__ ((format (printf, 1, 2))); + void (*Error)(int level, const char *error, ...) Q_NO_RETURN Q_PRINTF_FUNC(2, 3); + void (*Print)(const char *msg, ...) Q_PRINTF_FUNC(1, 2); void (*Pause)(qboolean b); int (*ownerDrawWidth)(int ownerDraw, float scale); sfxHandle_t (*registerSound)(const char *name, qboolean compressed);