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

Alexandre Julliard julliard at winehq.org
Fri Jul 13 15:01:47 CDT 2018


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Fri Jul 13 19:01:29 2018 +0200

wmic: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/wmic/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/programs/wmic/main.c b/programs/wmic/main.c
index ddd2aec..f4a5bc7 100644
--- a/programs/wmic/main.c
+++ b/programs/wmic/main.c
@@ -82,7 +82,7 @@ static const WCHAR *find_class( const WCHAR *alias )
 {
     unsigned int i;
 
-    for (i = 0; i < sizeof(alias_map)/sizeof(alias_map[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(alias_map); i++)
     {
         if (!strcmpiW( alias, alias_map[i].alias )) return alias_map[i].class;
     }
@@ -158,7 +158,7 @@ static int output_message( int msg )
     static const WCHAR fmtW[] = {'%','s',0};
     WCHAR buffer[8192];
 
-    LoadStringW( GetModuleHandleW(NULL), msg, buffer, sizeof(buffer)/sizeof(WCHAR) );
+    LoadStringW( GetModuleHandleW(NULL), msg, buffer, ARRAY_SIZE(buffer));
     return output_string( fmtW, buffer );
 }
 
@@ -193,7 +193,7 @@ static int query_prop( const WCHAR *class, const WCHAR *propname )
     hr = IWbemLocator_ConnectServer( locator, path, NULL, NULL, NULL, 0, NULL, NULL, &services );
     if (hr != S_OK) goto done;
 
-    len = strlenW( class ) + sizeof(select_allW) / sizeof(select_allW[0]);
+    len = strlenW( class ) + ARRAY_SIZE(select_allW);
     if (!(query = SysAllocStringLen( NULL, len ))) goto done;
     strcpyW( query, select_allW );
     strcatW( query, class );




More information about the wine-cvs mailing list