winetest: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-07-24 22:13:46 +02:00 committed by Alexandre Julliard
parent e4f68323fc
commit 0b788e9a72
2 changed files with 3 additions and 3 deletions

View file

@ -547,7 +547,7 @@ report (enum report_type t, ...)
} }
va_start (ap, t); va_start (ap, t);
if (t < sizeof text_funcs / sizeof text_funcs[0]) ret = funcs[t](ap); if (t < ARRAY_SIZE(text_funcs)) ret = funcs[t](ap);
else report (R_WARNING, "unimplemented report type: %d", t); else report (R_WARNING, "unimplemented report type: %d", t);
va_end (ap); va_end (ap);
return ret; return ret;

View file

@ -461,7 +461,7 @@ static void print_language(void)
if (pGetSystemPreferredUILanguages && !running_under_wine()) if (pGetSystemPreferredUILanguages && !running_under_wine())
{ {
WCHAR langW[32]; WCHAR langW[32];
ULONG num, size = sizeof(langW)/sizeof(langW[0]); ULONG num, size = ARRAY_SIZE(langW);
if (pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &num, langW, &size)) if (pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &num, langW, &size))
{ {
char lang[32], *p = lang; char lang[32], *p = lang;
@ -1263,7 +1263,7 @@ int main( int argc, char *argv[] )
exit (0); exit (0);
} }
else if ((argv[i][0] != '-' && argv[i][0] != '/') || argv[i][2]) { else if ((argv[i][0] != '-' && argv[i][0] != '/') || argv[i][2]) {
if (nb_filters == sizeof(filters)/sizeof(filters[0])) if (nb_filters == ARRAY_SIZE(filters))
{ {
report (R_ERROR, "Too many test filters specified"); report (R_ERROR, "Too many test filters specified");
exit (2); exit (2);