From ca5c3048145e250bc4d8255798d0f01e6460024d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 13 Aug 2017 21:06:52 -0700 Subject: [PATCH] Fixed bug 3744 - missing SDLCALL in several functions Ozkan Sezer The attached patch adds missing SDLCALL to several functions, so that they properly match the headers as intended. --- src/SDL_assert.c | 4 ++-- src/events/SDL_windowevents.c | 8 ++++---- src/joystick/SDL_gamecontroller.c | 2 +- src/render/SDL_render.c | 2 +- src/timer/SDL_timer.c | 2 +- test/testatomic.c | 8 ++++---- test/testautomation_audio.c | 2 +- test/testautomation_events.c | 2 +- test/testautomation_timer.c | 2 +- test/testhittesting.c | 2 +- test/testmessage.c | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/SDL_assert.c b/src/SDL_assert.c index c64d62624..47309eb7c 100644 --- a/src/SDL_assert.c +++ b/src/SDL_assert.c @@ -49,7 +49,7 @@ #endif -static SDL_assert_state +static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data, void *userdata); /* @@ -141,7 +141,7 @@ static SDL_NORETURN void SDL_AbortAssertion(void) } -static SDL_assert_state +static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) { #ifdef __WIN32__ diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c index 12d4b83c3..b12dfbf5c 100644 --- a/src/events/SDL_windowevents.c +++ b/src/events/SDL_windowevents.c @@ -28,7 +28,7 @@ #include "../video/SDL_sysvideo.h" -static int +static int SDLCALL RemovePendingResizedEvents(void * userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; @@ -42,7 +42,7 @@ RemovePendingResizedEvents(void * userdata, SDL_Event *event) return 1; } -static int +static int SDLCALL RemovePendingSizeChangedEvents(void * userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; @@ -56,7 +56,7 @@ RemovePendingSizeChangedEvents(void * userdata, SDL_Event *event) return 1; } -static int +static int SDLCALL RemovePendingMoveEvents(void * userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; @@ -70,7 +70,7 @@ RemovePendingMoveEvents(void * userdata, SDL_Event *event) return 1; } -static int +static int SDLCALL RemovePendingExposedEvents(void * userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index ba0ab8369..1227fa7df 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -333,7 +333,7 @@ static void HandleJoystickHat(SDL_GameController *gamecontroller, int hat, Uint8 /* * Event filter to fire controller events from joystick ones */ -static int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event) +static int SDLCALL SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event) { switch(event->type) { case SDL_JOYAXISMOTION: diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index ea8cfdfe6..81feaf6f2 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -102,7 +102,7 @@ SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info) #endif } -static int +static int SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event) { SDL_Renderer *renderer = (SDL_Renderer *)userdata; diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index 3dcf7cbeb..2ed9ae1de 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -97,7 +97,7 @@ SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer) timer->next = curr; } -static int +static int SDLCALL SDL_TimerThread(void *_data) { SDL_TimerData *data = (SDL_TimerData *)_data; diff --git a/test/testatomic.c b/test/testatomic.c index 52646d630..bbb027063 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -117,7 +117,7 @@ static SDL_atomic_t threadsRunning; static SDL_sem *threadDone; static -int adder(void* junk) +int SDLCALL adder(void* junk) { unsigned long N=NInter; SDL_Log("Thread subtracting %d %lu times\n",CountInc,N); @@ -495,7 +495,7 @@ typedef struct char padding[SDL_CACHELINE_SIZE-(sizeof(SDL_EventQueue*)+sizeof(int)*NUM_WRITERS+sizeof(int)+sizeof(SDL_bool))%SDL_CACHELINE_SIZE]; } ReaderData; -static int FIFO_Writer(void* _data) +static int SDLCALL FIFO_Writer(void* _data) { WriterData *data = (WriterData *)_data; SDL_EventQueue *queue = data->queue; @@ -530,7 +530,7 @@ static int FIFO_Writer(void* _data) return 0; } -static int FIFO_Reader(void* _data) +static int SDLCALL FIFO_Reader(void* _data) { ReaderData *data = (ReaderData *)_data; SDL_EventQueue *queue = data->queue; @@ -570,7 +570,7 @@ static int FIFO_Reader(void* _data) #ifdef TEST_SPINLOCK_FIFO /* This thread periodically locks the queue for no particular reason */ -static int FIFO_Watcher(void* _data) +static int SDLCALL FIFO_Watcher(void* _data) { SDL_EventQueue *queue = (SDL_EventQueue *)_data; diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index bef838dde..be0f15e3d 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -46,7 +46,7 @@ int _audio_testCallbackLength; /* Test callback function */ -void _audio_testCallback(void *userdata, Uint8 *stream, int len) +void SDLCALL _audio_testCallback(void *userdata, Uint8 *stream, int len) { /* track that callback was called */ _audio_testCallbackCounter++; diff --git a/test/testautomation_events.c b/test/testautomation_events.c index a0119bdbe..09004da52 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -25,7 +25,7 @@ int _userdataValue1 = 1; int _userdataValue2 = 2; /* Event filter that sets some flags and optionally checks userdata */ -int _events_sampleNullEventFilter(void *userdata, SDL_Event *event) +int SDLCALL _events_sampleNullEventFilter(void *userdata, SDL_Event *event) { _eventFilterCalled = 1; diff --git a/test/testautomation_timer.c b/test/testautomation_timer.c index 6d73856ee..a42eb37ac 100644 --- a/test/testautomation_timer.c +++ b/test/testautomation_timer.c @@ -104,7 +104,7 @@ timer_delayAndGetTicks(void *arg) } /* Test callback */ -Uint32 _timerTestCallback(Uint32 interval, void *param) +Uint32 SDLCALL _timerTestCallback(Uint32 interval, void *param) { _timerCallbackCalled = 1; diff --git a/test/testhittesting.c b/test/testhittesting.c index 5e32be42d..c5223a983 100644 --- a/test/testhittesting.c +++ b/test/testhittesting.c @@ -14,7 +14,7 @@ const SDL_Rect drag_areas[] = { static const SDL_Rect *areas = drag_areas; static int numareas = SDL_arraysize(drag_areas); -static SDL_HitTestResult +static SDL_HitTestResult SDLCALL hitTest(SDL_Window *window, const SDL_Point *pt, void *data) { int i; diff --git a/test/testmessage.c b/test/testmessage.c index 0a4b93f67..27407ba64 100644 --- a/test/testmessage.c +++ b/test/testmessage.c @@ -25,7 +25,7 @@ quit(int rc) exit(rc); } -static int +static int SDLCALL button_messagebox(void *eventNumber) { const SDL_MessageBoxButtonData buttons[] = {