Browse Source

Fixed Xcode warnings

Sam Lantinga 1 year ago
parent
commit
b6e97d9ff0

+ 1 - 1
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;
 }

+ 3 - 3
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);
 

+ 2 - 2
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;
 

+ 4 - 4
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;
 

+ 1 - 1
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;

+ 1 - 1
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();
 

+ 3 - 3
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;

+ 1 - 1
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

+ 1 - 1
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]) {

+ 3 - 3
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;

+ 1 - 1
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);
 

+ 1 - 1
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;

+ 1 - 1
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);
 }

+ 3 - 3
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];

+ 1 - 1
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;

+ 1 - 1
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) {

+ 7 - 7
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;

+ 1 - 1
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;
 }

+ 1 - 1
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;

+ 1 - 1
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);

+ 1 - 1
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 */