[WINESYNC] msi: Avoid an ARRAY_SIZE-like macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b8027768b88eed2376ea484aa7adef20c82483f4 by Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
winesync 2022-03-12 23:50:39 +01:00 committed by Mark Jansen
parent ac9d876fe9
commit 55b4e50af8
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -3479,8 +3479,6 @@ static const struct control_handler msi_dialog_handler[] =
{ szHyperLink, msi_dialog_hyperlink } { 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 ) static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
{ {
msi_dialog *dialog = param; msi_dialog *dialog = param;
@ -3489,10 +3487,10 @@ static UINT msi_dialog_create_controls( MSIRECORD *rec, LPVOID param )
/* find and call the function that can create this type of control */ /* find and call the function that can create this type of control */
control_type = MSI_RecordGetString( rec, 3 ); 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 )) if (!strcmpiW( msi_dialog_handler[i].control_type, control_type ))
break; break;
if( i != NUM_CONTROL_TYPES ) if( i != ARRAY_SIZE( msi_dialog_handler ))
msi_dialog_handler[i].func( dialog, rec ); msi_dialog_handler[i].func( dialog, rec );
else else
ERR("no handler for element type %s\n", debugstr_w(control_type)); ERR("no handler for element type %s\n", debugstr_w(control_type));