dsound/tests: Avoid ARRAY_SIZE-like macros.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-06-13 20:30:23 +02:00 committed by Alexandre Julliard
parent 3a72836136
commit b509b54898
4 changed files with 9 additions and 11 deletions

View File

@ -549,7 +549,7 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription,
"should have 0\n",ref);
}
for (f=0;f<NB_FORMATS;f++) {
for (f = 0; f < ARRAY_SIZE(formats); f++) {
dscbo=NULL;
init_format(&wfx,WAVE_FORMAT_PCM,formats[f][0],formats[f][1],
formats[f][2]);

View File

@ -571,8 +571,8 @@ static HRESULT test_primary_secondary(LPGUID lpGuid)
"IDirectSound_CreateSoundBuffer() failed to create a primary buffer %08x\n",rc);
if (rc==DS_OK && primary!=NULL) {
for (f=0;f<NB_FORMATS;f++) {
for (tag=0;tag<NB_TAGS;tag++) {
for (f = 0; f < ARRAY_SIZE(formats); f++) {
for (tag = 0; tag < ARRAY_SIZE(format_tags); tag++) {
/* if float, we only want to test 32-bit */
if ((format_tags[tag] == WAVE_FORMAT_IEEE_FLOAT) && (formats[f][1] != 32))
continue;
@ -718,8 +718,8 @@ static HRESULT test_secondary(LPGUID lpGuid)
if (rc!=DS_OK)
goto EXIT1;
for (f=0;f<NB_FORMATS;f++) {
for (tag=0;tag<NB_TAGS;tag++) {
for (f = 0; f < ARRAY_SIZE(formats); f++) {
for (tag = 0; tag < ARRAY_SIZE(format_tags); tag++) {
WAVEFORMATEXTENSIBLE wfxe;
/* if float, we only want to test 32-bit */

View File

@ -581,8 +581,8 @@ static HRESULT test_primary_secondary8(LPGUID lpGuid)
"%08x\n",rc);
if (rc==DS_OK && primary!=NULL) {
for (f=0;f<NB_FORMATS;f++) {
for (tag=0;tag<NB_TAGS;tag++) {
for (f = 0; f < ARRAY_SIZE(formats); f++) {
for (tag = 0; tag < ARRAY_SIZE(format_tags); tag++) {
/* if float, we only want to test 32-bit */
if ((format_tags[tag] == WAVE_FORMAT_IEEE_FLOAT) && (formats[f][1] != 32))
continue;
@ -727,8 +727,8 @@ static HRESULT test_secondary8(LPGUID lpGuid)
if (rc!=DS_OK)
goto EXIT1;
for (f=0;f<NB_FORMATS;f++) {
for (tag=0;tag<NB_TAGS;tag++) {
for (f = 0; f < ARRAY_SIZE(formats); f++) {
for (tag = 0; tag < ARRAY_SIZE(format_tags); tag++) {
WAVEFORMATEXTENSIBLE wfxe;
/* if float, we only want to test 32-bit */

View File

@ -71,10 +71,8 @@ static const unsigned int formats[][4]={
{96000, 32, 1, 0 },
{96000, 32, 2, 0 }
};
#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
static const unsigned int format_tags[] = {WAVE_FORMAT_PCM, WAVE_FORMAT_IEEE_FLOAT};
#define NB_TAGS (sizeof(format_tags)/sizeof(*format_tags))
/* The time slice determines how often we will service the buffer */
#define TIME_SLICE 31