rename trap_Printf() to trap_Print() in the game module, as that function has nothing to do with printf()-like formatting

From /dev/humancontroller.
This commit is contained in:
Zack Middleton 2012-06-19 14:51:02 +00:00
parent 6067cadc72
commit 20c6d1e33f
5 changed files with 19 additions and 19 deletions

View file

@ -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 <botname> [skill 1-5] [team] [msec delay] [altname]\n" );
trap_Print( "Usage: Addbot <botname> [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];

View file

@ -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 );

View file

@ -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, ... ) {

View file

@ -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

View file

@ -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);
}