From b6e97d9ff0418e630e0a093d89797b41e960d9ac Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jan 2024 08:15:41 -0800 Subject: [PATCH] Fixed Xcode warnings --- src/audio/SDL_audio.c | 2 +- src/audio/SDL_wave.c | 6 +++--- src/audio/coreaudio/SDL_coreaudio.m | 4 ++-- src/events/SDL_events.c | 8 ++++---- src/events/SDL_gesture.c | 2 +- src/events/SDL_mouse.c | 2 +- src/hidapi/SDL_hidapi.c | 6 +++--- src/hidapi/ios/hid.m | 2 +- src/joystick/SDL_gamecontroller.c | 2 +- src/joystick/SDL_joystick.c | 6 +++--- src/render/SDL_render.c | 2 +- src/render/opengles2/SDL_shaders_gles2.c | 2 +- src/sensor/SDL_sensor.c | 2 +- src/thread/SDL_thread.c | 6 +++--- src/video/SDL_blit.c | 2 +- src/video/SDL_stretch.c | 2 +- src/video/SDL_video.c | 14 +++++++------- src/video/SDL_yuv.c | 2 +- src/video/uikit/SDL_uikitevents.m | 2 +- src/video/uikit/SDL_uikitmodes.m | 2 +- src/video/uikit/SDL_uikitvideo.m | 2 +- 21 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 6e575bd4b..96586fe77 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1052,7 +1052,7 @@ int SDL_AudioInit(const char *driver_name) /* * Get the current audio driver name */ -const char *SDL_GetCurrentAudioDriver() +const char *SDL_GetCurrentAudioDriver(void) { return current_audio.name; } diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index 78a9ddf75..1ecce9b91 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -1438,7 +1438,7 @@ static int PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) return 0; } -static WaveRiffSizeHint WaveGetRiffSizeHint() +static WaveRiffSizeHint WaveGetRiffSizeHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WAVE_RIFF_CHUNK_SIZE); @@ -1457,7 +1457,7 @@ static WaveRiffSizeHint WaveGetRiffSizeHint() return RiffSizeNoHint; } -static WaveTruncationHint WaveGetTruncationHint() +static WaveTruncationHint WaveGetTruncationHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WAVE_TRUNCATION); @@ -1476,7 +1476,7 @@ static WaveTruncationHint WaveGetTruncationHint() return TruncNoHint; } -static WaveFactChunkHint WaveGetFactChunkHint() +static WaveFactChunkHint WaveGetFactChunkHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WAVE_FACT_CHUNK); diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m index 9bbbb9c3b..26da64d7e 100644 --- a/src/audio/coreaudio/SDL_coreaudio.m +++ b/src/audio/coreaudio/SDL_coreaudio.m @@ -293,7 +293,7 @@ static SDL_AudioDevice **open_devices; static BOOL session_active = NO; -static void pause_audio_devices() +static void pause_audio_devices(void) { int i; @@ -309,7 +309,7 @@ static void pause_audio_devices() } } -static void resume_audio_devices() +static void resume_audio_devices(void) { int i; diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index bf08b947a..47f57214a 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -740,7 +740,7 @@ static void SDL_CutEvent(SDL_EventEntry *entry) SDL_AtomicAdd(&SDL_EventQ.count, -1); } -static int SDL_SendWakeupEvent() +static int SDL_SendWakeupEvent(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); if (_this == NULL || !_this->SendWakeupEvent) { @@ -955,7 +955,7 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel) } } -void SDL_PumpEvents() +void SDL_PumpEvents(void) { SDL_PumpEventsInternal(SDL_FALSE); } @@ -967,7 +967,7 @@ int SDL_PollEvent(SDL_Event *event) return SDL_WaitEventTimeout(event, 0); } -static SDL_bool SDL_events_need_periodic_poll() +static SDL_bool SDL_events_need_periodic_poll(void) { SDL_bool need_periodic_poll = SDL_FALSE; @@ -1052,7 +1052,7 @@ static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Eve return 0; } -static SDL_bool SDL_events_need_polling() +static SDL_bool SDL_events_need_polling(void) { SDL_bool need_polling = SDL_FALSE; diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index 658478a4b..63362c0f6 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -110,7 +110,7 @@ int SDL_RecordGesture(SDL_TouchID touchId) return touchId < 0; } -void SDL_GestureQuit() +void SDL_GestureQuit(void) { SDL_free(SDL_gestureTouch); SDL_gestureTouch = NULL; diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index f479fb818..431354f88 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -1178,7 +1178,7 @@ int SDL_SetRelativeMouseMode(SDL_bool enabled) return 0; } -SDL_bool SDL_GetRelativeMouseMode() +SDL_bool SDL_GetRelativeMouseMode(void) { SDL_Mouse *mouse = SDL_GetMouse(); diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index f83bfb84f..6ed1eb613 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -220,7 +220,7 @@ static int StrIsInteger(const char *string) } #endif /* HAVE_INOTIFY */ -static void HIDAPI_InitializeDiscovery() +static void HIDAPI_InitializeDiscovery(void) { SDL_HIDAPI_discovery.m_bInitialized = SDL_TRUE; SDL_HIDAPI_discovery.m_unDeviceChangeCounter = 1; @@ -359,7 +359,7 @@ static void HIDAPI_InitializeDiscovery() } } -static void HIDAPI_UpdateDiscovery() +static void HIDAPI_UpdateDiscovery(void) { if (!SDL_HIDAPI_discovery.m_bInitialized) { HIDAPI_InitializeDiscovery(); @@ -476,7 +476,7 @@ static void HIDAPI_UpdateDiscovery() } } -static void HIDAPI_ShutdownDiscovery() +static void HIDAPI_ShutdownDiscovery(void) { if (!SDL_HIDAPI_discovery.m_bInitialized) { return; diff --git a/src/hidapi/ios/hid.m b/src/hidapi/ios/hid.m index 730e10b81..636d0f076 100644 --- a/src/hidapi/ios/hid.m +++ b/src/hidapi/ios/hid.m @@ -475,7 +475,7 @@ typedef enum // Core Bluetooth devices calling back on event boundaries of their run-loops. so annoying. -static void process_pending_events() +static void process_pending_events(void) { CFRunLoopRunResult res; do diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index e6596410f..bce36ab15 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1849,7 +1849,7 @@ char *SDL_GameControllerMapping(SDL_GameController *gamecontroller) return retval; } -static void SDL_GameControllerLoadHints() +static void SDL_GameControllerLoadHints(void) { const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG); if (hint && hint[0]) { diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 324dd88b4..b0915afac 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -492,7 +492,7 @@ static SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriv return SDL_FALSE; } -static int SDL_FindFreePlayerIndex() +static int SDL_FindFreePlayerIndex(void) { int player_index; @@ -658,7 +658,7 @@ int SDL_NumJoysticks(void) * Return the next available joystick instance ID * This may be called by drivers from multiple threads, unprotected by any locks */ -SDL_JoystickID SDL_GetNextJoystickInstanceID() +SDL_JoystickID SDL_GetNextJoystickInstanceID(void) { return SDL_AtomicIncRef(&SDL_next_joystick_instance_id); } @@ -1663,7 +1663,7 @@ void SDL_JoystickQuit(void) SDL_UnlockJoysticks(); } -static SDL_bool SDL_PrivateJoystickShouldIgnoreEvent() +static SDL_bool SDL_PrivateJoystickShouldIgnoreEvent(void) { if (SDL_joystick_allows_background_events) { return SDL_FALSE; diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 4035afa24..39dcadb33 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -892,7 +892,7 @@ static SDL_INLINE void VerifyDrawQueueFunctions(const SDL_Renderer *renderer) SDL_assert(renderer->RunCommandQueue != NULL); } -static SDL_RenderLineMethod SDL_GetRenderLineMethod() +static SDL_RenderLineMethod SDL_GetRenderLineMethod(void) { const char *hint = SDL_GetHint(SDL_HINT_RENDER_LINE_METHOD); diff --git a/src/render/opengles2/SDL_shaders_gles2.c b/src/render/opengles2/SDL_shaders_gles2.c index 8293926cd..cbb216bc5 100644 --- a/src/render/opengles2/SDL_shaders_gles2.c +++ b/src/render/opengles2/SDL_shaders_gles2.c @@ -380,7 +380,7 @@ const char *GLES2_GetShaderInclude(GLES2_ShaderIncludeType type) } } -GLES2_ShaderIncludeType GLES2_GetTexCoordPrecisionEnumFromHint() +GLES2_ShaderIncludeType GLES2_GetTexCoordPrecisionEnumFromHint(void) { const char *texcoord_hint = SDL_GetHint("SDL_RENDER_OPENGLES2_TEXCOORD_PRECISION"); GLES2_ShaderIncludeType value = GLES2_SHADER_FRAGMENT_INCLUDE_BEST_TEXCOORD_PRECISION; diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index 8f32bb5e4..3179f7302 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -108,7 +108,7 @@ int SDL_NumSensors(void) * Return the next available sensor instance ID * This may be called by drivers from multiple threads, unprotected by any locks */ -SDL_SensorID SDL_GetNextSensorInstanceID() +SDL_SensorID SDL_GetNextSensorInstanceID(void) { return SDL_AtomicIncRef(&SDL_next_sensor_instance_id); } diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 7c565d74d..55c290244 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -28,7 +28,7 @@ #include "SDL_hints.h" #include "../SDL_error_c.h" -SDL_TLSID SDL_TLSCreate() +SDL_TLSID SDL_TLSCreate(void) { static SDL_atomic_t SDL_tls_id; return SDL_AtomicIncRef(&SDL_tls_id) + 1; @@ -78,7 +78,7 @@ int SDL_TLSSet(SDL_TLSID id, const void *value, void(SDLCALL *destructor)(void * return 0; } -void SDL_TLSCleanup() +void SDL_TLSCleanup(void) { SDL_TLSData *storage; @@ -193,7 +193,7 @@ int SDL_Generic_SetTLSData(SDL_TLSData *data) } /* Non-thread-safe global error variable */ -static SDL_error *SDL_GetStaticErrBuf() +static SDL_error *SDL_GetStaticErrBuf(void) { static SDL_error SDL_global_error; static char SDL_global_error_str[128]; diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index b8eb9eb18..19d47a17f 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -116,7 +116,7 @@ static SDL_bool SDL_UseAltivecPrefetch() } } #else -static SDL_bool SDL_UseAltivecPrefetch() +static SDL_bool SDL_UseAltivecPrefetch(void) { /* Just guess G4 */ return SDL_TRUE; diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 105b02b58..1df851ce5 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -532,7 +532,7 @@ static int scale_mat_SSE(const Uint32 *src, int src_w, int src_h, int src_pitch, #if defined(HAVE_NEON_INTRINSICS) -static SDL_INLINE int hasNEON() +static SDL_INLINE int hasNEON(void) { static int val = -1; if (val != -1) { diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 022d8ad9c..ec09174b5 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -407,7 +407,7 @@ static int SDLCALL cmpmodes(const void *A, const void *B) return 0; } -static int SDL_UninitializedVideo() +static int SDL_UninitializedVideo(void) { return SDL_SetError("Video subsystem has not been initialized"); } @@ -595,7 +595,7 @@ pre_driver_error: return -1; } -const char *SDL_GetCurrentVideoDriver() +const char *SDL_GetCurrentVideoDriver(void) { if (!_this) { SDL_UninitializedVideo(); @@ -609,7 +609,7 @@ SDL_VideoDevice *SDL_GetVideoDevice(void) return _this; } -SDL_bool SDL_OnVideoThread() +SDL_bool SDL_OnVideoThread(void) { return (_this && SDL_ThreadID() == _this->thread) ? SDL_TRUE : SDL_FALSE; } @@ -3336,7 +3336,7 @@ void SDL_DestroyWindow(SDL_Window *window) SDL_free(window); } -SDL_bool SDL_IsScreenSaverEnabled() +SDL_bool SDL_IsScreenSaverEnabled(void) { if (!_this) { return SDL_TRUE; @@ -3344,7 +3344,7 @@ SDL_bool SDL_IsScreenSaverEnabled() return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE; } -void SDL_EnableScreenSaver() +void SDL_EnableScreenSaver(void) { if (!_this) { return; @@ -3358,7 +3358,7 @@ void SDL_EnableScreenSaver() } } -void SDL_DisableScreenSaver() +void SDL_DisableScreenSaver(void) { if (!_this) { return; @@ -3600,7 +3600,7 @@ void SDL_GL_DeduceMaxSupportedESProfile(int *major, int *minor) #endif } -void SDL_GL_ResetAttributes() +void SDL_GL_ResetAttributes(void) { if (!_this) { return; diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index 9109e384a..14f57468d 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -40,7 +40,7 @@ void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode) SDL_YUV_ConversionMode = mode; } -SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode() +SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void) { return SDL_YUV_ConversionMode; } diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index b135ad54e..938b70a7d 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -283,7 +283,7 @@ static void UpdateScrollDirection(void) #endif } -static void UpdatePointerLock() +static void UpdatePointerLock(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *window; diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 24750d22d..47723070a 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -517,7 +517,7 @@ void UIKit_QuitModes(_THIS) } #if !TARGET_OS_TV -void SDL_OnApplicationDidChangeStatusBarOrientation() +void SDL_OnApplicationDidChangeStatusBarOrientation(void) { BOOL isLandscape = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation); SDL_VideoDisplay *display = SDL_GetDisplay(0); diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 324a86103..b4f5982a6 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -230,7 +230,7 @@ CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen) return frame; } -void UIKit_ForceUpdateHomeIndicator() +void UIKit_ForceUpdateHomeIndicator(void) { #if !TARGET_OS_TV /* Force the main SDL window to re-evaluate home indicator state */