[PATCH] msi: Avoid an ARRAY_SIZE-like macro

Michael Stefaniuc mstefani at winehq.org
Sat Aug 4 15:45:45 CDT 2018


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
 dlls/msi/dialog.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 1e78aa9e39..b96c44be44 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -3472,8 +3472,6 @@ static const struct control_handler msi_dialog_handler[] =
     { szHyperLink, msi_dialog_hyperlink }
 };
 
-#define NUM_CONTROL_TYPES (sizeof msi_dialog_handler/sizeof msi_dialog_handler[0])
-
 static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
 {
     msi_dialog *dialog = param;
@@ -3482,10 +3480,10 @@ static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
 
     /* find and call the function that can create this type of control */
     control_type = MSI_RecordGetString( rec, 3 );
-    for( i=0; i<NUM_CONTROL_TYPES; i++ )
+    for( i = 0; i < ARRAY_SIZE( msi_dialog_handler ); i++ )
         if (!strcmpiW( msi_dialog_handler[i].control_type, control_type ))
             break;
-    if( i != NUM_CONTROL_TYPES )
+    if( i != ARRAY_SIZE( msi_dialog_handler  ))
         msi_dialog_handler[i].func( dialog, rec );
     else
         ERR("no handler for element type %s\n", debugstr_w(control_type));
-- 
2.14.4




More information about the wine-devel mailing list