Michael Stefaniuc : wbemdisp: Use the ARRAY_SIZE() macro.

Alexandre Julliard julliard at winehq.org
Thu Jul 19 16:47:57 CDT 2018


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Jul 18 23:01:35 2018 +0200

wbemdisp: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard 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 cdc0ab4..1c7f56a 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 9d9b0ad..aff4d50 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;




More information about the wine-cvs mailing list