[PATCH] wbemdisp: Use the ARRAY_SIZE() macro

Michael Stefaniuc mstefani at winehq.org
Wed Jul 18 16:01:35 CDT 2018


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
 dlls/wbemdisp/locator.c | 4 ++--
 dlls/wbemdisp/main.c    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c
index cdc0ab4479..1c7f56ad25 100644
--- a/dlls/wbemdisp/locator.c
+++ b/dlls/wbemdisp/locator.c
@@ -1641,7 +1641,7 @@ static HRESULT WINAPI services_DeleteAsync(
 static BSTR build_query_string( const WCHAR *class )
 {
     static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0};
-    UINT len = strlenW(class) + sizeof(selectW) / sizeof(selectW[0]);
+    UINT len = strlenW(class) + ARRAY_SIZE(selectW);
     BSTR ret;
 
     if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
@@ -2074,7 +2074,7 @@ static BSTR build_resource_string( BSTR server, BSTR namespace )
     if (server && *server) len_server = strlenW( server );
     else len_server = 1;
     if (namespace && *namespace) len_namespace = strlenW( namespace );
-    else len_namespace = sizeof(defaultW) / sizeof(defaultW[0]) - 1;
+    else len_namespace = ARRAY_SIZE(defaultW) - 1;
 
     if (!(ret = SysAllocStringLen( NULL, 2 + len_server + 1 + len_namespace ))) return NULL;
 
diff --git a/dlls/wbemdisp/main.c b/dlls/wbemdisp/main.c
index 9d9b0adf40..aff4d5042b 100644
--- a/dlls/wbemdisp/main.c
+++ b/dlls/wbemdisp/main.c
@@ -374,7 +374,7 @@ static HRESULT WINAPI WinMGMTS_ParseDisplayName(IParseDisplayName *iface, IBindC
         ULONG *pchEaten, IMoniker **ppmkOut)
 {
     static const WCHAR prefixW[] = {'w','i','n','m','g','m','t','s',':',0};
-    const DWORD prefix_len = sizeof(prefixW) / sizeof(prefixW[0]) - 1;
+    const DWORD prefix_len = ARRAY_SIZE(prefixW) - 1;
     ISWbemLocator *locator = NULL;
     ISWbemServices *services = NULL;
     ISWbemObject *obj = NULL;
-- 
2.14.4




More information about the wine-devel mailing list