diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_atoms.c | 2 | ||||
-rw-r--r-- | src/ui/ui_main.c | 8 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c index af3a3ef8..fd52fdaa 100644 --- a/src/ui/ui_atoms.c +++ b/src/ui/ui_atoms.c @@ -213,7 +213,7 @@ UI_ConsoleCommand qboolean UI_ConsoleCommand( int realTime ) { struct uicmd *cmd = bsearch( UI_Argv( 0 ), commands, - sizeof( commands ) / sizeof( commands[ 0 ] ), sizeof( commands[ 0 ] ), + ARRAY_LEN( commands ), sizeof( commands[ 0 ] ), cmdcmp ); uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 8edcccae..eb96c4c5 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -49,7 +49,7 @@ static const char *netSources[ ] = "Favorites" }; -static const int numNetSources = sizeof( netSources ) / sizeof( const char* ); +static const size_t numNetSources = ARRAY_LEN( netSources ); static const char *netnames[ ] = { @@ -127,7 +127,7 @@ static cvarTable_t cvarTable[ ] = { &ui_chatCommands, "ui_chatCommands", "1", CVAR_ARCHIVE } }; -static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] ); +static size_t cvarTableSize = ARRAY_LEN( cvarTable ); /* ================ @@ -2689,11 +2689,11 @@ static void UI_LoadDemos( void ) char *demoname; int i, len; - Com_sprintf( demoExt, sizeof( demoExt ), "dm_%d", ( int )trap_Cvar_VariableValue( "protocol" ) ); + Com_sprintf( demoExt, sizeof( demoExt ), "%s%d", DEMOEXT, (int)trap_Cvar_VariableValue( "protocol" ) ); uiInfo.demoCount = trap_FS_GetFileList( "demos", demoExt, demolist, 4096 ); - Com_sprintf( demoExt, sizeof( demoExt ), ".dm_%d", ( int )trap_Cvar_VariableValue( "protocol" ) ); + Com_sprintf( demoExt, sizeof( demoExt ), ".%s%d", DEMOEXT, (int)trap_Cvar_VariableValue( "protocol" ) ); if( uiInfo.demoCount ) { diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 24dc201e..1cd922ad 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -2364,7 +2364,7 @@ commandDef_t commandList[] = {"transition", &Script_Transition}, // group/name }; -static size_t scriptCommandCount = sizeof( commandList ) / sizeof( commandDef_t ); +static size_t scriptCommandCount = ARRAY_LEN( commandList ); // despite what lcc thinks, we do not get cmdcmp here static int commandComp( const void *a, const void *b ) @@ -4977,7 +4977,7 @@ static bind_t g_bindings[] = }; -static const int g_bindCount = sizeof( g_bindings ) / sizeof( bind_t ); +static const size_t g_bindCount = ARRAY_LEN( g_bindings ); /* ================= |