summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2012-07-12 02:46:19 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:18:16 +0000
commit8d448680f5b3bcd2a67a3684308bb948e4d3ddad (patch)
tree8ec357b00c06d7b2e851680270690ad8e5ee3504 /src/cgame
parent156289dcdd27a31e77afb36147d456bac9be72a3 (diff)
* (bug 5000) refactor: use ARRAY_LEN; remove undefined functions; more size_t
(/dev/humancontroller)
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_consolecmds.c4
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/cgame/cg_main.c3
-rw-r--r--src/cgame/cg_servercmds.c5
-rw-r--r--src/cgame/cg_tutorial.c2
5 files changed, 7 insertions, 9 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c
index 19216eea..5dab9757 100644
--- a/src/cgame/cg_consolecmds.c
+++ b/src/cgame/cg_consolecmds.c
@@ -211,7 +211,7 @@ qboolean CG_ConsoleCommand( void )
consoleCommand_t *cmd;
cmd = bsearch( CG_Argv( 0 ), commands,
- sizeof( commands ) / sizeof( commands[ 0 ]), sizeof( commands[ 0 ] ),
+ ARRAY_LEN( commands ), sizeof( commands[ 0 ] ),
cmdcmp );
if( !cmd )
@@ -234,7 +234,7 @@ void CG_InitConsoleCommands( void )
{
int i;
- for( i = 0 ; i < sizeof( commands ) / sizeof( commands[ 0 ] ) ; i++ )
+ for( i = 0; i < ARRAY_LEN( commands ); i++ )
trap_AddCommand( commands[ i ].cmd );
//
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 36d7a870..797d0c2c 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -722,7 +722,7 @@ typedef struct
{
qboolean infoValid;
- char name[ MAX_QPATH ];
+ char name[ MAX_NAME_LENGTH ];
team_t team;
int score; // updated by score servercmds
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 3972097e..fd2d258f 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -357,7 +357,7 @@ static cvarTable_t cvarTable[ ] =
{ &cg_chatTeamPrefix, "cg_chatTeamPrefix", "1", CVAR_ARCHIVE}
};
-static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
+static size_t cvarTableSize = ARRAY_LEN( cvarTable );
/*
=================
@@ -1738,7 +1738,6 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum )
// clear everything
memset( &cgs, 0, sizeof( cgs ) );
memset( &cg, 0, sizeof( cg ) );
- memset( &cg.pmext, 0, sizeof( cg.pmext ) );
memset( cg_entities, 0, sizeof( cg_entities ) );
cg.clientNum = clientNum;
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index e1da8399..64ef7985 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -1292,9 +1292,8 @@ static void CG_ServerCommand( void )
consoleCommand_t *command;
cmd = CG_Argv( 0 );
- command = bsearch( cmd, svcommands, sizeof( svcommands ) /
- sizeof( svcommands[ 0 ]), sizeof( svcommands[ 0 ] ),
- cmdcmp );
+ command = bsearch( cmd, svcommands, ARRAY_LEN( svcommands ),
+ sizeof( svcommands[ 0 ] ), cmdcmp );
if( command )
{
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 6839c3a1..7820f4fa 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -50,7 +50,7 @@ static bind_t bindings[ ] =
{ "weapnext", "Next Upgrade", { -1, -1 } }
};
-static const int numBindings = sizeof( bindings ) / sizeof( bind_t );
+static const size_t numBindings = ARRAY_LEN( bindings );
/*
=================