summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_alloc.c2
-rw-r--r--src/game/g_admin.c2
-rw-r--r--src/game/g_buildable.c10
-rw-r--r--src/game/g_cmds.c16
-rw-r--r--src/game/g_combat.c6
-rw-r--r--src/game/g_local.h6
-rw-r--r--src/game/g_main.c4
-rw-r--r--src/game/g_session.c4
-rw-r--r--src/game/g_team.c23
9 files changed, 26 insertions, 47 deletions
diff --git a/src/game/bg_alloc.c b/src/game/bg_alloc.c
index b145c62e..6bf4eb63 100644
--- a/src/game/bg_alloc.c
+++ b/src/game/bg_alloc.c
@@ -54,7 +54,7 @@ void *BG_Alloc( int size )
char *endptr;
int *ptr;
- allocsize = ( size + sizeof(int) + ROUNDBITS ) & ~ROUNDBITS; // Round to 32-byte boundary
+ allocsize = ( size + (int)sizeof(int) + ROUNDBITS ) & ~ROUNDBITS; // Round to 32-byte boundary
ptr = NULL;
smallest = NULL;
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index c3431a89..bbc77645 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -682,7 +682,7 @@ void G_admin_authlog( gentity_t *ent )
G_LogPrintf( "AdminAuth: %i \"%s" S_COLOR_WHITE "\" \"%s" S_COLOR_WHITE
"\" [%d] (%s): %s\n",
- ent - g_entities, ent->client->pers.netname,
+ (int)( ent - g_entities ), ent->client->pers.netname,
ent->client->pers.admin->name, ent->client->pers.admin->level,
ent->client->pers.guid, aflags );
}
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index f1bb1c12..2fbd92e1 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -3020,7 +3020,7 @@ void G_FreeMarkedBuildables( gentity_t *deconner, char *readable, int rsize,
removalCounts[ bNum ]++;
if( nums )
- Q_strcat( nums, nsize, va( " %d", ent - g_entities ) );
+ Q_strcat( nums, nsize, va( " %d", (int)( ent - g_entities ) ) );
G_FreeEntity( ent );
}
@@ -3713,8 +3713,8 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable,
readable ) );
G_LogPrintf( "Construct: %d %d %s%s: %s" S_COLOR_WHITE " is building "
"%s%s%s\n",
- builder - g_entities,
- built - g_entities,
+ (int)( builder - g_entities ),
+ (int)( built - g_entities ),
BG_Buildable( built->s.modelindex )->name,
buildnums,
builder->client->pers.netname,
@@ -4279,7 +4279,7 @@ void G_BuildLogRevertThink( gentity_t *ent )
G_KillBox( built );
G_LogPrintf( "revert: restore %d %s\n",
- built - g_entities, BG_Buildable( built->s.modelindex )->name );
+ (int)( built - g_entities ), BG_Buildable( built->s.modelindex )->name );
G_FreeEntity( ent );
}
@@ -4313,7 +4313,7 @@ void G_BuildLogRevert( int id )
{
if( ent->s.eType == ET_BUILDABLE )
G_LogPrintf( "revert: remove %d %s\n",
- ent - g_entities, BG_Buildable( ent->s.modelindex )->name );
+ (int)( ent - g_entities ), BG_Buildable( ent->s.modelindex )->name );
G_FreeEntity( ent );
break;
}
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 171df605..5398afd3 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -887,7 +887,7 @@ static qboolean G_SayTo( gentity_t *ent, gentity_t *other, saymode_t mode, const
}
trap_SendServerCommand( other-g_entities, va( "chat %d %d \"%s\"",
- ent ? ent-g_entities : -1,
+ (int)( ent ? ent-g_entities : -1 ),
mode,
message ) );
@@ -915,7 +915,7 @@ void G_Say( gentity_t *ent, saymode_t mode, const char *chatText )
{
case SAY_ALL:
G_LogPrintf( "Say: %d \"%s" S_COLOR_WHITE "\": " S_COLOR_GREEN "%s\n",
- ( ent ) ? ent - g_entities : -1,
+ (int)( ( ent ) ? ent - g_entities : -1 ),
( ent ) ? ent->client->pers.netname : "console", chatText );
break;
case SAY_TEAM:
@@ -923,7 +923,7 @@ void G_Say( gentity_t *ent, saymode_t mode, const char *chatText )
if( !ent || !ent->client )
Com_Error( ERR_FATAL, "SAY_TEAM by non-client entity\n" );
G_LogPrintf( "SayTeam: %d \"%s" S_COLOR_WHITE "\": " S_COLOR_CYAN "%s\n",
- ent - g_entities, ent->client->pers.netname, chatText );
+ (int)( ent - g_entities ), ent->client->pers.netname, chatText );
break;
case SAY_RAW:
if( ent )
@@ -968,7 +968,7 @@ static void Cmd_SayArea_f( gentity_t *ent )
range[ i ] = g_sayAreaRange.value;
G_LogPrintf( "SayArea: %d \"%s" S_COLOR_WHITE "\": " S_COLOR_BLUE "%s\n",
- ent - g_entities, ent->client->pers.netname, msg );
+ (int)( ent - g_entities ), ent->client->pers.netname, msg );
VectorAdd( ent->s.origin, range, maxs );
VectorSubtract( ent->s.origin, range, mins );
@@ -1122,12 +1122,12 @@ void Cmd_VSay_f( gentity_t *ent )
case VOICE_CHAN_LOCAL:
trap_SendServerCommand( -1, va(
"voice %d %d %d %d \"%s\"\n",
- ent-g_entities, vchan, cmdNum, trackNum, text ) );
+ (int)( ent-g_entities ), vchan, cmdNum, trackNum, text ) );
break;
case VOICE_CHAN_TEAM:
G_TeamCommand( ent->client->pers.teamSelection, va(
"voice %d %d %d %d \"%s\"\n",
- ent-g_entities, vchan, cmdNum, trackNum, text ) );
+ (int)( ent-g_entities ), vchan, cmdNum, trackNum, text ) );
break;
default:
break;
@@ -1469,7 +1469,7 @@ void Cmd_CallVote_f( gentity_t *ent )
G_LogPrintf( "%s: %d \"%s" S_COLOR_WHITE "\": %s\n",
team == TEAM_NONE ? "CallVote" : "CallTeamVote",
- ent - g_entities, ent->client->pers.netname, level.voteString[ team ] );
+ (int)( ent - g_entities ), ent->client->pers.netname, level.voteString[ team ] );
if( team == TEAM_NONE )
{
@@ -3338,7 +3338,7 @@ void Cmd_PrivateMessage_f( gentity_t *ent )
G_LogPrintf( "%s: %d \"%s" S_COLOR_WHITE "\" \"%s\": ^%c%s\n",
( teamonly ) ? "TPrivMsg" : "PrivMsg",
- ( ent ) ? ent - g_entities : -1,
+ (int)( ( ent ) ? ent - g_entities : -1 ),
( ent ) ? ent->client->pers.netname : "console",
name, color, msg );
}
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 6cb06309..7fcd2310 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -271,7 +271,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
G_LogPrintf( "Die: %d %d %s: %s" S_COLOR_WHITE " killed %s\n",
killer,
- self - g_entities,
+ (int)( self - g_entities ),
obit,
killerName,
self->client->pers.netname );
@@ -1419,8 +1419,8 @@ void G_LogDestruction( gentity_t *self, gentity_t *actor, int mod )
return;
G_LogPrintf( S_COLOR_YELLOW "Deconstruct: %d %d %s %s: %s %s by %s\n",
- actor - g_entities,
- self - g_entities,
+ (int)( actor - g_entities ),
+ (int)( self - g_entities ),
BG_Buildable( self->s.modelindex )->name,
modNames[ mod ],
BG_Buildable( self->s.modelindex )->humanName,
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 05fea6df..2ba8b563 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -998,10 +998,10 @@ void CalculateRanks( void );
void FindIntermissionPoint( void );
void G_RunThink( gentity_t *ent );
void G_AdminMessage( gentity_t *ent, const char *string );
-void QDECL G_LogPrintf( const char *fmt, ... );
+void QDECL G_LogPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
void SendScoreboardMessageToAllClients( void );
-void QDECL G_Printf( const char *fmt, ... );
-void QDECL G_Error( const char *fmt, ... );
+void QDECL G_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
+void QDECL G_Error( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
void G_Vote( gentity_t *ent, team_t team, qboolean voting );
void G_ExecuteVote( team_t team );
void G_CheckVote( team_t team );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 5d5fbed6..c228a5f7 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1682,7 +1682,7 @@ void G_AdminMessage( gentity_t *ent, const char *msg )
int i;
Com_sprintf( string, sizeof( string ), "chat %d %d \"%s\"",
- ent ? ent - g_entities : -1,
+ (int)( ent ? ent - g_entities : -1 ),
G_admin_permission( ent, ADMF_ADMINCHAT ) ? SAY_ADMINS : SAY_ADMINS_PUBLIC,
msg );
@@ -1694,7 +1694,7 @@ void G_AdminMessage( gentity_t *ent, const char *msg )
// Send to the logfile and server console
G_LogPrintf( "%s: %d \"%s" S_COLOR_WHITE "\": " S_COLOR_MAGENTA "%s\n",
G_admin_permission( ent, ADMF_ADMINCHAT ) ? "AdminMsg" : "AdminMsgPublic",
- ent ? ent - g_entities : -1, ent ? ent->client->pers.netname : "console",
+ (int)( ent ? ent - g_entities : -1 ), ent ? ent->client->pers.netname : "console",
msg );
}
diff --git a/src/game/g_session.c b/src/game/g_session.c
index 181c7390..473cbc45 100644
--- a/src/game/g_session.c
+++ b/src/game/g_session.c
@@ -54,7 +54,7 @@ void G_WriteClientSessionData( gclient_t *client )
Com_ClientListString( &client->sess.ignoreList )
);
- var = va( "session%i", client - level.clients );
+ var = va( "session%i", (int)( client - level.clients ) );
trap_Cvar_Set( var, s );
}
@@ -74,7 +74,7 @@ void G_ReadSessionData( gclient_t *client )
int restartTeam;
char ignorelist[ 17 ];
- var = va( "session%i", client - level.clients );
+ var = va( "session%i", (int)( client - level.clients ) );
trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );
sscanf( s, "%i %i %i %i %16s",
diff --git a/src/game/g_team.c b/src/game/g_team.c
index ec387acd..531e3d2e 100644
--- a/src/game/g_team.c
+++ b/src/game/g_team.c
@@ -23,27 +23,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "g_local.h"
-// NULL for everyone
-void QDECL PrintMsg( gentity_t *ent, const char *fmt, ... )
-{
- char msg[ 1024 ];
- va_list argptr;
- char *p;
-
- va_start( argptr,fmt );
-
- if( Q_vsnprintf( msg, sizeof( msg ), fmt, argptr ) > sizeof( msg ) )
- G_Error ( "PrintMsg overrun" );
-
- va_end( argptr );
-
- // double quotes are bad
- while( ( p = strchr( msg, '"' ) ) != NULL )
- *p = '\'';
-
- trap_SendServerCommand( ( ( ent == NULL ) ? -1 : ent-g_entities ), va( "print \"%s\"", msg ) );
-}
-
/*
================
G_TeamFromString
@@ -249,7 +228,7 @@ void G_ChangeTeam( gentity_t *ent, team_t newTeam )
G_UpdateTeamConfigStrings( );
G_LogPrintf( "ChangeTeam: %d %s: %s" S_COLOR_WHITE " switched teams\n",
- ent - g_entities, BG_TeamName( newTeam ), ent->client->pers.netname );
+ (int)( ent - g_entities ), BG_TeamName( newTeam ), ent->client->pers.netname );
G_namelog_update_score( ent->client );
TeamplayInfoMessage( ent );