From 8abd579252efb323f92ccfafc20f35f6dd093c80 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 11 Jul 2018 22:06:11 +0200 Subject: [PATCH] msgsm32.acm: Avoid an ARRAY_SIZE-like macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/msgsm32.acm/msgsm32.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/msgsm32.acm/msgsm32.c b/dlls/msgsm32.acm/msgsm32.c index cce1303455a..99eef9624ea 100644 --- a/dlls/msgsm32.acm/msgsm32.c +++ b/dlls/msgsm32.acm/msgsm32.c @@ -199,7 +199,6 @@ static BOOL GSM_FormatValidate(const WAVEFORMATEX *wfx) } static const DWORD gsm_rates[] = { 8000, 11025, 22050, 44100, 48000, 96000 }; -#define NUM_RATES (sizeof(gsm_rates)/sizeof(*gsm_rates)) /*********************************************************************** * GSM_FormatTagDetails @@ -241,13 +240,13 @@ static LRESULT GSM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) case 0: aftd->dwFormatTag = WAVE_FORMAT_PCM; aftd->cbFormatSize = sizeof(PCMWAVEFORMAT); - aftd->cStandardFormats = NUM_RATES; + aftd->cStandardFormats = ARRAY_SIZE(gsm_rates); lstrcpyW(aftd->szFormatTag, szPcm); break; case 1: aftd->dwFormatTag = WAVE_FORMAT_GSM610; aftd->cbFormatSize = sizeof(GSM610WAVEFORMAT); - aftd->cStandardFormats = NUM_RATES; + aftd->cStandardFormats = ARRAY_SIZE(gsm_rates); lstrcpyW(aftd->szFormatTag, szGsm); break; } @@ -270,7 +269,7 @@ static LRESULT GSM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) switch (afd->dwFormatTag) { case WAVE_FORMAT_PCM: - if (afd->dwFormatIndex >= NUM_RATES) return ACMERR_NOTPOSSIBLE; + if (afd->dwFormatIndex >= ARRAY_SIZE(gsm_rates)) return ACMERR_NOTPOSSIBLE; afd->pwfx->nChannels = 1; afd->pwfx->nSamplesPerSec = gsm_rates[afd->dwFormatIndex]; afd->pwfx->wBitsPerSample = 16; @@ -278,7 +277,7 @@ static LRESULT GSM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign; break; case WAVE_FORMAT_GSM610: - if (afd->dwFormatIndex >= NUM_RATES) return ACMERR_NOTPOSSIBLE; + if (afd->dwFormatIndex >= ARRAY_SIZE(gsm_rates)) return ACMERR_NOTPOSSIBLE; afd->pwfx->nChannels = 1; afd->pwfx->nSamplesPerSec = gsm_rates[afd->dwFormatIndex]; afd->pwfx->wBitsPerSample = 0;