Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- tools/wrc/po.c | 10 +++++----- tools/wrc/utils.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/wrc/po.c b/tools/wrc/po.c index c72a422f94..74bcf1e6ff 100644 --- a/tools/wrc/po.c +++ b/tools/wrc/po.c @@ -602,7 +602,7 @@ static const char *get_language_name( const language_t *lang ) static char name[20]; 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) return languages[i].name;
@@ -1314,7 +1314,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang new_blk = new_ver_block(); *new_blk = *blk; 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] )) { @@ -1344,7 +1344,7 @@ static ver_value_t *translate_stringfileinfo( ver_value_t *val, language_t *lang 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] ); return head; } @@ -1494,10 +1494,10 @@ void add_translations( const char *po_dir ) if ((p = strchr( buffer, '#' ))) *p = 0; 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 (i == sizeof(languages)/sizeof(languages[0])) + if (i == ARRAY_SIZE(languages)) error( "unknown language '%s'\n", tok );
name = strmake( "%s/%s.mo", po_dir, tok ); diff --git a/tools/wrc/utils.c b/tools/wrc/utils.c index 800692a37e..633ec57d86 100644 --- a/tools/wrc/utils.c +++ b/tools/wrc/utils.c @@ -565,7 +565,7 @@ int get_language_codepage( unsigned short lang, unsigned short sublang ) unsigned int i; 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].sublang == sublang)