From 20c6d1e33ffdfe73caeb50a4a88c343628c5a031 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 19 Jun 2012 14:51:02 +0000 Subject: [PATCH] rename trap_Printf() to trap_Print() in the game module, as that function has nothing to do with printf()-like formatting From /dev/humancontroller. --- code/game/g_bot.c | 22 +++++++++++----------- code/game/g_local.h | 4 ++-- code/game/g_main.c | 2 +- code/game/g_syscalls.asm | 2 +- code/game/g_syscalls.c | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/code/game/g_bot.c b/code/game/g_bot.c index db495d10..0cbfb492 100644 --- a/code/game/g_bot.c +++ b/code/game/g_bot.c @@ -128,12 +128,12 @@ static void G_LoadArenasFromFile( char *filename ) { len = trap_FS_FOpenFile( filename, &f, FS_READ ); if ( !f ) { - trap_Printf( va( S_COLOR_RED "file not found: %s\n", filename ) ); + trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) ); return; } if ( len >= MAX_ARENAS_TEXT ) { - trap_Printf( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_ARENAS_TEXT ) ); trap_FS_FCloseFile( f ); + trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_ARENAS_TEXT ) ); return; } @@ -177,7 +177,7 @@ static void G_LoadArenas( void ) { strcat(filename, dirptr); G_LoadArenasFromFile(filename); } - trap_Printf( va( "%i arenas parsed\n", g_numArenas ) ); + trap_Print( va( "%i arenas parsed\n", g_numArenas ) ); for( n = 0; n < g_numArenas; n++ ) { Info_SetValueForKey( g_arenaInfos[n], "num", va( "%i", n ) ); @@ -644,7 +644,7 @@ static void G_AddBot( const char *name, float skill, const char *team, int delay s = Info_ValueForKey(botinfo, "aifile"); if (!*s ) { - trap_Printf( S_COLOR_RED "Error: bot has no aifile specified\n" ); + trap_Print( S_COLOR_RED "Error: bot has no aifile specified\n" ); return; } @@ -716,7 +716,7 @@ void Svcmd_AddBot_f( void ) { // name trap_Argv( 1, name, sizeof( name ) ); if ( !name[0] ) { - trap_Printf( "Usage: Addbot [skill 1-5] [team] [msec delay] [altname]\n" ); + trap_Print( "Usage: Addbot [skill 1-5] [team] [msec delay] [altname]\n" ); return; } @@ -766,7 +766,7 @@ void Svcmd_BotList_f( void ) { char model[MAX_TOKEN_CHARS]; char aifile[MAX_TOKEN_CHARS]; - trap_Printf("^1name model aifile funname\n"); + trap_Print("^1name model aifile funname\n"); for (i = 0; i < g_numBots; i++) { strcpy(name, Info_ValueForKey( g_botInfos[i], "name" )); if ( !*name ) { @@ -784,7 +784,7 @@ void Svcmd_BotList_f( void ) { if (!*aifile ) { strcpy(aifile, "bots/default_c.c"); } - trap_Printf(va("%-16s %-16s %-20s %-20s\n", name, model, aifile, funname)); + trap_Print(va("%-16s %-16s %-20s %-20s\n", name, model, aifile, funname)); } } @@ -859,11 +859,11 @@ static void G_LoadBotsFromFile( char *filename ) { len = trap_FS_FOpenFile( filename, &f, FS_READ ); if ( !f ) { - trap_Printf( va( S_COLOR_RED "file not found: %s\n", filename ) ); + trap_Print( va( S_COLOR_RED "file not found: %s\n", filename ) ); return; } if ( len >= MAX_BOTS_TEXT ) { - trap_Printf( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_BOTS_TEXT ) ); + trap_Print( va( S_COLOR_RED "file too large: %s is %i, max allowed is %i\n", filename, len, MAX_BOTS_TEXT ) ); trap_FS_FCloseFile( f ); return; } @@ -912,7 +912,7 @@ static void G_LoadBots( void ) { strcat(filename, dirptr); G_LoadBotsFromFile(filename); } - trap_Printf( va( "%i bots parsed\n", g_numBots ) ); + trap_Print( va( "%i bots parsed\n", g_numBots ) ); } @@ -924,7 +924,7 @@ G_GetBotInfoByNumber */ char *G_GetBotInfoByNumber( int num ) { if( num < 0 || num >= g_numBots ) { - trap_Printf( va( S_COLOR_RED "Invalid bot number: %i\n", num ) ); + trap_Print( va( S_COLOR_RED "Invalid bot number: %i\n", num ) ); return NULL; } return g_botInfos[num]; diff --git a/code/game/g_local.h b/code/game/g_local.h index 58a9ff1c..5871c513 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -746,8 +746,8 @@ extern vmCvar_t g_enableBreath; extern vmCvar_t g_singlePlayer; extern vmCvar_t g_proxMineTimeout; -void trap_Printf( const char *fmt ); -void trap_Error(const char *fmt) __attribute__((noreturn)); +void trap_Print( const char *text ); +void trap_Error( const char *text ) __attribute__((noreturn)); int trap_Milliseconds( void ); int trap_RealTime( qtime_t *qtime ); int trap_Argc( void ); diff --git a/code/game/g_main.c b/code/game/g_main.c index a6b2ee5b..4d3cf28a 100644 --- a/code/game/g_main.c +++ b/code/game/g_main.c @@ -244,7 +244,7 @@ void QDECL G_Printf( const char *fmt, ... ) { Q_vsnprintf (text, sizeof(text), fmt, argptr); va_end (argptr); - trap_Printf( text ); + trap_Print( text ); } void QDECL G_Error( const char *fmt, ... ) { diff --git a/code/game/g_syscalls.asm b/code/game/g_syscalls.asm index 19de97d2..6fdb8690 100644 --- a/code/game/g_syscalls.asm +++ b/code/game/g_syscalls.asm @@ -1,6 +1,6 @@ code -equ trap_Printf -1 +equ trap_Print -1 equ trap_Error -2 equ trap_Milliseconds -3 equ trap_Cvar_Register -4 diff --git a/code/game/g_syscalls.c b/code/game/g_syscalls.c index b615301e..21208f3b 100644 --- a/code/game/g_syscalls.c +++ b/code/game/g_syscalls.c @@ -41,13 +41,13 @@ int PASSFLOAT( float x ) { return fi.i; } -void trap_Printf( const char *fmt ) { - syscall( G_PRINT, fmt ); +void trap_Print( const char *text ) { + syscall( G_PRINT, text ); } -void trap_Error(const char *fmt) +void trap_Error( const char *text ) { - syscall(G_ERROR, fmt); + syscall( G_ERROR, text ); // shut up GCC warning about returning functions, because we know better exit(1); }