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

Alexandre Julliard julliard at winehq.org
Tue May 29 16:08:30 CDT 2018


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue May 29 01:05:21 2018 +0200

bcrypt/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/bcrypt/tests/bcrypt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 2a49971..6865e87 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -145,7 +145,7 @@ static void format_hash(const UCHAR *bytes, ULONG size, char *buf)
 static int strcmp_wa(const WCHAR *strw, const char *stra)
 {
     WCHAR buf[512];
-    MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(buf[0]));
+    MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
     return lstrcmpW(strw, buf);
 }
 
@@ -229,7 +229,7 @@ static void test_hash(const struct hash_test *test)
     NTSTATUS ret;
     ULONG len;
 
-    MultiByteToWideChar(CP_ACP, 0, test->alg, -1, alg_name, sizeof(alg_name)/sizeof(WCHAR));
+    MultiByteToWideChar(CP_ACP, 0, test->alg, -1, alg_name, ARRAY_SIZE(alg_name));
 
     alg = NULL;
     ret = pBCryptOpenAlgorithmProvider(&alg, alg_name, MS_PRIMITIVE_PROVIDER, 0);
@@ -349,7 +349,7 @@ static void test_hashes(void)
     };
     unsigned i;
 
-    for(i = 0; i < sizeof(tests)/sizeof(*tests); i++)
+    for(i = 0; i < ARRAY_SIZE(tests); i++)
         test_hash(tests+i);
 }
 




More information about the wine-cvs mailing list