Michael Stefaniuc : userenv/tests: Use the available ARRAY_SIZE() macro.

Alexandre Julliard julliard at winehq.org
Thu May 31 15:56:55 CDT 2018


Module: wine
Branch: master
Commit: 3f3083d7f3e0f695e86d9e89f430f292fe6ebfcd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3f3083d7f3e0f695e86d9e89f430f292fe6ebfcd

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed May 30 21:15:38 2018 +0200

userenv/tests: Use the available ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/userenv/tests/userenv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/userenv/tests/userenv.c b/dlls/userenv/tests/userenv.c
index 5647cf3..79b4d59 100644
--- a/dlls/userenv/tests/userenv.c
+++ b/dlls/userenv/tests/userenv.c
@@ -158,7 +158,7 @@ static void test_create_env(void)
     }
 
     /* Test for common environment variables (NT4 and higher) */
-    for (i = 0; i < sizeof(common_vars)/sizeof(common_vars[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(common_vars); i++)
     {
         for (j = 0; j < 4; j++)
         {
@@ -175,7 +175,7 @@ static void test_create_env(void)
     }
     else
     {
-        for (i = 0; i < sizeof(common_post_nt4_vars)/sizeof(common_post_nt4_vars[0]); i++)
+        for (i = 0; i < ARRAY_SIZE(common_post_nt4_vars); i++)
         {
             for (j = 0; j < 4; j++)
             {
@@ -190,7 +190,7 @@ static void test_create_env(void)
         pIsWow64Process(GetCurrentProcess(), &is_wow64);
     if (sizeof(void*)==8 || is_wow64)
     {
-        for (i = 0; i < sizeof(common_win64_vars)/sizeof(common_win64_vars[0]); i++)
+        for (i = 0; i < ARRAY_SIZE(common_win64_vars); i++)
         {
             for (j=0; j<4; j++)
             {
@@ -215,7 +215,7 @@ static void test_create_env(void)
     expect(TRUE, r);
     if (r) HeapFree(GetProcessHeap(), 0, st);
 
-    for (i = 0; i < sizeof(env) / sizeof(env[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(env); i++)
     {
         r = DestroyEnvironmentBlock(env[i]);
         expect(TRUE, r);




More information about the wine-cvs mailing list