summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-04-14 19:08:11 +0200
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:24:15 +0200
commit5e472f35354986a26ec9460fff2fc8b14dadf773 (patch)
tree627eb35c40a19ce67149a550890a055568e3c805 /src/game
parent91496cdb54e11d8ac746bb6982b0ade24c035503 (diff)
fix a bunch of %i format flags / arguments
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_admin.c24
-rw-r--r--src/game/g_cmds.c2
-rw-r--r--src/game/g_combat.c4
-rw-r--r--src/game/g_session.c4
4 files changed, 17 insertions, 17 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 5761586..1becfa8 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -1363,8 +1363,8 @@ static int admin_listadmins( gentity_t *ent, int start, char *search, int minlev
{
G_DecolorString( g_admin_levels[ j ]->name, lname );
Com_sprintf( lname_fmt, sizeof( lname_fmt ), "%%%is",
- ( admin_level_maxname + strlen( g_admin_levels[ j ]->name )
- - strlen( lname ) ) );
+ ( admin_level_maxname + (int)( strlen( g_admin_levels[ j ]->name )
+ - strlen( lname ) ) ) );
Com_sprintf( lname, sizeof( lname ), lname_fmt,
g_admin_levels[ j ]->name );
break;
@@ -1428,8 +1428,8 @@ static int admin_listadmins( gentity_t *ent, int start, char *search, int minlev
{
G_DecolorString( g_admin_levels[ j ]->name, lname );
Com_sprintf( lname_fmt, sizeof( lname_fmt ), "%%%is",
- ( admin_level_maxname + strlen( g_admin_levels[ j ]->name )
- - strlen( lname ) ) );
+ ( admin_level_maxname + (int)( strlen( g_admin_levels[ j ]->name )
+ - strlen( lname ) ) ) );
Com_sprintf( lname, sizeof( lname ), lname_fmt,
g_admin_levels[ j ]->name );
break;
@@ -3810,7 +3810,7 @@ qboolean G_admin_adminlog( gentity_t *ent, int skiparg )
t = results[ i ]->time / 1000;
G_DecolorString( results[ i ]->name, n1 );
Com_sprintf( fmt_name, sizeof( fmt_name ), "%%%ds",
- ( name_length + strlen( results[ i ]->name ) - strlen( n1 ) ) );
+ ( name_length + (int)( strlen( results[ i ]->name ) - strlen( n1 ) ) ) );
Com_sprintf( n1, sizeof( n1 ), fmt_name, results[ i ]->name );
Com_sprintf( levelbuf, sizeof( levelbuf ), "%2d", results[ i ]->level );
ADMBP( va( "%s%3d %3d:%02d %2s ^7%s^7 %s!%s ^7%s^7\n",
@@ -4061,7 +4061,7 @@ qboolean G_admin_tklog( gentity_t *ent, int skiparg )
G_DecolorString( results[ i ]->name, n1 );
Com_sprintf( fmt_name, sizeof( fmt_name ), "%%%ds",
- ( name_length + strlen( results[ i ]->name ) - strlen( n1 ) ) );
+ ( name_length + (int)( strlen( results[ i ]->name ) - strlen( n1 ) ) ) );
Com_sprintf( n1, sizeof( n1 ), fmt_name, results[ i ]->name );
if( results[ i ]->team == PTE_HUMANS )
@@ -5088,7 +5088,7 @@ qboolean G_admin_listplayers( gentity_t *ent, int skiparg )
{
G_DecolorString( lname, lname2 );
Com_sprintf( lname_fmt, sizeof( lname_fmt ), "%%%is",
- ( admin_level_maxname + strlen( lname ) - strlen( lname2 ) ) );
+ ( admin_level_maxname + (int)( strlen( lname ) - strlen( lname2 ) ) ) );
Com_sprintf( lname2, sizeof( lname2 ), lname_fmt, lname );
}
break;
@@ -5528,12 +5528,12 @@ qboolean G_admin_showbans( gentity_t *ent, int skiparg )
G_DecolorString( g_admin_bans[ i ]->name, n1 );
Com_sprintf( name_fmt, sizeof( name_fmt ), "%%-%is",
- ( max_name + strlen( g_admin_bans[ i ]->name ) - strlen( n1 ) ) );
+ ( max_name + (int)( strlen( g_admin_bans[ i ]->name ) - strlen( n1 ) ) ) );
Com_sprintf( n1, sizeof( n1 ), name_fmt, g_admin_bans[ i ]->name );
G_DecolorString( g_admin_bans[ i ]->banner, n2 );
Com_sprintf( banner_fmt, sizeof( banner_fmt ), "%%-%is",
- ( max_banner + strlen( g_admin_bans[ i ]->banner ) - strlen( n2 ) ) );
+ ( max_banner + (int)( strlen( g_admin_bans[ i ]->banner ) - strlen( n2 ) ) ) );
Com_sprintf( n2, sizeof( n2 ), banner_fmt, g_admin_bans[ i ]->banner );
bannerslevel = g_admin_bans[ i ]->bannerlevel;
@@ -6150,7 +6150,7 @@ qboolean G_admin_register(gentity_t *ent, int skiparg ){
return qfalse;
}
- trap_SendConsoleCommand( EXEC_APPEND,va( "!setlevel %d %d;",ent - g_entities, level) );
+ trap_SendConsoleCommand( EXEC_APPEND,va( "!setlevel %d %d;", (int)(ent - g_entities), level) );
AP( va( "print \"^3!register: ^7%s^7 is now a protected nickname.\n\"", ent->client->pers.netname) );
@@ -7738,7 +7738,7 @@ qboolean G_admin_revert( gentity_t *ent, int skiparg )
Com_sprintf( argbuf, sizeof argbuf, "%s%s%s%s%s%s%s!",
( repeat > 1 ) ? "x" : "", ( repeat > 1 ) ? va( "%d ", repeat ) : "",
( ID ) ? "#" : "", ( ID ) ? va( "%d ", ptr->ID ) : "",
- ( builder ) ? "-" : "", ( builder ) ? va( "%d ", builder - g_entities ) : "",
+ ( builder ) ? "-" : "", ( builder ) ? va( "%d ", (int)( builder - g_entities ) ) : "",
( team == PTE_ALIENS ) ? "a " : ( team == PTE_HUMANS ) ? "h " : "" );
ADMP( va( "^3!revert: ^7revert aborted: reverting this %s would conflict with "
"another buildable, use ^3!revert %s ^7to override\n", action, argbuf ) );
@@ -7766,7 +7766,7 @@ qboolean G_admin_revert( gentity_t *ent, int skiparg )
Com_sprintf( argbuf, sizeof argbuf, "%s%s%s%s%s%s%s!",
( repeat > 1 ) ? "x" : "", ( repeat > 1 ) ? va( "%d ", repeat ) : "",
( ID ) ? "#" : "", ( ID ) ? va( "%d ", ptr->ID ) : "",
- ( builder ) ? "-" : "", ( builder ) ? va( "%d ", builder - g_entities ) : "",
+ ( builder ) ? "-" : "", ( builder ) ? va( "%d ", (int)( builder - g_entities ) ) : "",
( team == PTE_ALIENS ) ? "a " : ( team == PTE_HUMANS ) ? "h " : "" );
ADMP( va( "^3!revert: ^7revert aborted: reverting this %s would "
"conflict with another buildable, use ^3!revert %s ^7to override\n",
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 1233e31..163636f 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -5791,7 +5791,7 @@ void G_PrivateMessage( gentity_t *ent )
matches,
color,
msg,
- ent ? ent-g_entities : -1 ) );
+ ent ? (int)( ent-g_entities ) : -1 ) );
trap_SendServerCommand( pids[ i ], va(
"cp \"^%cprivate message from ^7%s^7\"", color,
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 0658849..6fe40b7 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1554,7 +1554,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
G_admin_tklog_log( attacker, NULL, mod );
- trap_SendConsoleCommand( EXEC_APPEND, va( "!putteam %d s %s\n", attacker - g_entities, g_adminTempSpec.string ) );
+ trap_SendConsoleCommand( EXEC_APPEND, va( "!putteam %d s %s\n", (int)( attacker - g_entities ), g_adminTempSpec.string ) );
attacker->client->pers.statscounters.spreebleeds = 0;
}
else if( attacker->client->pers.statscounters.spreebleeds > g_bleedingSpree.integer * 66 &&
@@ -1571,7 +1571,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
attacker->client->pers.statscounters.spreebleeds > g_bleedingSpree.integer * 100 + g_bleedingSpree.integer * 20 )
{
trap_SendConsoleCommand( EXEC_APPEND,
- va("!kick %d auto-kick for team bleeding\n", ( attacker - g_entities )) );
+ va("!kick %d auto-kick for team bleeding\n", (int)( attacker - g_entities )) );
attacker->client->pers.statscounters.spreebleeds = -9000;
}
else if( attacker->client->pers.statscounters.spreebleeds > g_bleedingSpree.integer * 100 &&
diff --git a/src/game/g_session.c b/src/game/g_session.c
index e1705ea..c303134 100644
--- a/src/game/g_session.c
+++ b/src/game/g_session.c
@@ -59,7 +59,7 @@ void G_WriteClientSessionData( gclient_t *client )
BG_ClientListString( &client->sess.ignoreList )
);
- var = va( "session%i", client - level.clients );
+ var = va( "session%i", (int)( client - level.clients ) );
trap_Cvar_Set( var, s );
}
@@ -83,7 +83,7 @@ void G_ReadSessionData( gclient_t *client )
int sessionTeam;
int restartTeam;
- var = va( "session%i", client - level.clients );
+ var = va( "session%i", (int)( client - level.clients ) );
trap_Cvar_VariableStringBuffer( var, s, sizeof(s) );
// FIXME: should be using BG_ClientListParse() for ignoreList, but