Fixed Xcode warnings

This commit is contained in:
Sam Lantinga 2024-01-13 08:15:41 -08:00
parent 5db6eb7742
commit b6e97d9ff0
21 changed files with 39 additions and 39 deletions

View file

@ -1052,7 +1052,7 @@ int SDL_AudioInit(const char *driver_name)
/* /*
* Get the current audio driver name * Get the current audio driver name
*/ */
const char *SDL_GetCurrentAudioDriver() const char *SDL_GetCurrentAudioDriver(void)
{ {
return current_audio.name; return current_audio.name;
} }

View file

@ -1438,7 +1438,7 @@ static int PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
return 0; return 0;
} }
static WaveRiffSizeHint WaveGetRiffSizeHint() static WaveRiffSizeHint WaveGetRiffSizeHint(void)
{ {
const char *hint = SDL_GetHint(SDL_HINT_WAVE_RIFF_CHUNK_SIZE); const char *hint = SDL_GetHint(SDL_HINT_WAVE_RIFF_CHUNK_SIZE);
@ -1457,7 +1457,7 @@ static WaveRiffSizeHint WaveGetRiffSizeHint()
return RiffSizeNoHint; return RiffSizeNoHint;
} }
static WaveTruncationHint WaveGetTruncationHint() static WaveTruncationHint WaveGetTruncationHint(void)
{ {
const char *hint = SDL_GetHint(SDL_HINT_WAVE_TRUNCATION); const char *hint = SDL_GetHint(SDL_HINT_WAVE_TRUNCATION);
@ -1476,7 +1476,7 @@ static WaveTruncationHint WaveGetTruncationHint()
return TruncNoHint; return TruncNoHint;
} }
static WaveFactChunkHint WaveGetFactChunkHint() static WaveFactChunkHint WaveGetFactChunkHint(void)
{ {
const char *hint = SDL_GetHint(SDL_HINT_WAVE_FACT_CHUNK); const char *hint = SDL_GetHint(SDL_HINT_WAVE_FACT_CHUNK);

View file

@ -293,7 +293,7 @@ static SDL_AudioDevice **open_devices;
static BOOL session_active = NO; static BOOL session_active = NO;
static void pause_audio_devices() static void pause_audio_devices(void)
{ {
int i; int i;
@ -309,7 +309,7 @@ static void pause_audio_devices()
} }
} }
static void resume_audio_devices() static void resume_audio_devices(void)
{ {
int i; int i;

View file

@ -740,7 +740,7 @@ static void SDL_CutEvent(SDL_EventEntry *entry)
SDL_AtomicAdd(&SDL_EventQ.count, -1); SDL_AtomicAdd(&SDL_EventQ.count, -1);
} }
static int SDL_SendWakeupEvent() static int SDL_SendWakeupEvent(void)
{ {
SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_VideoDevice *_this = SDL_GetVideoDevice();
if (_this == NULL || !_this->SendWakeupEvent) { 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); SDL_PumpEventsInternal(SDL_FALSE);
} }
@ -967,7 +967,7 @@ int SDL_PollEvent(SDL_Event *event)
return SDL_WaitEventTimeout(event, 0); 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; 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; return 0;
} }
static SDL_bool SDL_events_need_polling() static SDL_bool SDL_events_need_polling(void)
{ {
SDL_bool need_polling = SDL_FALSE; SDL_bool need_polling = SDL_FALSE;

View file

@ -110,7 +110,7 @@ int SDL_RecordGesture(SDL_TouchID touchId)
return touchId < 0; return touchId < 0;
} }
void SDL_GestureQuit() void SDL_GestureQuit(void)
{ {
SDL_free(SDL_gestureTouch); SDL_free(SDL_gestureTouch);
SDL_gestureTouch = NULL; SDL_gestureTouch = NULL;

View file

@ -1178,7 +1178,7 @@ int SDL_SetRelativeMouseMode(SDL_bool enabled)
return 0; return 0;
} }
SDL_bool SDL_GetRelativeMouseMode() SDL_bool SDL_GetRelativeMouseMode(void)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();

View file

@ -220,7 +220,7 @@ static int StrIsInteger(const char *string)
} }
#endif /* HAVE_INOTIFY */ #endif /* HAVE_INOTIFY */
static void HIDAPI_InitializeDiscovery() static void HIDAPI_InitializeDiscovery(void)
{ {
SDL_HIDAPI_discovery.m_bInitialized = SDL_TRUE; SDL_HIDAPI_discovery.m_bInitialized = SDL_TRUE;
SDL_HIDAPI_discovery.m_unDeviceChangeCounter = 1; 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) { if (!SDL_HIDAPI_discovery.m_bInitialized) {
HIDAPI_InitializeDiscovery(); 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) { if (!SDL_HIDAPI_discovery.m_bInitialized) {
return; return;

View file

@ -475,7 +475,7 @@ typedef enum
// Core Bluetooth devices calling back on event boundaries of their run-loops. so annoying. // 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; CFRunLoopRunResult res;
do do

View file

@ -1849,7 +1849,7 @@ char *SDL_GameControllerMapping(SDL_GameController *gamecontroller)
return retval; return retval;
} }
static void SDL_GameControllerLoadHints() static void SDL_GameControllerLoadHints(void)
{ {
const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG); const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG);
if (hint && hint[0]) { if (hint && hint[0]) {

View file

@ -492,7 +492,7 @@ static SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriv
return SDL_FALSE; return SDL_FALSE;
} }
static int SDL_FindFreePlayerIndex() static int SDL_FindFreePlayerIndex(void)
{ {
int player_index; int player_index;
@ -658,7 +658,7 @@ int SDL_NumJoysticks(void)
* Return the next available joystick instance ID * Return the next available joystick instance ID
* This may be called by drivers from multiple threads, unprotected by any locks * 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); return SDL_AtomicIncRef(&SDL_next_joystick_instance_id);
} }
@ -1663,7 +1663,7 @@ void SDL_JoystickQuit(void)
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
} }
static SDL_bool SDL_PrivateJoystickShouldIgnoreEvent() static SDL_bool SDL_PrivateJoystickShouldIgnoreEvent(void)
{ {
if (SDL_joystick_allows_background_events) { if (SDL_joystick_allows_background_events) {
return SDL_FALSE; return SDL_FALSE;

View file

@ -892,7 +892,7 @@ static SDL_INLINE void VerifyDrawQueueFunctions(const SDL_Renderer *renderer)
SDL_assert(renderer->RunCommandQueue != NULL); 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); const char *hint = SDL_GetHint(SDL_HINT_RENDER_LINE_METHOD);

View file

@ -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"); const char *texcoord_hint = SDL_GetHint("SDL_RENDER_OPENGLES2_TEXCOORD_PRECISION");
GLES2_ShaderIncludeType value = GLES2_SHADER_FRAGMENT_INCLUDE_BEST_TEXCOORD_PRECISION; GLES2_ShaderIncludeType value = GLES2_SHADER_FRAGMENT_INCLUDE_BEST_TEXCOORD_PRECISION;

View file

@ -108,7 +108,7 @@ int SDL_NumSensors(void)
* Return the next available sensor instance ID * Return the next available sensor instance ID
* This may be called by drivers from multiple threads, unprotected by any locks * 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); return SDL_AtomicIncRef(&SDL_next_sensor_instance_id);
} }

View file

