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
*/
const char *SDL_GetCurrentAudioDriver()
const char *SDL_GetCurrentAudioDriver(void)
{
return current_audio.name;
}

View file

@ -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);

View file

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

View file

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

View file

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

View file

@ -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();

View file

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

View file

@ -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

View file

@ -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]) {

View file

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

View file

@ -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);

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");
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
* 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);
}

View file

@ -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];

View file

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

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

View file

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

View file

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

View file

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

View file

@ -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);

View file

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