From e5d3a1b6f5d2b90b35a80292425b99ca2f98faf8 Mon Sep 17 00:00:00 2001 From: Petar Popovic Date: Tue, 24 Sep 2024 13:07:15 +0200 Subject: [PATCH] Remove casts from typed pointer to void * for printf %p in test projects --- test/testautomation_audio.c | 10 +++++----- test/testautomation_events.c | 4 ++-- test/testcamera.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index d99eb0515..9d03338dc 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -567,7 +567,7 @@ static int SDLCALL audio_buildAudioStream(void *arg) spec1.freq = 22050; stream = SDL_CreateAudioStream(&spec1, &spec1); SDLTest_AssertPass("Call to SDL_CreateAudioStream(spec1 ==> spec1)"); - SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", (void *)stream); + SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", stream); SDL_DestroyAudioStream(stream); /* Typical conversion */ @@ -579,7 +579,7 @@ static int SDLCALL audio_buildAudioStream(void *arg) spec2.freq = 44100; stream = SDL_CreateAudioStream(&spec1, &spec2); SDLTest_AssertPass("Call to SDL_CreateAudioStream(spec1 ==> spec2)"); - SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", (void *)stream); + SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", stream); SDL_DestroyAudioStream(stream); /* All source conversions with random conversion targets, allow 'null' conversions */ @@ -599,7 +599,7 @@ static int SDLCALL audio_buildAudioStream(void *arg) SDLTest_AssertPass("Call to SDL_CreateAudioStream(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", i, g_audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, g_audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); - SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", (void *)stream); + SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", stream); if (stream == NULL) { SDLTest_LogError("%s", SDL_GetError()); } @@ -684,7 +684,7 @@ static int SDLCALL audio_buildAudioStreamNegative(void *arg) SDLTest_Log("%s", message); stream = SDL_CreateAudioStream(&spec1, &spec2); SDLTest_AssertPass("Call to SDL_CreateAudioStream(spec1 ==> spec2)"); - SDLTest_AssertCheck(stream == NULL, "Verify stream value; expected: NULL, got: %p", (void *)stream); + SDLTest_AssertCheck(stream == NULL, "Verify stream value; expected: NULL, got: %p", stream); error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); SDLTest_AssertCheck(error != NULL && error[0] != '\0', "Validate that error message was not NULL or empty"); @@ -791,7 +791,7 @@ static int SDLCALL audio_convertAudio(void *arg) stream = SDL_CreateAudioStream(&spec1, &spec2); SDLTest_AssertPass("Call to SDL_CreateAudioStream(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", i, g_audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, g_audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); - SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", (void *)stream); + SDLTest_AssertCheck(stream != NULL, "Verify stream value; expected: != NULL, got: %p", stream); if (stream == NULL) { SDLTest_LogError("%s", SDL_GetError()); } else { diff --git a/test/testautomation_events.c b/test/testautomation_events.c index ae47df090..4eb1f23fc 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -91,8 +91,8 @@ static int SDLCALL events_pushPumpAndPollUserevent(void *arg) SDLTest_AssertCheck(SDL_EVENT_USER == event_out.type, "Check event type is SDL_EVENT_USER, expected: 0x%x, got: 0x%" SDL_PRIx32, SDL_EVENT_USER, event_out.type); SDLTest_AssertCheck(ref_code == event_out.user.code, "Check SDL_Event.user.code, expected: 0x%" SDL_PRIx32 ", got: 0x%" SDL_PRIx32 , ref_code, event_out.user.code); SDLTest_AssertCheck(0 == event_out.user.windowID, "Check SDL_Event.user.windowID, expected: NULL , got: %" SDL_PRIu32, event_out.user.windowID); - SDLTest_AssertCheck((void *)&g_userdataValue1 == event_out.user.data1, "Check SDL_Event.user.data1, expected: %p, got: %p", (void *)&g_userdataValue1, event_out.user.data1); - SDLTest_AssertCheck((void *)&g_userdataValue2 == event_out.user.data2, "Check SDL_Event.user.data2, expected: %p, got: %p", (void *)&g_userdataValue2, event_out.user.data2); + SDLTest_AssertCheck((void *)&g_userdataValue1 == event_out.user.data1, "Check SDL_Event.user.data1, expected: %p, got: %p", &g_userdataValue1, event_out.user.data1); + SDLTest_AssertCheck((void *)&g_userdataValue2 == event_out.user.data2, "Check SDL_Event.user.data2, expected: %p, got: %p", &g_userdataValue2, event_out.user.data2); event_window = SDL_GetWindowFromEvent(&event_out); SDLTest_AssertCheck(NULL == SDL_GetWindowFromEvent(&event_out), "Check SDL_GetWindowFromEvent returns the window id from a user event, expected: NULL, got: %p", event_window); diff --git a/test/testcamera.c b/test/testcamera.c index d6045a0a3..1cc21a4af 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -285,7 +285,7 @@ SDL_AppResult SDL_AppIterate(void *appstate) #if 0 if (frame_next) { - SDL_Log("frame: %p at %" SDL_PRIu64, (void*)frame_next->pixels, timestampNS); + SDL_Log("frame: %p at %" SDL_PRIu64, frame_next->pixels, timestampNS); } #endif