Commit 79a6dd21 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wrc: Use the ARRAY_SIZE() macro.

parent 86ebd6dc
...@@ -602,7 +602,7 @@ static const char *get_language_name( const language_t *lang ) ...@@ -602,7 +602,7 @@ static const char *get_language_name( const language_t *lang )
static char name[20]; static char name[20];
unsigned int i; unsigned int i;
for (i = 0; i < sizeof(languages)/sizeof(languages[0]); i++) for (i = 0; i < ARRAY_SIZE(languages); i++)
if (languages[i].id == lang->id && languages[i].sub == lang->sub) if (languages[i].id == lang->id && languages[i].sub == lang->sub)
return languages[i].name; return languages[i].name;
...@@ -1314,7 +1314,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang ...@@ -1314,7 +1314,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang
new_blk = new_ver_block(); new_blk = new_ver_block();
*new_blk = *blk; *new_blk = *blk;
name = convert_msgid_ascii( blk->name, 0 ); name = convert_msgid_ascii( blk->name, 0 );
for (i = 0; i < sizeof(block_name)/sizeof(block_name[0]); i++) for (i = 0; i < ARRAY_SIZE(block_name); i++)
{ {
if (!strcasecmp( name, english_block_name[i] )) if (!strcasecmp( name, english_block_name[i] ))
{ {
...@@ -1344,7 +1344,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang ...@@ -1344,7 +1344,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang
val = val->next; val = val->next;
} }
for (i = 0; i < sizeof(block_name)/sizeof(block_name[0]); i++) for (i = 0; i < ARRAY_SIZE(block_name); i++)
free( block_name[i] ); free( block_name[i] );
return head; return head;
} }
...@@ -1494,10 +1494,10 @@ void add_translations( const char *po_dir ) ...@@ -1494,10 +1494,10 @@ void add_translations( const char *po_dir )
if ((p = strchr( buffer, '#' ))) *p = 0; if ((p = strchr( buffer, '#' ))) *p = 0;
for (tok = strtok( buffer, " \t\r\n" ); tok; tok = strtok( NULL, " \t\r\n" )) for (tok = strtok( buffer, " \t\r\n" ); tok; tok = strtok( NULL, " \t\r\n" ))
{ {
for (i = 0; i < sizeof(languages)/sizeof(languages[0]); i++) for (i = 0; i < ARRAY_SIZE(languages); i++)
if (!strcmp( tok, languages[i].name )) break; if (!strcmp( tok, languages[i].name )) break;
if (i == sizeof(languages)/sizeof(languages[0])) if (i == ARRAY_SIZE(languages))
error( "unknown language '%s'\n", tok ); error( "unknown language '%s'\n", tok );
name = strmake( "%s/%s.mo", po_dir, tok ); name = strmake( "%s/%s.mo", po_dir, tok );
......
...@@ -565,7 +565,7 @@ int get_language_codepage( unsigned short lang, unsigned short sublang ) ...@@ -565,7 +565,7 @@ int get_language_codepage( unsigned short lang, unsigned short sublang )
unsigned int i; unsigned int i;
int cp = -1, defcp = -1; int cp = -1, defcp = -1;
for (i = 0; i < sizeof(lang2cps)/sizeof(lang2cps[0]); i++) for (i = 0; i < ARRAY_SIZE(lang2cps); i++)
{ {
if (lang2cps[i].lang != lang) continue; if (lang2cps[i].lang != lang) continue;
if (lang2cps[i].sublang == sublang) if (lang2cps[i].sublang == sublang)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment