Commit c2272212 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

l3codeca.acm: Avoid ARRAY_SIZE-like macros.

parent 96cf25ed
...@@ -89,9 +89,6 @@ static const Format MPEG3_Formats[] = ...@@ -89,9 +89,6 @@ static const Format MPEG3_Formats[] =
{1, 0, 48000}, {2, 0, 48000} {1, 0, 48000}, {2, 0, 48000}
}; };
#define NUM_PCM_FORMATS (sizeof(PCM_Formats) / sizeof(PCM_Formats[0]))
#define NUM_MPEG3_FORMATS (sizeof(MPEG3_Formats) / sizeof(MPEG3_Formats[0]))
/*********************************************************************** /***********************************************************************
* MPEG3_GetFormatIndex * MPEG3_GetFormatIndex
*/ */
...@@ -103,12 +100,12 @@ static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx) ...@@ -103,12 +100,12 @@ static DWORD MPEG3_GetFormatIndex(LPWAVEFORMATEX wfx)
switch (wfx->wFormatTag) switch (wfx->wFormatTag)
{ {
case WAVE_FORMAT_PCM: case WAVE_FORMAT_PCM:
hi = NUM_PCM_FORMATS; hi = ARRAY_SIZE(PCM_Formats);
fmts = PCM_Formats; fmts = PCM_Formats;
break; break;
case WAVE_FORMAT_MPEG: case WAVE_FORMAT_MPEG:
case WAVE_FORMAT_MPEGLAYER3: case WAVE_FORMAT_MPEGLAYER3:
hi = NUM_MPEG3_FORMATS; hi = ARRAY_SIZE(MPEG3_Formats);
fmts = MPEG3_Formats; fmts = MPEG3_Formats;
break; break;
default: default:
...@@ -733,7 +730,7 @@ static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) ...@@ -733,7 +730,7 @@ static LRESULT MPEG3_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
case 0: case 0:
aftd->dwFormatTag = WAVE_FORMAT_PCM; aftd->dwFormatTag = WAVE_FORMAT_PCM;
aftd->cbFormatSize = sizeof(PCMWAVEFORMAT); aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
aftd->cStandardFormats = NUM_PCM_FORMATS; aftd->cStandardFormats = ARRAY_SIZE(PCM_Formats);
lstrcpyW(aftd->szFormatTag, szPcm); lstrcpyW(aftd->szFormatTag, szPcm);
break; break;
case 1: case 1:
...@@ -768,7 +765,7 @@ static LRESULT MPEG3_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) ...@@ -768,7 +765,7 @@ static LRESULT MPEG3_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
switch (afd->dwFormatTag) switch (afd->dwFormatTag)
{ {
case WAVE_FORMAT_PCM: case WAVE_FORMAT_PCM:
if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE; if (afd->dwFormatIndex >= ARRAY_SIZE(PCM_Formats)) return ACMERR_NOTPOSSIBLE;
afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels; afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits; afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment