[quake3-commits] r2279 - trunk/code/game
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Jun 19 10:51:02 EDT 2012
Author: ztm
Date: 2012-06-19 10:51:02 -0400 (Tue, 19 Jun 2012)
New Revision: 2279
Modified:
trunk/code/game/g_bot.c
trunk/code/game/g_local.h
trunk/code/game/g_main.c
trunk/code/game/g_syscalls.asm
trunk/code/game/g_syscalls.c
Log:
rename trap_Printf() to trap_Print() in the game module, as that function has nothing to do with printf()-like formatting
>From /dev/humancontroller.
Modified: trunk/code/game/g_bot.c
===================================================================
--- trunk/code/game/g_bot.c 2012-06-19 14:47:30 UTC (rev 2278)
+++ trunk/code/game/g_bot.c 2012-06-19 14:51:02 UTC (rev 2279)
@@ -128,12 +128,12 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
*/
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];
Modified: trunk/code/game/g_local.h
===================================================================
--- trunk/code/game/g_local.h 2012-06-19 14:47:30 UTC (rev 2278)
+++ trunk/code/game/g_local.h 2012-06-19 14:51:02 UTC (rev 2279)
@@ -746,8 +746,8 @@
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 );
Modified: trunk/code/game/g_main.c
===================================================================
--- trunk/code/game/g_main.c 2012-06-19 14:47:30 UTC (rev 2278)
+++ trunk/code/game/g_main.c 2012-06-19 14:51:02 UTC (rev 2279)
@@ -244,7 +244,7 @@
Q_vsnprintf (text, sizeof(text), fmt, argptr);
va_end (argptr);
- trap_Printf( text );
+ trap_Print( text );
}
void QDECL G_Error( const char *fmt, ... ) {
Modified: trunk/code/game/g_syscalls.asm
===================================================================
--- trunk/code/game/g_syscalls.asm 2012-06-19 14:47:30 UTC (rev 2278)
+++ trunk/code/game/g_syscalls.asm 2012-06-19 14:51:02 UTC (rev 2279)
@@ -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
Modified: trunk/code/game/g_syscalls.c
===================================================================
--- trunk/code/game/g_syscalls.c 2012-06-19 14:47:30 UTC (rev 2278)
+++ trunk/code/game/g_syscalls.c 2012-06-19 14:51:02 UTC (rev 2279)
@@ -41,13 +41,13 @@
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);
}
More information about the quake3-commits
mailing list