Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/imaadp32.acm/imaadp32.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/imaadp32.acm/imaadp32.c b/dlls/imaadp32.acm/imaadp32.c index 474f548582..2b47f093d2 100644 --- a/dlls/imaadp32.acm/imaadp32.c +++ b/dlls/imaadp32.acm/imaadp32.c @@ -79,9 +79,6 @@ static const Format ADPCM_Formats[] = {1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100}, };
-#define NUM_PCM_FORMATS (sizeof(PCM_Formats) / sizeof(PCM_Formats[0])) -#define NUM_ADPCM_FORMATS (sizeof(ADPCM_Formats) / sizeof(ADPCM_Formats[0])) - /*********************************************************************** * ADPCM_GetFormatIndex */ @@ -93,11 +90,11 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx) switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM: - hi = NUM_PCM_FORMATS; + hi = ARRAY_SIZE(PCM_Formats); fmts = PCM_Formats; break; case WAVE_FORMAT_IMA_ADPCM: - hi = NUM_ADPCM_FORMATS; + hi = ARRAY_SIZE(ADPCM_Formats); fmts = ADPCM_Formats; break; default: @@ -585,13 +582,13 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery) case 0: aftd->dwFormatTag = WAVE_FORMAT_PCM; aftd->cbFormatSize = sizeof(PCMWAVEFORMAT); - aftd->cStandardFormats = NUM_PCM_FORMATS; + aftd->cStandardFormats = ARRAY_SIZE(PCM_Formats); lstrcpyW(aftd->szFormatTag, szPcm); break; case 1: aftd->dwFormatTag = WAVE_FORMAT_IMA_ADPCM; aftd->cbFormatSize = sizeof(IMAADPCMWAVEFORMAT); - aftd->cStandardFormats = NUM_ADPCM_FORMATS; + aftd->cStandardFormats = ARRAY_SIZE(ADPCM_Formats); lstrcpyW(aftd->szFormatTag, szImaAdPcm); break; } @@ -614,7 +611,7 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) switch (afd->dwFormatTag) { 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->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits; @@ -627,7 +624,7 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery) afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign; break; case WAVE_FORMAT_IMA_ADPCM: - if (afd->dwFormatIndex >= NUM_ADPCM_FORMATS) return ACMERR_NOTPOSSIBLE; + if (afd->dwFormatIndex >= ARRAY_SIZE(ADPCM_Formats)) return ACMERR_NOTPOSSIBLE; afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels; afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits;
On Thu, Jul 05, 2018 at 10:07:22PM +0200, Michael Stefaniuc wrote:
@@ -93,11 +90,11 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx) switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM:
- hi = NUM_PCM_FORMATS;
fmts = PCM_Formats; break; case WAVE_FORMAT_IMA_ADPCM:hi = ARRAY_SIZE(PCM_Formats);
- hi = NUM_ADPCM_FORMATS;
fmts = ADPCM_Formats; break; default:hi = ARRAY_SIZE(ADPCM_Formats);
I'd prefer to keep this as tabs, to stay (more) consistent.
Andrew
On 07/09/2018 03:08 PM, Andrew Eikum wrote:
On Thu, Jul 05, 2018 at 10:07:22PM +0200, Michael Stefaniuc wrote:
@@ -93,11 +90,11 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx) switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM:
- hi = NUM_PCM_FORMATS;
fmts = PCM_Formats; break; case WAVE_FORMAT_IMA_ADPCM:hi = ARRAY_SIZE(PCM_Formats);
- hi = NUM_ADPCM_FORMATS;
fmts = ADPCM_Formats; break; default:hi = ARRAY_SIZE(ADPCM_Formats);
I'd prefer to keep this as tabs, to stay (more) consistent.
I have changed it because it is already inconsistent. The "case" uses spaces for indentation and that cannot be changed to tabs.
bye michael
On Mon, Jul 09, 2018 at 08:44:39PM +0200, Michael Stefaniuc wrote:
On 07/09/2018 03:08 PM, Andrew Eikum wrote:
On Thu, Jul 05, 2018 at 10:07:22PM +0200, Michael Stefaniuc wrote:
@@ -93,11 +90,11 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx) switch (wfx->wFormatTag) { case WAVE_FORMAT_PCM:
- hi = NUM_PCM_FORMATS;
fmts = PCM_Formats; break; case WAVE_FORMAT_IMA_ADPCM:hi = ARRAY_SIZE(PCM_Formats);
- hi = NUM_ADPCM_FORMATS;
fmts = ADPCM_Formats; break; default:hi = ARRAY_SIZE(ADPCM_Formats);
I'd prefer to keep this as tabs, to stay (more) consistent.
I have changed it because it is already inconsistent. The "case" uses spaces for indentation and that cannot be changed to tabs.
It's stupid, but it is consistent. It uses 4-space indents, but swaps all instances of 8 spaces with a tab character. I'd prefer either fixing the whole switch-block, or leaving the indentation as it is.
Ditto for the l3codeca and msacm32 patches.
Andrew