Refactoring patch by DevHC
This commit is contained in:
parent
21668c0616
commit
fef4d12d68
31 changed files with 60 additions and 98 deletions
|
@ -217,7 +217,7 @@ static cvarTable_t cvarTable[] = {
|
|||
{ &ui_ioq3, "ui_ioq3", "1", CVAR_ROM }
|
||||
};
|
||||
|
||||
static int cvarTableSize = sizeof(cvarTable) / sizeof(cvarTable[0]);
|
||||
static int cvarTableSize = ARRAY_LEN( cvarTable );
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -318,7 +318,7 @@ static InitialVideoOptions_s s_ivo_templates[] =
|
|||
}
|
||||
};
|
||||
|
||||
#define NUM_IVO_TEMPLATES ( sizeof( s_ivo_templates ) / sizeof( s_ivo_templates[0] ) )
|
||||
#define NUM_IVO_TEMPLATES ( ARRAY_LEN( s_ivo_templates ) )
|
||||
|
||||
static const char *builtinResolutions[ ] =
|
||||
{
|
||||
|
@ -496,7 +496,7 @@ static void GraphicsOptions_GetResolutions( void )
|
|||
{
|
||||
char* s = resbuf;
|
||||
unsigned int i = 0;
|
||||
while( s && i < sizeof(detectedResolutions)/sizeof(detectedResolutions[0])-1)
|
||||
while( s && i < ARRAY_LEN(detectedResolutions)-1 )
|
||||
{
|
||||
detectedResolutions[i++] = s;
|
||||
s = strchr(s, ' ');
|
||||
|
@ -662,7 +662,7 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification )
|
|||
// search for builtin mode that matches the detected mode
|
||||
int mode;
|
||||
if ( s_graphicsoptions.mode.curvalue == -1
|
||||
|| s_graphicsoptions.mode.curvalue >= sizeof(detectedResolutions)/sizeof(detectedResolutions[0]) )
|
||||
|| s_graphicsoptions.mode.curvalue >= ARRAY_LEN( detectedResolutions ) )
|
||||
s_graphicsoptions.mode.curvalue = 0;
|
||||
|
||||
mode = GraphicsOptions_FindBuiltinResolution( s_graphicsoptions.mode.curvalue );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue