Module: wine Branch: master Commit: 8ce75cc5d497ca445c67a461dc0fa931ebeb81b4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=8ce75cc5d497ca445c67a461d...
Author: Michael Stefaniuc mstefani@winehq.org Date: Sat Jul 7 23:39:09 2018 +0200
winmm: Avoid an ARRAY_SIZE-like macro.
Signed-off-by: Michael Stefaniuc mstefani@winehq.org Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winmm/lolvldrv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c index 3f63e5f..35bd6a0 100644 --- a/dlls/winmm/lolvldrv.c +++ b/dlls/winmm/lolvldrv.c @@ -68,7 +68,6 @@ static BOOL drivers_loaded; static int MMDrvsHi; static WINE_MM_DRIVER MMDrvs[8]; static LPWINE_MLD MM_MLDrvs[40]; -#define MAX_MM_MLDRVS (sizeof(MM_MLDrvs) / sizeof(MM_MLDrvs[0]))
static void MMDRV_Init(void);
@@ -146,9 +145,9 @@ LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD* dwFlags, if (!mld) return NULL;
/* find an empty slot in MM_MLDrvs table */ - for (i = 0; i < MAX_MM_MLDRVS; i++) if (!MM_MLDrvs[i]) break; + for (i = 0; i < ARRAY_SIZE(MM_MLDrvs); i++) if (!MM_MLDrvs[i]) break;
- if (i == MAX_MM_MLDRVS) { + if (i == ARRAY_SIZE(MM_MLDrvs)) { /* the MM_MLDrvs table could be made growable in the future if needed */ ERR("Too many open drivers\n"); HeapFree(GetProcessHeap(), 0, mld);