SDL_test_harness.c: Fix warning -Wcast-function-type-strict

This commit is contained in:
Petar Popovic 2024-09-10 23:13:30 +02:00 committed by Sam Lantinga
parent 0b6f993dea
commit 323b60abf1
1 changed files with 4 additions and 6 deletions

View File

@ -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;
}
/**