Refactoring patch by DevHC

This commit is contained in:
Thilo Schulz 2011-03-05 19:20:37 +00:00
parent 21668c0616
commit fef4d12d68
31 changed files with 60 additions and 98 deletions

View file

@ -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 );