From 5e820906623f7cd377fcf261c388fe418e7fbf43 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 22 Jul 2023 16:08:55 -0400 Subject: [PATCH] testautomation_audio.c: Apparently we aren't updating test code for C99 atm. --- test/testautomation_audio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index 2c07ab978..a59bbb206 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -226,6 +226,8 @@ static int audio_initOpenCloseQuitAudio(void *arg) */ static int audio_pauseUnpauseAudio(void *arg) { + int iMax; + int i, k, j; int result; const char *audioDriver; SDL_AudioSpec desired; @@ -235,17 +237,17 @@ static int audio_pauseUnpauseAudio(void *arg) SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); /* Loop over all available audio drivers */ - const int iMax = SDL_GetNumAudioDrivers(); + iMax = SDL_GetNumAudioDrivers(); SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - for (int i = 0; i < iMax; i++) { + for (i = 0; i < iMax; i++) { audioDriver = SDL_GetAudioDriver(i); SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ /* Change specs */ - for (int j = 0; j < 2; j++) { + for (j = 0; j < 2; j++) { /* Call Init */ SDL_SetHint("SDL_AUDIO_DRIVER", audioDriver); @@ -302,7 +304,7 @@ static int audio_pauseUnpauseAudio(void *arg) SDLTest_AssertCheck(g_audio_testCallbackLength > 0, "Verify callback length; expected: >0 got: %d", g_audio_testCallbackLength); /* Pause audio to stop playing (maybe multiple times) */ - for (int k = 0; k <= j; k++) { + for (k = 0; k <= j; k++) { const int pause_on = (k == 0) ? 1 : SDLTest_RandomIntegerInRange(99, 9999); if (pause_on) { SDL_PauseAudioDevice(g_audio_id);