@ -28,7 +28,7 @@
#include "SDL_hints.h" #include "SDL_hints.h"
#include "../SDL_error_c.h" #include "../SDL_error_c.h"
SDL_TLSID SDL_TLSCreate() SDL_TLSID SDL_TLSCreate(void)
{ {
static SDL_atomic_t SDL_tls_id; static SDL_atomic_t SDL_tls_id;
return SDL_AtomicIncRef(&SDL_tls_id) + 1; 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; return 0;
} }
void SDL_TLSCleanup() void SDL_TLSCleanup(void)
{ {
SDL_TLSData *storage; SDL_TLSData *storage;
@ -193,7 +193,7 @@ int SDL_Generic_SetTLSData(SDL_TLSData *data)
} }
/* Non-thread-safe global error variable */ /* Non-thread-safe global error variable */
static SDL_error *SDL_GetStaticErrBuf() static SDL_error *SDL_GetStaticErrBuf(void)
{ {
static SDL_error SDL_global_error; static SDL_error SDL_global_error;
static char SDL_global_error_str[128]; static char SDL_global_error_str[128];

View file

@ -116,7 +116,7 @@ static SDL_bool SDL_UseAltivecPrefetch()
} }
} }
#else #else
static SDL_bool SDL_UseAltivecPrefetch() static SDL_bool SDL_UseAltivecPrefetch(void)
{ {
/* Just guess G4 */ /* Just guess G4 */
return SDL_TRUE; return SDL_TRUE;

View file

@ -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) #if defined(HAVE_NEON_INTRINSICS)
static SDL_INLINE int hasNEON() static SDL_INLINE int hasNEON(void)
{ {
static int val = -1; static int val = -1;
if (val != -1) { if (val != -1) {

View file

@ -407,7 +407,7 @@ static int SDLCALL cmpmodes(const void *A, const void *B)
return 0; return 0;
} }
static int SDL_UninitializedVideo() static int SDL_UninitializedVideo(void)
{ {
return SDL_SetError("Video subsystem has not been initialized"); return SDL_SetError("Video subsystem has not been initialized");
} }
@ -595,7 +595,7 @@ pre_driver_error:
return -1; return -1;
} }
const char *SDL_GetCurrentVideoDriver() const char *SDL_GetCurrentVideoDriver(void)
{ {
if (!_this) { if (!_this) {
SDL_UninitializedVideo(); SDL_UninitializedVideo();
@ -609,7 +609,7 @@ SDL_VideoDevice *SDL_GetVideoDevice(void)
return _this; return _this;
} }
SDL_bool SDL_OnVideoThread() SDL_bool SDL_OnVideoThread(void)
{ {
return (_this && SDL_ThreadID() == _this->thread) ? SDL_TRUE : SDL_FALSE; return (_this && SDL_ThreadID() == _this->thread) ? SDL_TRUE : SDL_FALSE;
} }
@ -3336,7 +3336,7 @@ void SDL_DestroyWindow(SDL_Window *window)
SDL_free(window); SDL_free(window);
} }
SDL_bool SDL_IsScreenSaverEnabled() SDL_bool SDL_IsScreenSaverEnabled(void)
{ {
if (!_this) { if (!_this) {
return SDL_TRUE; return SDL_TRUE;
@ -3344,7 +3344,7 @@ SDL_bool SDL_IsScreenSaverEnabled()
return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE; return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE;
} }
void SDL_EnableScreenSaver() void SDL_EnableScreenSaver(void)
{ {
if (!_this) { if (!_this) {
return; return;
@ -3358,7 +3358,7 @@ void SDL_EnableScreenSaver()
} }
} }
void SDL_DisableScreenSaver() void SDL_DisableScreenSaver(void)
{ {
if (!_this) { if (!_this) {
return; return;
@ -3600,7 +3600,7 @@ void SDL_GL_DeduceMaxSupportedESProfile(int *major, int *minor)
#endif #endif
} }
void SDL_GL_ResetAttributes() void SDL_GL_ResetAttributes(void)
{ {
if (!_this) { if (!_this) {
return; return;

View file

@ -40,7 +40,7 @@ void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)
SDL_YUV_ConversionMode = mode; SDL_YUV_ConversionMode = mode;
} }
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode() SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void)
{ {
return SDL_YUV_ConversionMode; return SDL_YUV_ConversionMode;
} }

View file

@ -283,7 +283,7 @@ static void UpdateScrollDirection(void)
#endif #endif
} }
static void UpdatePointerLock() static void UpdatePointerLock(void)
{ {
SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_VideoDevice *_this = SDL_GetVideoDevice();
SDL_Window *window; SDL_Window *window;

View file

@ -517,7 +517,7 @@ void UIKit_QuitModes(_THIS)
} }
#if !TARGET_OS_TV #if !TARGET_OS_TV
void SDL_OnApplicationDidChangeStatusBarOrientation() void SDL_OnApplicationDidChangeStatusBarOrientation(void)
{ {
BOOL isLandscape = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation); BOOL isLandscape = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation);
SDL_VideoDisplay *display = SDL_GetDisplay(0); SDL_VideoDisplay *display = SDL_GetDisplay(0);

View file

@ -230,7 +230,7 @@ CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen)
return frame; return frame;
} }
void UIKit_ForceUpdateHomeIndicator() void UIKit_ForceUpdateHomeIndicator(void)
{ {
#if !TARGET_OS_TV #if !TARGET_OS_TV
/* Force the main SDL window to re-evaluate home indicator state */ /* Force the main SDL window to re-evaluate home indicator state */