Michael Stefaniuc : ntprint/tests: Use the available ARRAY_SIZE() macro.
Alexandre Julliard
julliard at winehq.org
Mon Jun 11 13:10:50 CDT 2018
Module: wine
Branch: master
Commit: 455ccf4baa4756896a6acf12960d9ab71d186cd8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=455ccf4baa4756896a6acf12960d9ab71d186cd8
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Fri Jun 8 22:19:07 2018 +0200
ntprint/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/ntprint/tests/ntprint.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/ntprint/tests/ntprint.c b/dlls/ntprint/tests/ntprint.c
index 1710220..57caa49 100644
--- a/dlls/ntprint/tests/ntprint.c
+++ b/dlls/ntprint/tests/ntprint.c
@@ -67,7 +67,7 @@ static void test_PSetupCreateMonitorInfo(VOID)
{
HANDLE mi;
WCHAR buffer[1024] = {'\\','\\'};
- UINT len = sizeof(buffer) / sizeof(buffer[0]) - 2;
+ UINT len = ARRAY_SIZE(buffer) - 2;
GetComputerNameW(buffer + 2, &len);
SetLastError(0xdeadbeef);
@@ -155,7 +155,7 @@ static void test_PSetupEnumMonitor(VOID)
"and '> 0')\n", res, GetLastError(), minsize);
- size = sizeof(buffer) / sizeof(buffer[0]);
+ size = ARRAY_SIZE(buffer);
if ((minsize + 1) > size) {
skip("overflow: %u\n", minsize);
pPSetupDestroyMonitorInfo(mi);
@@ -165,7 +165,7 @@ static void test_PSetupEnumMonitor(VOID)
if (0) {
/* XP: ERROR_INVALID_PARAMETER, w2k: Crash */
SetLastError(0xdeadbeef);
- size = sizeof(buffer) / sizeof(buffer[0]);
+ size = ARRAY_SIZE(buffer);
res = pPSetupEnumMonitor(NULL, 0, buffer, &size);
ok( !res && (GetLastError() == ERROR_INVALID_PARAMETER),
"got %u with %u (expected '0' with ERROR_INVALID_PARAMETER)\n",
@@ -175,7 +175,7 @@ static void test_PSetupEnumMonitor(VOID)
if (0) {
/* XP: Crash, w2k: Success (how can that work?) */
SetLastError(0xdeadbeef);
- size = sizeof(buffer) / sizeof(buffer[0]);
+ size = ARRAY_SIZE(buffer);
res = pPSetupEnumMonitor(mi, 0, NULL, &size);
trace("got %u with %u and %u\n", res, GetLastError(), size);
}
@@ -213,7 +213,7 @@ static void test_PSetupEnumMonitor(VOID)
while (res && (index < 20)) {
SetLastError(0xdeadbeef);
buffer[0] = '\0';
- size = sizeof(buffer) / sizeof(buffer[0]);
+ size = ARRAY_SIZE(buffer);
res = pPSetupEnumMonitor(mi, index, buffer, &size);
ok( res || (GetLastError() == ERROR_NO_MORE_ITEMS),
"(%u) got %u with %u and %u (expected '!=0' or: '0' with "
More information about the wine-cvs
mailing list