From 323b60abf1aa7c1eca5e913982221d9468184532 Mon Sep 17 00:00:00 2001
From: Petar Popovic <[EMAIL REDACTED]>
Date: Tue, 10 Sep 2024 23:13:30 +0200
Subject: [PATCH] SDL_test_harness.c: Fix warning -Wcast-function-type-strict
---
src/test/SDL_test_harness.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c
index 68dd0e6713a20..70dd5141deec9 100644
--- a/src/test/SDL_test_harness.c
+++ b/src/test/SDL_test_harness.c
@@ -185,7 +185,7 @@ static Uint64 SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName
*
* \return Timer id or -1 on failure.
*/
-static SDL_TimerID SDLTest_SetTestTimeout(int timeout, void(SDLCALL *callback)(void))
+static SDL_TimerID SDLTest_SetTestTimeout(int timeout, SDL_TimerCallback callback)
{
Uint32 timeoutInMilliseconds;
SDL_TimerID timerID;
@@ -210,7 +210,7 @@ static SDL_TimerID SDLTest_SetTestTimeout(int timeout, void(SDLCALL *callback)(v
/* Set timer */
timeoutInMilliseconds = timeout * 1000;
- timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback)callback, 0x0);
+ timerID = SDL_AddTimer(timeoutInMilliseconds, callback, 0x0);
if (timerID == 0) {
SDLTest_LogError("Creation of SDL timer failed: %s", SDL_GetError());
return 0;
@@ -222,13 +222,11 @@ static SDL_TimerID SDLTest_SetTestTimeout(int timeout, void(SDLCALL *callback)(v
/**
* Timeout handler. Aborts test run and exits harness process.
*/
-#ifdef __WATCOMC__
-#pragma aux SDLTest_BailOut aborts;
-#endif
-static SDL_NORETURN void SDLCALL SDLTest_BailOut(void)
+static Uint32 SDLCALL SDLTest_BailOut(void *userdata, SDL_TimerID timerID, Uint32 interval)
{
SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run.");
exit(TEST_ABORTED); /* bail out from the test */
+ return 0;
}
/**