Michael Stefaniuc : wscript/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: d72112eda8067b1ce49419a8c7174510d63dafa8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d72112eda8067b1ce49419a8c7174510d63dafa8

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

wscript/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>

---

 programs/wscript/tests/run.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/wscript/tests/run.c b/programs/wscript/tests/run.c
index 770fd8f..16d14ff 100644
--- a/programs/wscript/tests/run.c
+++ b/programs/wscript/tests/run.c
@@ -77,7 +77,7 @@ static HANDLE wscript_process;
 static int strcmp_wa(LPCWSTR strw, const char *stra)
 {
     WCHAR buf[512];
-    MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(WCHAR));
+    MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
     return lstrcmpW(strw, buf);
 }
 
@@ -220,7 +220,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF
         ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
         ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
         V_VT(pVarResult) = VT_BSTR;
-        res = GetModuleFileNameExW(wscript_process, NULL, fullName, sizeof(fullName)/sizeof(WCHAR));
+        res = GetModuleFileNameExW(wscript_process, NULL, fullName, ARRAY_SIZE(fullName));
         if(res == 0)
             return E_FAIL;
         if(!(V_BSTR(pVarResult) = SysAllocString(fullName)))
@@ -237,7 +237,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF
         ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
         ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
         V_VT(pVarResult) = VT_BSTR;
-        res = GetModuleFileNameExW(wscript_process, NULL, fullPath, sizeof(fullPath)/sizeof(WCHAR));
+        res = GetModuleFileNameExW(wscript_process, NULL, fullPath, ARRAY_SIZE(fullPath));
         if(res == 0)
             return E_FAIL;
         pos = mystrrchr(fullPath, '\\');




More information about the wine-cvs mailing list