diff --git a/src/SDL.c b/src/SDL.c index e1daed6be..2d1260fdc 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -537,15 +537,13 @@ int SDL_GetVersion(SDL_version *ver) } /* Get the library source revision */ -const char * -SDL_GetRevision(void) +const char *SDL_GetRevision(void) { return SDL_REVISION; } /* Get the name of the platform */ -const char * -SDL_GetPlatform(void) +const char *SDL_GetPlatform(void) { #ifdef __AIX__ return "AIX"; @@ -616,8 +614,7 @@ SDL_GetPlatform(void) #endif } -SDL_bool -SDL_IsTablet(void) +SDL_bool SDL_IsTablet(void) { #ifdef __ANDROID__ extern SDL_bool SDL_IsAndroidTablet(void); @@ -635,9 +632,7 @@ SDL_IsTablet(void) #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB) /* Need to include DllMain() on Watcom C for some reason.. */ -BOOL APIENTRY -_DllMainCRTStartup(HANDLE hModule, - DWORD ul_reason_for_call, LPVOID lpReserved) +BOOL APIENTRY _DllMainCRTStartup(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: diff --git a/src/SDL_assert.c b/src/SDL_assert.c index 8cca6d6ac..50ac16572 100644 --- a/src/SDL_assert.c +++ b/src/SDL_assert.c @@ -318,9 +318,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v return state; } -SDL_AssertState -SDL_ReportAssertion(SDL_AssertData *data, const char *func, const char *file, - int line) +SDL_AssertState SDL_ReportAssertion(SDL_AssertData *data, const char *func, const char *file, int line) { SDL_AssertState state = SDL_ASSERTION_IGNORE; static int assertion_running = 0; diff --git a/src/SDL_dataqueue.c b/src/SDL_dataqueue.c index f73ee0e9a..4b3b79c94 100644 --- a/src/SDL_dataqueue.c +++ b/src/SDL_dataqueue.c @@ -49,8 +49,7 @@ static void SDL_FreeDataQueueList(SDL_DataQueuePacket *packet) } } -SDL_DataQueue * -SDL_CreateDataQueue(const size_t _packetlen, const size_t initialslack) +SDL_DataQueue *SDL_CreateDataQueue(const size_t _packetlen, const size_t initialslack) { SDL_DataQueue *queue = (SDL_DataQueue *)SDL_calloc(1, sizeof(SDL_DataQueue)); @@ -230,8 +229,7 @@ int SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *_data, const size_t _ return 0; } -size_t -SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) +size_t SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) { size_t len = _len; Uint8 *buf = (Uint8 *)_buf; @@ -259,8 +257,7 @@ SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) return (size_t)(ptr - buf); } -size_t -SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) +size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) { size_t len = _len; Uint8 *buf = (Uint8 *)_buf; @@ -303,8 +300,7 @@ SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) return (size_t)(ptr - buf); } -size_t -SDL_GetDataQueueSize(SDL_DataQueue *queue) +size_t SDL_GetDataQueueSize(SDL_DataQueue *queue) { size_t retval = 0; if (queue) { @@ -315,8 +311,7 @@ SDL_GetDataQueueSize(SDL_DataQueue *queue) return retval; } -SDL_Mutex * -SDL_GetDataQueueMutex(SDL_DataQueue *queue) +SDL_Mutex *SDL_GetDataQueueMutex(SDL_DataQueue *queue) { return queue ? queue->lock : NULL; } diff --git a/src/SDL_error.c b/src/SDL_error.c index 238c50f77..00f1bcf7d 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -60,8 +60,7 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) } /* Available for backwards compatibility */ -const char * -SDL_GetError(void) +const char *SDL_GetError(void) { const SDL_error *error = SDL_GetErrBuf(); return error->error ? error->str : ""; @@ -91,8 +90,7 @@ int SDL_Error(SDL_errorcode code) } } -char * -SDL_GetErrorMsg(char *errstr, int maxlen) +char *SDL_GetErrorMsg(char *errstr, int maxlen) { const SDL_error *error = SDL_GetErrBuf(); diff --git a/src/SDL_hints.c b/src/SDL_hints.c index 85eda0a68..42e61ccf7 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -43,9 +43,7 @@ typedef struct SDL_Hint static SDL_Hint *SDL_hints; -SDL_bool -SDL_SetHintWithPriority(const char *name, const char *value, - SDL_HintPriority priority) +SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority) { const char *env; SDL_Hint *hint; @@ -95,8 +93,7 @@ SDL_SetHintWithPriority(const char *name, const char *value, return SDL_TRUE; } -SDL_bool -SDL_ResetHint(const char *name) +SDL_bool SDL_ResetHint(const char *name) { const char *env; SDL_Hint *hint; @@ -152,14 +149,12 @@ void SDL_ResetHints(void) } } -SDL_bool -SDL_SetHint(const char *name, const char *value) +SDL_bool SDL_SetHint(const char *name, const char *value) { return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL); } -const char * -SDL_GetHint(const char *name) +const char *SDL_GetHint(const char *name) { const char *env; SDL_Hint *hint; @@ -176,8 +171,7 @@ SDL_GetHint(const char *name) return env; } -SDL_bool -SDL_GetStringBoolean(const char *value, SDL_bool default_value) +SDL_bool SDL_GetStringBoolean(const char *value, SDL_bool default_value) { if (value == NULL || !*value) { return default_value; @@ -188,8 +182,7 @@ SDL_GetStringBoolean(const char *value, SDL_bool default_value) return SDL_TRUE; } -SDL_bool -SDL_GetHintBoolean(const char *name, SDL_bool default_value) +SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value) { const char *hint = SDL_GetHint(name); return SDL_GetStringBoolean(hint, default_value); diff --git a/src/SDL_log.c b/src/SDL_log.c index 25eb60b62..214574e34 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -160,8 +160,7 @@ void SDL_LogSetPriority(int category, SDL_LogPriority priority) } } -SDL_LogPriority -SDL_LogGetPriority(int category) +SDL_LogPriority SDL_LogGetPriority(int category) { SDL_LogLevel *entry; diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index 3e57a48cf..6b1b0f4c6 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -122,8 +122,7 @@ static SDL_INLINE void leaveLock(void *a) } #endif -SDL_bool -SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval) +SDL_bool SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval) { #ifdef HAVE_MSC_ATOMICS SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value)); @@ -152,8 +151,7 @@ SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval) #endif } -SDL_bool -SDL_AtomicCASPtr(void **a, void *oldval, void *newval) +SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval) { #ifdef HAVE_MSC_ATOMICS return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval; diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index f9d436816..d4eaff41c 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -57,8 +57,7 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v); /* *INDENT-ON* */ /* clang-format on */ /* This function is where all the magic happens... */ -SDL_bool -SDL_AtomicTryLock(SDL_SpinLock *lock) +SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock) { #ifdef SDL_ATOMIC_DISABLED /* Terrible terrible damage */ diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 99c26d406..09abb24cf 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -789,8 +789,7 @@ int SDL_GetNumAudioDrivers(void) return SDL_arraysize(bootstrap) - 1; } -const char * -SDL_GetAudioDriver(int index) +const char *SDL_GetAudioDriver(int index) { if (index >= 0 && index < SDL_GetNumAudioDrivers()) { return bootstrap[index]->name; @@ -893,8 +892,7 @@ int SDL_InitAudio(const char *driver_name) /* * Get the current audio driver name */ -const char * -SDL_GetCurrentAudioDriver(void) +const char *SDL_GetCurrentAudioDriver(void) { return current_audio.name; } @@ -954,8 +952,7 @@ int SDL_GetNumAudioDevices(int iscapture) return retval; } -const char * -SDL_GetAudioDeviceName(int index, int iscapture) +const char *SDL_GetAudioDeviceName(int index, int iscapture) { SDL_AudioDeviceItem *item; int i; @@ -1412,8 +1409,7 @@ static SDL_AudioDeviceID open_audio_device(const char *devname, int iscapture, return device->id; } -SDL_AudioDeviceID -SDL_OpenAudioDevice(const char *device, int iscapture, +SDL_AudioDeviceID SDL_OpenAudioDevice(const char *device, int iscapture, const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, int allowed_changes) { @@ -1421,8 +1417,7 @@ SDL_OpenAudioDevice(const char *device, int iscapture, allowed_changes, 2); } -SDL_AudioStatus -SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) +SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) { SDL_AudioDevice *device = get_audio_device(devid); SDL_AudioStatus status = SDL_AUDIO_STOPPED; diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index e66d31350..8c3badcb4 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -602,8 +602,7 @@ static int SetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioFormat src_for return 0; } -SDL_AudioStream * -SDL_CreateAudioStream(SDL_AudioFormat src_format, +SDL_AudioStream *SDL_CreateAudioStream(SDL_AudioFormat src_format, int src_channels, int src_rate, SDL_AudioFormat dst_format, diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index fb5e91ff4..d7e6ac3c3 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -2075,8 +2075,7 @@ static int WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 * return 0; } -SDL_AudioSpec * -SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) +SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) { int result; WaveFile file; diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c index 98b5d7b5b..af6ffde02 100644 --- a/src/audio/pipewire/SDL_pipewire.c +++ b/src/audio/pipewire/SDL_pipewire.c @@ -202,7 +202,7 @@ static int load_pipewire_syms(void) return 0; } -SDL_FORCE_INLINE SDL_bool pipewire_version_at_least(int major, int minor, int patch) +static SDL_bool pipewire_version_at_least(int major, int minor, int patch) { return (pipewire_version_major >= major) && (pipewire_version_major > major || pipewire_version_minor >= minor) && diff --git a/src/audio/qnx/SDL_qsa_audio.c b/src/audio/qnx/SDL_qsa_audio.c index 63b9db5a3..11ec7b441 100644 --- a/src/audio/qnx/SDL_qsa_audio.c +++ b/src/audio/qnx/SDL_qsa_audio.c @@ -73,15 +73,13 @@ uint32_t qsa_playback_devices; QSA_Device qsa_capture_device[QSA_MAX_DEVICES]; uint32_t qsa_capture_devices; -static SDL_INLINE int -QSA_SetError(const char *fn, int status) +static int QSA_SetError(const char *fn, int status) { return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status)); } /* !!! FIXME: does this need to be here? Does the SDL version not work? */ -static void -QSA_ThreadInit(SDL_AudioDevice *_this) +static void QSA_ThreadInit(SDL_AudioDevice *_this) { /* Increase default 10 priority to 25 to avoid jerky sound */ struct sched_param param; @@ -92,8 +90,7 @@ QSA_ThreadInit(SDL_AudioDevice *_this) } /* PCM channel parameters initialize function */ -static void -QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) +static void QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) { SDL_zerop(cpars); cpars->channel = SND_PCM_CHANNEL_PLAYBACK; @@ -110,8 +107,7 @@ QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) } /* This function waits until it is possible to write a full sound buffer */ -static void -QSA_WaitDevice(SDL_AudioDevice *_this) +static void QSA_WaitDevice(SDL_AudioDevice *_this) { int result; @@ -136,8 +132,7 @@ QSA_WaitDevice(SDL_AudioDevice *_this) } } -static void -QSA_PlayDevice(SDL_AudioDevice *_this) +static void QSA_PlayDevice(SDL_AudioDevice *_this) { snd_pcm_channel_status_t cstatus; int written; @@ -229,14 +224,12 @@ QSA_PlayDevice(SDL_AudioDevice *_this) } } -static Uint8 * -QSA_GetDeviceBuf(SDL_AudioDevice *_this) +static Uint8 *QSA_GetDeviceBuf(SDL_AudioDevice *_this) { return _this->hidden->pcm_buf; } -static void -QSA_CloseDevice(SDL_AudioDevice *_this) +static void QSA_CloseDevice(SDL_AudioDevice *_this) { if (_this->hidden->audio_handle != NULL) { #if _NTO_VERSION < 710 @@ -257,8 +250,7 @@ QSA_CloseDevice(SDL_AudioDevice *_this) SDL_free(_this->hidden); } -static int -QSA_OpenDevice(SDL_AudioDevice *_this, const char *devname) +static int QSA_OpenDevice(SDL_AudioDevice *_this, const char *devname) { #if 0 /* !!! FIXME: SDL2 used to pass this handle. What's the alternative? */ @@ -426,8 +418,7 @@ QSA_OpenDevice(SDL_AudioDevice *_this, const char *devname) return 0; } -static void -QSA_DetectDevices(void) +static void QSA_DetectDevices(void) { uint32_t it; uint32_t cards; @@ -572,8 +563,7 @@ QSA_DetectDevices(void) } } -static void -QSA_Deinitialize(void) +static void QSA_Deinitialize(void) { /* Clear devices array on shutdown */ /* !!! FIXME: we zero these on init...any reason to do it here? */ @@ -583,8 +573,7 @@ QSA_Deinitialize(void) qsa_capture_devices = 0; } -static SDL_bool -QSA_Init(SDL_AudioDriverImpl * impl) +static SDL_bool QSA_Init(SDL_AudioDriverImpl * impl) { /* Clear devices array */ SDL_zeroa(qsa_playback_device); diff --git a/src/core/freebsd/SDL_evdev_kbd_freebsd.c b/src/core/freebsd/SDL_evdev_kbd_freebsd.c index b641ee249..fb71cc086 100644 --- a/src/core/freebsd/SDL_evdev_kbd_freebsd.c +++ b/src/core/freebsd/SDL_evdev_kbd_freebsd.c @@ -220,8 +220,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd) } } -SDL_EVDEV_keyboard_state * -SDL_EVDEV_kbd_init(void) +SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void) { SDL_EVDEV_keyboard_state *kbd; struct mouse_info mData; diff --git a/src/core/haiku/SDL_BeApp.cc b/src/core/haiku/SDL_BeApp.cc index 0dff28ffd..16eb58aff 100644 --- a/src/core/haiku/SDL_BeApp.cc +++ b/src/core/haiku/SDL_BeApp.cc @@ -104,8 +104,7 @@ static int StartBeApp(void *unused) } -static int -StartBeLooper() +static int StartBeLooper() { if (!be_app) { SDL_AppThread = SDL_CreateThreadInternal(StartBeApp, "SDLApplication", 0, NULL); @@ -140,8 +139,7 @@ StartBeLooper() /* Initialize the Be Application, if it's not already started */ -int -SDL_InitBeApp(void) +int SDL_InitBeApp(void) { /* Create the BApplication that handles appserver interaction */ if (SDL_BeAppActive <= 0) { @@ -159,8 +157,7 @@ SDL_InitBeApp(void) } /* Quit the Be Application, if there's nothing left to do */ -void -SDL_QuitBeApp(void) +void SDL_QuitBeApp(void) { /* Decrement the application reference count */ --SDL_BeAppActive; diff --git a/src/core/linux/SDL_dbus.c b/src/core/linux/SDL_dbus.c index 81cbd290d..970af56b0 100644 --- a/src/core/linux/SDL_dbus.c +++ b/src/core/linux/SDL_dbus.c @@ -190,8 +190,7 @@ void SDL_DBus_Quit(void) inhibit_handle = NULL; } -SDL_DBusContext * -SDL_DBus_GetContext(void) +SDL_DBusContext *SDL_DBus_GetContext(void) { if (dbus_handle == NULL || !dbus.session_conn) { SDL_DBus_Init(); @@ -243,8 +242,7 @@ static SDL_bool SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *no return retval; } -SDL_bool -SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -254,8 +252,7 @@ SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const ch return retval; } -SDL_bool -SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -312,8 +309,7 @@ static SDL_bool SDL_DBus_CallWithBasicReply(DBusConnection *conn, DBusMessage *m return retval; } -SDL_bool -SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -323,8 +319,7 @@ SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, cons return retval; } -SDL_bool -SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -334,8 +329,7 @@ SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interfac return retval; } -SDL_bool -SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) +SDL_bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) { SDL_bool retval = SDL_FALSE; @@ -352,8 +346,7 @@ SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const return retval; } -SDL_bool -SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) +SDL_bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) { return SDL_DBus_QueryPropertyOnConnection(dbus.session_conn, node, path, interface, property, expectedtype, result); } @@ -404,8 +397,7 @@ failed: return SDL_FALSE; } -SDL_bool -SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) +SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) { const char *default_inhibit_reason = "Playing a game"; diff --git a/src/core/linux/SDL_evdev_kbd.c b/src/core/linux/SDL_evdev_kbd.c index 026609b46..d82e08540 100644 --- a/src/core/linux/SDL_evdev_kbd.c +++ b/src/core/linux/SDL_evdev_kbd.c @@ -295,8 +295,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd) } } -SDL_EVDEV_keyboard_state * -SDL_EVDEV_kbd_init(void) +SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void) { SDL_EVDEV_keyboard_state *kbd; char flag_state; @@ -804,8 +803,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode #elif !defined(SDL_INPUT_FBSDKBIO) /* !SDL_INPUT_LINUXKD */ -SDL_EVDEV_keyboard_state * -SDL_EVDEV_kbd_init(void) +SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void) { return NULL; } diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 43e09d722..54addf582 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -81,8 +81,7 @@ static char *GetAppName(void) return SDL_strdup("SDL_App"); } -static size_t -Fcitx_GetPreeditString(SDL_DBusContext *dbus, +static size_t Fcitx_GetPreeditString(SDL_DBusContext *dbus, DBusMessage *msg, char **ret, Sint32 *start_pos, @@ -367,8 +366,7 @@ static Uint32 Fcitx_ModState(void) return fcitx_mods; } -SDL_bool -SDL_Fcitx_Init(void) +SDL_bool SDL_Fcitx_Init(void) { fcitx_client.dbus = SDL_DBus_GetContext(); @@ -404,8 +402,7 @@ void SDL_Fcitx_Reset(void) FcitxClientICCallMethod(&fcitx_client, "CloseIC"); } -SDL_bool -SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) +SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) { Uint32 mod_state = Fcitx_ModState(); Uint32 handled = SDL_FALSE; diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 5d97c5840..4b5d4bbe0 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -556,8 +556,7 @@ static SDL_bool IBus_CheckConnection(SDL_DBusContext *dbus) return SDL_FALSE; } -SDL_bool -SDL_IBus_Init(void) +SDL_bool SDL_IBus_Init(void) { SDL_bool result = SDL_FALSE; SDL_DBusContext *dbus = SDL_DBus_GetContext(); @@ -672,8 +671,7 @@ void SDL_IBus_Reset(void) IBus_SimpleMessage("Reset"); } -SDL_bool -SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) +SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) { Uint32 result = 0; SDL_DBusContext *dbus = SDL_DBus_GetContext(); diff --git a/src/core/linux/SDL_ime.c b/src/core/linux/SDL_ime.c index 873709b05..45bc1c6c6 100644 --- a/src/core/linux/SDL_ime.c +++ b/src/core/linux/SDL_ime.c @@ -83,8 +83,7 @@ static void InitIME(void) #endif /* HAVE_IBUS_IBUS_H */ } -SDL_bool -SDL_IME_Init(void) +SDL_bool SDL_IME_Init(void) { InitIME(); @@ -127,8 +126,7 @@ void SDL_IME_Reset(void) } } -SDL_bool -SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) +SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) { if (SDL_IME_ProcessKeyEvent_Real) { return SDL_IME_ProcessKeyEvent_Real(keysym, keycode, state); diff --git a/src/core/linux/SDL_system_theme.c b/src/core/linux/SDL_system_theme.c index 4af1b0e7b..89077a039 100644 --- a/src/core/linux/SDL_system_theme.c +++ b/src/core/linux/SDL_system_theme.c @@ -44,8 +44,7 @@ typedef struct SystemThemeData static SystemThemeData system_theme_data; -static SDL_bool -DBus_ExtractThemeVariant(DBusMessageIter *iter, SDL_SystemTheme *theme) { +static SDL_bool DBus_ExtractThemeVariant(DBusMessageIter *iter, SDL_SystemTheme *theme) { SDL_DBusContext *dbus = system_theme_data.dbus; Uint32 color_scheme; DBusMessageIter variant_iter; @@ -70,8 +69,7 @@ DBus_ExtractThemeVariant(DBusMessageIter *iter, SDL_SystemTheme *theme) { return SDL_TRUE; } -static DBusHandlerResult -DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data) { +static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data) { SDL_DBusContext *dbus = (SDL_DBusContext *)data; if (dbus->message_is_signal(msg, SIGNAL_INTERFACE, SIGNAL_NAME)) { @@ -108,14 +106,13 @@ not_our_signal: return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -SDL_bool -SDL_SystemTheme_Init(void) +SDL_bool SDL_SystemTheme_Init(void) { SDL_DBusContext *dbus = SDL_DBus_GetContext(); DBusMessage *msg; static const char *namespace = SIGNAL_NAMESPACE; static const char *key = SIGNAL_KEY; - + system_theme_data.theme = SDL_SYSTEM_THEME_UNKNOWN; system_theme_data.dbus = dbus; if (dbus == NULL) { @@ -153,8 +150,7 @@ incorrect_type: return SDL_TRUE; } -SDL_SystemTheme -SDL_SystemTheme_Get(void) +SDL_SystemTheme SDL_SystemTheme_Get(void) { return system_theme_data.theme; } diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c index 541de815b..973e2da9d 100644 --- a/src/core/linux/SDL_udev.c +++ b/src/core/linux/SDL_udev.c @@ -215,8 +215,7 @@ int SDL_UDEV_Scan(void) return 0; } -SDL_bool -SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version) +SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version) { struct udev_enumerate *enumerate = NULL; struct udev_list_entry *devs = NULL; @@ -543,8 +542,7 @@ void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb) } } -const SDL_UDEV_Symbols * -SDL_UDEV_GetUdevSyms(void) +const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void) { if (SDL_UDEV_Init() < 0) { SDL_SetError("Could not initialize UDEV"); diff --git a/src/core/windows/SDL_immdevice.c b/src/core/windows/SDL_immdevice.c index 633d1e12c..12424d559 100644 --- a/src/core/windows/SDL_immdevice.c +++ b/src/core/windows/SDL_immdevice.c @@ -505,8 +505,7 @@ int SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int isca return 0; } -SDL_AudioFormat -WaveFormatToSDLFormat(WAVEFORMATEX *waveformat) +SDL_AudioFormat WaveFormatToSDLFormat(WAVEFORMATEX *waveformat) { if ((waveformat->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) && (waveformat->wBitsPerSample == 32)) { return SDL_AUDIO_F32SYS; diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c index 918b1754d..c18bd642c 100644 --- a/src/core/windows/SDL_windows.c +++ b/src/core/windows/SDL_windows.c @@ -245,8 +245,7 @@ has the same problem.) WASAPI doesn't need this. This is just for DirectSound/WinMM. */ -char * -WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) +char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) { #if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) return WIN_StringToUTF8(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */ @@ -343,15 +342,13 @@ BOOL WIN_IsRectEmpty(const RECT *rect) #include /* CommandLineToArgvW() */ /* Pop up an out of memory message, returns to Windows */ -static int -OutOfMemory(void) +static int OutOfMemory(void) { SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL); return -1; } -DECLSPEC int -SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved) +DECLSPEC int SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved) { /* Gets the arguments with GetCommandLine, converts them to argc and argv diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index ec2f45aa7..cb39b0117 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -928,86 +928,72 @@ static Uint32 SDL_GetCPUFeatures(void) #define CPU_FEATURE_AVAILABLE(f) ((SDL_GetCPUFeatures() & (f)) ? SDL_TRUE : SDL_FALSE) -SDL_bool -SDL_HasAltiVec(void) +SDL_bool SDL_HasAltiVec(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_ALTIVEC); } -SDL_bool -SDL_HasMMX(void) +SDL_bool SDL_HasMMX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_MMX); } -SDL_bool -SDL_HasSSE(void) +SDL_bool SDL_HasSSE(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE); } -SDL_bool -SDL_HasSSE2(void) +SDL_bool SDL_HasSSE2(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE2); } -SDL_bool -SDL_HasSSE3(void) +SDL_bool SDL_HasSSE3(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE3); } -SDL_bool -SDL_HasSSE41(void) +SDL_bool SDL_HasSSE41(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE41); } -SDL_bool -SDL_HasSSE42(void) +SDL_bool SDL_HasSSE42(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE42); } -SDL_bool -SDL_HasAVX(void) +SDL_bool SDL_HasAVX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX); } -SDL_bool -SDL_HasAVX2(void) +SDL_bool SDL_HasAVX2(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX2); } -SDL_bool -SDL_HasAVX512F(void) +SDL_bool SDL_HasAVX512F(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX512F); } -SDL_bool -SDL_HasARMSIMD(void) +SDL_bool SDL_HasARMSIMD(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_ARM_SIMD); } -SDL_bool -SDL_HasNEON(void) +SDL_bool SDL_HasNEON(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_NEON); } -SDL_bool -SDL_HasLSX(void) +SDL_bool SDL_HasLSX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_LSX); } -SDL_bool -SDL_HasLASX(void) +SDL_bool SDL_HasLASX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_LASX); } @@ -1089,8 +1075,7 @@ int SDL_GetSystemRAM(void) return SDL_SystemRAM; } -size_t -SDL_SIMDGetAlignment(void) +size_t SDL_SIMDGetAlignment(void) { if (SDL_SIMDAlignment == 0xFFFFFFFF) { SDL_GetCPUFeatures(); /* make sure this has been calculated */ diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 005812b7c..eb439ef39 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -643,8 +643,7 @@ static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = { }; /* Taken from SDL_iconv() */ -char * -SDL_UCS4ToUTF8(Uint32 ch, char *dst) +char *SDL_UCS4ToUTF8(Uint32 ch, char *dst) { Uint8 *p = (Uint8 *)dst; if (ch <= 0x7F) { @@ -759,8 +758,7 @@ void SDL_SetScancodeName(SDL_Scancode scancode, const char *name) SDL_scancode_names[scancode] = name; } -SDL_Window * -SDL_GetKeyboardFocus(void) +SDL_Window *SDL_GetKeyboardFocus(void) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -1029,8 +1027,7 @@ void SDL_ReleaseAutoReleaseKeys(void) } } -SDL_bool -SDL_HardwareKeyboardKeyPressed(void) +SDL_bool SDL_HardwareKeyboardKeyPressed(void) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; @@ -1110,8 +1107,7 @@ void SDL_QuitKeyboard(void) { } -const Uint8 * -SDL_GetKeyboardState(int *numkeys) +const Uint8 *SDL_GetKeyboardState(int *numkeys) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -1121,8 +1117,7 @@ SDL_GetKeyboardState(int *numkeys) return keyboard->keystate; } -SDL_Keymod -SDL_GetModState(void) +SDL_Keymod SDL_GetModState(void) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -1147,8 +1142,7 @@ void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle) } } -SDL_Keycode -SDL_GetKeyFromScancode(SDL_Scancode scancode) +SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -1160,8 +1154,7 @@ SDL_GetKeyFromScancode(SDL_Scancode scancode) return keyboard->keymap[scancode]; } -SDL_Keycode -SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) +SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) { if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { SDL_InvalidParamError("scancode"); @@ -1171,8 +1164,7 @@ SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) return SDL_default_keymap[scancode]; } -SDL_Scancode -SDL_GetScancodeFromKey(SDL_Keycode key) +SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; @@ -1186,8 +1178,7 @@ SDL_GetScancodeFromKey(SDL_Keycode key) return SDL_SCANCODE_UNKNOWN; } -const char * -SDL_GetScancodeName(SDL_Scancode scancode) +const char *SDL_GetScancodeName(SDL_Scancode scancode) { const char *name; if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { @@ -1225,8 +1216,7 @@ SDL_Scancode SDL_GetScancodeFromName(const char *name) return SDL_SCANCODE_UNKNOWN; } -const char * -SDL_GetKeyName(SDL_Keycode key) +const char *SDL_GetKeyName(SDL_Keycode key) { static char name[8]; char *end; @@ -1263,8 +1253,7 @@ SDL_GetKeyName(SDL_Keycode key) } } -SDL_Keycode -SDL_GetKeyFromName(const char *name) +SDL_Keycode SDL_GetKeyFromName(const char *name) { SDL_Keycode key; diff --git a/src/events/SDL_keysym_to_scancode.c b/src/events/SDL_keysym_to_scancode.c index 80e9dec70..a14cb60b7 100644 --- a/src/events/SDL_keysym_to_scancode.c +++ b/src/events/SDL_keysym_to_scancode.c @@ -387,8 +387,7 @@ static const struct { }; /* *INDENT-ON* */ /* clang-format on */ -SDL_Scancode -SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode) +SDL_Scancode SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode) { int i; Uint32 linux_keycode = 0; diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index f49aae91d..c805ff5c2 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -217,8 +217,7 @@ void SDL_SetDefaultCursor(SDL_Cursor *cursor) } } -SDL_Mouse * -SDL_GetMouse(void) +SDL_Mouse *SDL_GetMouse(void) { return &SDL_mouse; } @@ -236,8 +235,7 @@ static Uint32 GetButtonState(SDL_Mouse *mouse, SDL_bool include_touch) return buttonstate; } -SDL_Window * -SDL_GetMouseFocus(void) +SDL_Window *SDL_GetMouseFocus(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -252,8 +250,7 @@ SDL_GetMouseFocus(void) * -flibit */ #if 0 -void -SDL_ResetMouse(void) +void SDL_ResetMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); Uint32 buttonState = GetButtonState(mouse, SDL_FALSE); @@ -1069,8 +1066,7 @@ int SDL_SetRelativeMouseMode(SDL_bool enabled) return 0; } -SDL_bool -SDL_GetRelativeMouseMode(void) +SDL_bool SDL_GetRelativeMouseMode(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1155,9 +1151,7 @@ int SDL_CaptureMouse(SDL_bool enabled) return SDL_UpdateMouseCapture(SDL_FALSE); } -SDL_Cursor * -SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, - int w, int h, int hot_x, int hot_y) +SDL_Cursor *SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y) { SDL_Surface *surface; SDL_Cursor *cursor; @@ -1200,8 +1194,7 @@ SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, return cursor; } -SDL_Cursor * -SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) +SDL_Cursor *SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Surface *temp = NULL; @@ -1243,8 +1236,7 @@ SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) return cursor; } -SDL_Cursor * -SDL_CreateSystemCursor(SDL_SystemCursor id) +SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Cursor *cursor; @@ -1311,8 +1303,7 @@ int SDL_SetCursor(SDL_Cursor *cursor) return 0; } -SDL_Cursor * -SDL_GetCursor(void) +SDL_Cursor *SDL_GetCursor(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1322,8 +1313,7 @@ SDL_GetCursor(void) return mouse->cur_cursor; } -SDL_Cursor * -SDL_GetDefaultCursor(void) +SDL_Cursor *SDL_GetDefaultCursor(void) { SDL_Mouse *mouse = SDL_GetMouse(); diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index 223d39c22..d989a25e5 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -49,8 +49,7 @@ int SDL_GetNumTouchDevices(void) return SDL_num_touch; } -SDL_TouchID -SDL_GetTouchDevice(int index) +SDL_TouchID SDL_GetTouchDevice(int index) { if (index < 0 || index >= SDL_num_touch) { SDL_SetError("Unknown touch device index %d", index); @@ -59,8 +58,7 @@ SDL_GetTouchDevice(int index) return SDL_touchDevices[index]->id; } -const char * -SDL_GetTouchName(int index) +const char *SDL_GetTouchName(int index) { if (index < 0 || index >= SDL_num_touch) { SDL_SetError("Unknown touch device"); @@ -83,8 +81,7 @@ static int SDL_GetTouchIndex(SDL_TouchID id) return -1; } -SDL_Touch * -SDL_GetTouch(SDL_TouchID id) +SDL_Touch *SDL_GetTouch(SDL_TouchID id) { int index = SDL_GetTouchIndex(id); if (index < 0 || index >= SDL_num_touch) { @@ -99,8 +96,7 @@ SDL_GetTouch(SDL_TouchID id) return SDL_touchDevices[index]; } -SDL_TouchDeviceType -SDL_GetTouchDeviceType(SDL_TouchID id) +SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID id) { SDL_Touch *touch = SDL_GetTouch(id); if (touch) { @@ -138,8 +134,7 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID) return 0; } -SDL_Finger * -SDL_GetTouchFinger(SDL_TouchID touchID, int index) +SDL_Finger *SDL_GetTouchFinger(SDL_TouchID touchID, int index) { SDL_Touch *touch = SDL_GetTouch(touchID); if (touch == NULL) { diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index 017ae9b67..3b2f88c87 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -500,8 +500,7 @@ static int SDLCALL mem_close(SDL_RWops *context) /* Functions to create SDL_RWops structures from various data sources */ -SDL_RWops * -SDL_RWFromFile(const char *file, const char *mode) +SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) { SDL_RWops *rwops = NULL; if (file == NULL || !*file || mode == NULL || !*mode) { @@ -593,8 +592,7 @@ SDL_RWFromFile(const char *file, const char *mode) return rwops; } -SDL_RWops * -SDL_RWFromMem(void *mem, int size) +SDL_RWops *SDL_RWFromMem(void *mem, int size) { SDL_RWops *rwops = NULL; if (mem == NULL) { @@ -621,8 +619,7 @@ SDL_RWFromMem(void *mem, int size) return rwops; } -SDL_RWops * -SDL_RWFromConstMem(const void *mem, int size) +SDL_RWops *SDL_RWFromConstMem(const void *mem, int size) { SDL_RWops *rwops = NULL; if (mem == NULL) { @@ -649,8 +646,7 @@ SDL_RWFromConstMem(const void *mem, int size) return rwops; } -SDL_RWops * -SDL_CreateRW(void) +SDL_RWops *SDL_CreateRW(void) { SDL_RWops *area; @@ -825,49 +821,42 @@ Uint64 SDL_ReadBE64(SDL_RWops *src) return SDL_SwapBE64(value); } -size_t -SDL_WriteU8(SDL_RWops *dst, Uint8 value) +size_t SDL_WriteU8(SDL_RWops *dst, Uint8 value) { return (SDL_RWwrite(dst, &value, sizeof(value)) == sizeof(value)) ? 1 : 0; } -size_t -SDL_WriteLE16(SDL_RWops *dst, Uint16 value) +size_t SDL_WriteLE16(SDL_RWops *dst, Uint16 value) { const Uint16 swapped = SDL_SwapLE16(value); return (SDL_RWwrite(dst, &swapped, sizeof(swapped)) == sizeof(swapped)) ? 1 : 0; } -size_t -SDL_WriteBE16(SDL_RWops *dst, Uint16 value) +size_t SDL_WriteBE16(SDL_RWops *dst, Uint16 value) { const Uint16 swapped = SDL_SwapBE16(value); return (SDL_RWwrite(dst, &swapped, sizeof(swapped)) == sizeof(swapped)) ? 1 : 0; } -size_t -SDL_WriteLE32(SDL_RWops *dst, Uint32 value) +size_t SDL_WriteLE32(SDL_RWops *dst, Uint32 value) { const Uint32 swapped = SDL_SwapLE32(value); return (SDL_RWwrite(dst, &swapped, sizeof(swapped)) == sizeof(swapped)) ? 1 : 0; } -size_t -SDL_WriteBE32(SDL_RWops *dst, Uint32 value) +size_t SDL_WriteBE32(SDL_RWops *dst, Uint32 value) { const Uint32 swapped = SDL_SwapBE32(value); return (SDL_RWwrite(dst, &swapped, sizeof(swapped)) == sizeof(swapped)) ? 1 : 0; } -size_t -SDL_WriteLE64(SDL_RWops *dst, Uint64 value) +size_t SDL_WriteLE64(SDL_RWops *dst, Uint64 value) { const Uint64 swapped = SDL_SwapLE64(value); return (SDL_RWwrite(dst, &swapped, sizeof(swapped)) == sizeof(swapped)) ? 1 : 0; } -size_t -SDL_WriteBE64(SDL_RWops *dst, Uint64 value) +size_t SDL_WriteBE64(SDL_RWops *dst, Uint64 value) { const Uint64 swapped = SDL_SwapBE64(value); return (SDL_RWwrite(dst, &swapped, sizeof(swapped)) == sizeof(swapped)) ? 1 : 0; diff --git a/src/file/n3ds/SDL_rwopsromfs.c b/src/file/n3ds/SDL_rwopsromfs.c index 5c5eb513b..9b14fed71 100644 --- a/src/file/n3ds/SDL_rwopsromfs.c +++ b/src/file/n3ds/SDL_rwopsromfs.c @@ -22,21 +22,20 @@ #include "SDL_rwopsromfs.h" /* Checks if the mode is a kind of reading */ -SDL_FORCE_INLINE SDL_bool IsReadMode(const char *mode); +static SDL_bool IsReadMode(const char *mode); /* Checks if the file starts with the given prefix */ -SDL_FORCE_INLINE SDL_bool HasPrefix(const char *file, const char *prefix); +static SDL_bool HasPrefix(const char *file, const char *prefix); -SDL_FORCE_INLINE FILE *TryOpenFile(const char *file, const char *mode); -SDL_FORCE_INLINE FILE *TryOpenInRomfs(const char *file, const char *mode); +static FILE *TryOpenFile(const char *file, const char *mode); +static FILE *TryOpenInRomfs(const char *file, const char *mode); /* Nintendo 3DS applications may embed resources in the executable. The resources are stored in a special read-only partition prefixed with 'romfs:/'. As such, when opening a file, we should first try the romfs unless sdmc is specifically mentionned. */ -FILE * -N3DS_FileOpen(const char *file, const char *mode) +FILE *N3DS_FileOpen(const char *file, const char *mode) { /* romfs are read-only */ if (!IsReadMode(mode)) { @@ -51,20 +50,17 @@ N3DS_FileOpen(const char *file, const char *mode) return TryOpenFile(file, mode); } -SDL_FORCE_INLINE SDL_bool -IsReadMode(const char *mode) +static SDL_bool IsReadMode(const char *mode) { return SDL_strchr(mode, 'r') != NULL; } -SDL_FORCE_INLINE SDL_bool -HasPrefix(const char *file, const char *prefix) +static SDL_bool HasPrefix(const char *file, const char *prefix) { return SDL_strncmp(prefix, file, SDL_strlen(prefix)) == 0; } -SDL_FORCE_INLINE FILE * -TryOpenFile(const char *file, const char *mode) +static FILE *TryOpenFile(const char *file, const char *mode) { FILE *fp = NULL; @@ -76,8 +72,7 @@ TryOpenFile(const char *file, const char *mode) return fp; } -SDL_FORCE_INLINE FILE * -TryOpenInRomfs(const char *file, const char *mode) +FILE *TryOpenInRomfs(const char *file, const char *mode) { FILE *fp = NULL; char *prefixed_filepath = NULL; diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index 8a2bd75c5..2a5ed9e54 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -27,16 +27,14 @@ #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { /* The current working directory is / on Android */ SDL_Unsupported(); return NULL; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { const char *path = SDL_AndroidGetInternalStoragePath(); if (path) { diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m index cffb2728a..c644495cf 100644 --- a/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -29,8 +29,7 @@ #include #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { @autoreleasepool { NSBundle *bundle = [NSBundle mainBundle]; @@ -64,8 +63,7 @@ SDL_GetBasePath(void) } } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { @autoreleasepool { char *retval = NULL; diff --git a/src/filesystem/emscripten/SDL_sysfilesystem.c b/src/filesystem/emscripten/SDL_sysfilesystem.c index de98dcf68..a37363741 100644 --- a/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -29,15 +29,13 @@ #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval = "/"; return SDL_strdup(retval); } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { const char *append = "/libsdl/"; char *retval; diff --git a/src/filesystem/haiku/SDL_sysfilesystem.cc b/src/filesystem/haiku/SDL_sysfilesystem.cc index 9cb744ae2..07e53766a 100644 --- a/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/src/filesystem/haiku/SDL_sysfilesystem.cc @@ -32,8 +32,7 @@ #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char name[MAXPATHLEN]; @@ -64,8 +63,7 @@ SDL_GetBasePath(void) } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { // !!! FIXME: is there a better way to do this? const char *home = SDL_getenv("HOME"); diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index a2d8587c1..27fc16e7b 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -29,18 +29,16 @@ #include #include -SDL_FORCE_INLINE char *MakePrefPath(const char *app); -SDL_FORCE_INLINE int CreatePrefPathDir(const char *pref); +static char *MakePrefPath(const char *app); +static int CreatePrefPathDir(const char *pref); -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *base_path = SDL_strdup("romfs:/"); return base_path; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *pref_path = NULL; if (app == NULL) { @@ -68,8 +66,7 @@ char *SDL_GetPath(SDL_Folder folder) return NULL; } -SDL_FORCE_INLINE char * -MakePrefPath(const char *app) +static char *MakePrefPath(const char *app) { char *pref_path; if (SDL_asprintf(&pref_path, "sdmc:/3ds/%s/", app) < 0) { @@ -79,8 +76,7 @@ MakePrefPath(const char *app) return pref_path; } -SDL_FORCE_INLINE int -CreatePrefPathDir(const char *pref) +static int CreatePrefPathDir(const char *pref) { int result = mkdir(pref, 0666); diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index e8e9e8282..e0167ddec 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -28,8 +28,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval; size_t len; @@ -75,8 +74,7 @@ static void recursive_mkdir(const char *dir) mkdir(tmp, S_IRWXU); } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; diff --git a/src/filesystem/psp/SDL_sysfilesystem.c b/src/filesystem/psp/SDL_sysfilesystem.c index 227f58d0e..60c510e5e 100644 --- a/src/filesystem/psp/SDL_sysfilesystem.c +++ b/src/filesystem/psp/SDL_sysfilesystem.c @@ -28,8 +28,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval = NULL; size_t len; @@ -43,8 +42,7 @@ SDL_GetBasePath(void) return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; diff --git a/src/filesystem/riscos/SDL_sysfilesystem.c b/src/filesystem/riscos/SDL_sysfilesystem.c index 96e4562ef..37b19cbd2 100644 --- a/src/filesystem/riscos/SDL_sysfilesystem.c +++ b/src/filesystem/riscos/SDL_sysfilesystem.c @@ -125,8 +125,7 @@ static _kernel_oserror *createDirectoryRecursive(char *path) return _kernel_swi(OS_File, ®s, ®s); } -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { _kernel_swi_regs regs; _kernel_oserror *error; @@ -153,8 +152,7 @@ SDL_GetBasePath(void) return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *canon, *dir, *retval; size_t len; diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index 088afdee8..4a16a9964 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -120,8 +120,7 @@ static char *search_path_for_binary(const char *bin) } #endif -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval = NULL; @@ -259,8 +258,7 @@ SDL_GetBasePath(void) return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { /* * We use XDG's base directory spec, even if you're not on Linux. @@ -347,10 +345,10 @@ SDL_GetPrefPath(const char *org, const char *app) including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: + subject to the following conditions: The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -361,8 +359,7 @@ SDL_GetPrefPath(const char *org, const char *app) CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static char * -xdg_user_dir_lookup_with_fallback (const char *type, const char *fallback) +static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fallback) { FILE *file; char *home_dir, *config_home, *config_file; @@ -372,7 +369,7 @@ xdg_user_dir_lookup_with_fallback (const char *type, const char *fallback) int len; int relative; size_t l; - + home_dir = SDL_getenv ("HOME"); if (home_dir == NULL) @@ -412,11 +409,11 @@ xdg_user_dir_lookup_with_fallback (const char *type, const char *fallback) len = SDL_strlen (buffer); if (len > 0 && buffer[len-1] == '\n') buffer[len-1] = 0; - + p = buffer; while (*p == ' ' || *p == '\t') p++; - + if (SDL_strncmp (p, "XDG_", 4) != 0) continue; p += 4; @@ -433,14 +430,14 @@ xdg_user_dir_lookup_with_fallback (const char *type, const char *fallback) if (*p != '=') continue; p++; - + while (*p == ' ' || *p == '\t') p++; if (*p != '"') continue; p++; - + relative = 0; if (SDL_strncmp (p, "$HOME/", 6) == 0) { @@ -469,7 +466,7 @@ xdg_user_dir_lookup_with_fallback (const char *type, const char *fallback) *user_dir = 0; } - + d = user_dir + SDL_strlen (user_dir); while (*p && *p != '"') { @@ -491,8 +488,7 @@ error2: return NULL; } -static char * -xdg_user_dir_lookup (const char *type) +static char *xdg_user_dir_lookup (const char *type) { char *dir, *home_dir, *user_dir; diff --git a/src/filesystem/vita/SDL_sysfilesystem.c b/src/filesystem/vita/SDL_sysfilesystem.c index dab1872c0..a99a1747c 100644 --- a/src/filesystem/vita/SDL_sysfilesystem.c +++ b/src/filesystem/vita/SDL_sysfilesystem.c @@ -34,16 +34,14 @@ #include #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { const char *basepath = "app0:/"; char *retval = SDL_strdup(basepath); return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { const char *envr = "ux0:/data/"; char *retval = NULL; diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c index 6e96ed9b6..59370d2c9 100644 --- a/src/filesystem/windows/SDL_sysfilesystem.c +++ b/src/filesystem/windows/SDL_sysfilesystem.c @@ -334,22 +334,19 @@ done: #endif /* SDL_FILESYSTEM_WINDOWS */ #ifdef SDL_FILESYSTEM_XBOX -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { SDL_Unsupported(); return NULL; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { SDL_Unsupported(); return NULL; } -char * -SDL_GetPath(SDL_Folder folder) +char *SDL_GetPath(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index b12fafb62..fbd776282 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -85,8 +85,7 @@ int SDL_NumHaptics(void) /* * Gets the name of a Haptic device by index. */ -const char * -SDL_HapticName(int device_index) +const char *SDL_HapticName(int device_index) { if ((device_index < 0) || (device_index >= SDL_NumHaptics())) { SDL_SetError("Haptic: There are %d haptic devices available", @@ -99,8 +98,7 @@ SDL_HapticName(int device_index) /* * Opens a Haptic device. */ -SDL_Haptic * -SDL_HapticOpen(int device_index) +SDL_Haptic *SDL_HapticOpen(int device_index) { SDL_Haptic *haptic; SDL_Haptic *hapticlist; @@ -211,8 +209,7 @@ int SDL_MouseIsHaptic(void) /* * Returns the haptic device if mouse is haptic or NULL elsewise. */ -SDL_Haptic * -SDL_HapticOpenFromMouse(void) +SDL_Haptic *SDL_HapticOpenFromMouse(void) { int device_index; @@ -257,8 +254,7 @@ int SDL_JoystickIsHaptic(SDL_Joystick *joystick) /* * Opens a haptic device from a joystick. */ -SDL_Haptic * -SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) +SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) { SDL_Haptic *haptic; SDL_Haptic *hapticlist; @@ -415,8 +411,7 @@ int SDL_HapticNumEffectsPlaying(SDL_Haptic *haptic) /* * Returns supported effects by the device. */ -unsigned int -SDL_HapticQuery(SDL_Haptic *haptic) +unsigned int SDL_HapticQuery(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return 0; /* same as if no effects were supported */ diff --git a/src/haptic/android/SDL_syshaptic.c b/src/haptic/android/SDL_syshaptic.c index c71821a3e..f65a26eff 100644 --- a/src/haptic/android/SDL_syshaptic.c +++ b/src/haptic/android/SDL_syshaptic.c @@ -78,8 +78,7 @@ static SDL_hapticlist_item *HapticByDevId(int device_id) return NULL; } -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item = HapticByOrder(index); if (item == NULL) { diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c index f2b6fd825..d9e590482 100644 --- a/src/haptic/darwin/SDL_syshaptic.c +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -316,8 +316,7 @@ int MacHaptic_MaybeRemoveDevice(io_object_t device) /* * Return the name of a haptic device, does not need to be opened. */ -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item; item = HapticByDevIndex(index); diff --git a/src/haptic/dummy/SDL_syshaptic.c b/src/haptic/dummy/SDL_syshaptic.c index fed060941..480195fc6 100644 --- a/src/haptic/dummy/SDL_syshaptic.c +++ b/src/haptic/dummy/SDL_syshaptic.c @@ -39,8 +39,7 @@ int SDL_SYS_NumHaptics(void) return 0; } -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_SYS_LogicError(); return NULL; diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index 403e749d7..549354e39 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -344,8 +344,7 @@ static const char *SDL_SYS_HapticNameFromFD(int fd) /* * Return the name of a haptic device, does not need to be opened. */ -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item; int fd; diff --git a/src/haptic/windows/SDL_windowshaptic.c b/src/haptic/windows/SDL_windowshaptic.c index 2856d2748..1a2d5d638 100644 --- a/src/haptic/windows/SDL_windowshaptic.c +++ b/src/haptic/windows/SDL_windowshaptic.c @@ -130,8 +130,7 @@ static SDL_hapticlist_item *HapticByDevIndex(int device_index) /* * Return the name of a haptic device, does not need to be opened. */ -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item = HapticByDevIndex(index); return item->name; diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index b076e2810..3cc01f5d8 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -193,14 +193,12 @@ static int SDL_inotify_init1(void) } #endif -static int -StrHasPrefix(const char *string, const char *prefix) +static int StrHasPrefix(const char *string, const char *prefix) { return SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0; } -static int -StrIsInteger(const char *string) +static int StrIsInteger(const char *string) { const char *p; @@ -218,8 +216,7 @@ StrIsInteger(const char *string) } #endif /* HAVE_INOTIFY */ -static void -HIDAPI_InitializeDiscovery(void) +static void HIDAPI_InitializeDiscovery(void) { SDL_HIDAPI_discovery.m_bInitialized = SDL_TRUE; SDL_HIDAPI_discovery.m_unDeviceChangeCounter = 1; @@ -358,8 +355,7 @@ HIDAPI_InitializeDiscovery(void) } } -static void -HIDAPI_UpdateDiscovery(void) +static void HIDAPI_UpdateDiscovery(void) { if (!SDL_HIDAPI_discovery.m_bInitialized) { HIDAPI_InitializeDiscovery(); @@ -476,8 +472,7 @@ HIDAPI_UpdateDiscovery(void) } } -static void -HIDAPI_ShutdownDiscovery(void) +static void HIDAPI_ShutdownDiscovery(void) { if (!SDL_HIDAPI_discovery.m_bInitialized) { return; @@ -808,8 +803,7 @@ static struct #ifndef __FreeBSD__ /* this is awkwardly inlined, so we need to re-implement it here * so we can override the libusb_control_transfer call */ -static int -SDL_libusb_get_string_descriptor(libusb_device_handle *dev, +static int SDL_libusb_get_string_descriptor(libusb_device_handle *dev, uint8_t descriptor_index, uint16_t lang_id, unsigned char *data, int length) { @@ -960,8 +954,7 @@ static char device_magic; #if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) || defined(HAVE_LIBUSB) -static SDL_hid_device * -CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend) +static SDL_hid_device *CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend) { SDL_hid_device *wrapper = (SDL_hid_device *)SDL_malloc(sizeof(*wrapper)); wrapper->magic = &device_magic; diff --git a/src/hidapi/windows/hid.c b/src/hidapi/windows/hid.c index 725822572..7a292a4a1 100644 --- a/src/hidapi/windows/hid.c +++ b/src/hidapi/windows/hid.c @@ -222,8 +222,7 @@ struct hid_device_ { BOOL use_hid_write_output_report; }; -static BOOL -IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) +static BOOL IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) { OSVERSIONINFOEXW osvi; DWORDLONG const dwlConditionMask = VerSetConditionMask( diff --git a/src/joystick/apple/SDL_mfijoystick.m b/src/joystick/apple/SDL_mfijoystick.m index 0c7f3b13d..e4b91d0ce 100644 --- a/src/joystick/apple/SDL_mfijoystick.m +++ b/src/joystick/apple/SDL_mfijoystick.m @@ -1736,8 +1736,7 @@ static GCControllerDirectionPad *GetDirectionalPadForController(GCController *co static char elementName[256]; -const char * -IOS_GetAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) +const char *IOS_GetAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button) { elementName[0] = '\0'; #if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE) @@ -1852,8 +1851,7 @@ IOS_GetAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton butto return elementName; } -const char * -IOS_GetAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis) +const char *IOS_GetAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis) { elementName[0] = '\0'; #if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE) diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c index 895743b48..7bbc4bd9e 100644 --- a/src/joystick/darwin/SDL_iokitjoystick.c +++ b/src/joystick/darwin/SDL_iokitjoystick.c @@ -699,15 +699,13 @@ static void DARWIN_JoystickDetect(void) } } -const char * -DARWIN_JoystickGetDeviceName(int device_index) +const char *DARWIN_JoystickGetDeviceName(int device_index) { recDevice *device = GetDeviceForIndex(device_index); return device ? device->product : "UNKNOWN"; } -const char * -DARWIN_JoystickGetDevicePath(int device_index) +const char *DARWIN_JoystickGetDevicePath(int device_index) { return NULL; } diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c index 632a2e94f..b51f961c5 100644 --- a/src/joystick/hidapi/SDL_hidapi_switch.c +++ b/src/joystick/hidapi/SDL_hidapi_switch.c @@ -1783,8 +1783,7 @@ static void HandleSimpleControllerState(SDL_Joystick *joystick, SDL_DriverSwitch ctx->m_lastSimpleState = *packet; } -static void -SendSensorUpdate(Uint64 timestamp, SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SDL_SensorType type, Uint64 sensor_timestamp, const Sint16 *values) +static void SendSensorUpdate(Uint64 timestamp, SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SDL_SensorType type, Uint64 sensor_timestamp, const Sint16 *values) { float data[3]; diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 2e835a114..393524dbd 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -1240,8 +1240,7 @@ SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 vers return result; } -SDL_JoystickType -HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) +SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) { SDL_HIDAPI_Device *device; SDL_JoystickType type = SDL_JOYSTICK_TYPE_UNKNOWN; @@ -1258,8 +1257,7 @@ HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) return type; } -SDL_GamepadType -HIDAPI_GetGamepadTypeFromGUID(SDL_JoystickGUID guid) +SDL_GamepadType HIDAPI_GetGamepadTypeFromGUID(SDL_JoystickGUID guid) { SDL_HIDAPI_Device *device; SDL_GamepadType type = SDL_GAMEPAD_TYPE_UNKNOWN; diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index 511eecf30..64c907f6e 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -591,8 +591,7 @@ err: #undef CHECK } -SDL_bool -SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_number) +SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_number) { Joystick_PresentData data; @@ -1176,8 +1175,7 @@ void SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext) { } -SDL_bool -SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version) +SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version) { return SDL_FALSE; } diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index 9c5104fee..6ea411153 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -878,14 +878,12 @@ static int RAWINPUT_JoystickGetCount(void) return SDL_RAWINPUT_numjoysticks; } -SDL_bool -RAWINPUT_IsEnabled() +SDL_bool RAWINPUT_IsEnabled() { return SDL_RAWINPUT_inited; } -SDL_bool -RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) +SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) { SDL_RAWINPUT_Device *device; @@ -1886,8 +1884,7 @@ static void RAWINPUT_JoystickClose(SDL_Joystick *joystick) } } -SDL_bool -RAWINPUT_RegisterNotifications(HWND hWnd) +SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd) { RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)]; int i; diff --git a/src/locale/SDL_locale.c b/src/locale/SDL_locale.c index 0ce10dfbc..46a5a5db4 100644 --- a/src/locale/SDL_locale.c +++ b/src/locale/SDL_locale.c @@ -86,8 +86,7 @@ static SDL_Locale *build_locales_from_csv_string(char *csv) return retval; } -SDL_Locale * -SDL_GetPreferredLocales(void) +SDL_Locale *SDL_GetPreferredLocales(void) { char locbuf[128]; /* enough for 21 "xx_YY," language strings. */ const char *hint = SDL_GetHint(SDL_HINT_PREFERRED_LOCALES); diff --git a/src/locale/haiku/SDL_syslocale.cc b/src/locale/haiku/SDL_syslocale.cc index 95a49c433..08932e1a2 100644 --- a/src/locale/haiku/SDL_syslocale.cc +++ b/src/locale/haiku/SDL_syslocale.cc @@ -26,8 +26,7 @@ #include "SDL_internal.h" #include "../SDL_syslocale.h" -int -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { BLocaleRoster *roster = BLocaleRoster::Default(); roster->Refresh(); diff --git a/src/locale/n3ds/SDL_syslocale.c b/src/locale/n3ds/SDL_syslocale.c index 13fd60666..1d389c649 100644 --- a/src/locale/n3ds/SDL_syslocale.c +++ b/src/locale/n3ds/SDL_syslocale.c @@ -27,7 +27,7 @@ /* Used when the CFGU fails to work. */ #define BAD_LOCALE 255 -SDL_FORCE_INLINE u8 GetLocaleIndex(void); +static u8 GetLocaleIndex(void); int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { @@ -42,8 +42,7 @@ int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) return 0; } -SDL_FORCE_INLINE u8 -GetLocaleIndex(void) +static u8 GetLocaleIndex(void) { u8 current_locale; if (R_FAILED(cfguInit())) { diff --git a/src/misc/haiku/SDL_sysurl.cc b/src/misc/haiku/SDL_sysurl.cc index f21011acf..cf619ef09 100644 --- a/src/misc/haiku/SDL_sysurl.cc +++ b/src/misc/haiku/SDL_sysurl.cc @@ -23,8 +23,7 @@ #include "../SDL_sysurl.h" #include -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { BUrl burl(url); const status_t rc = burl.OpenWithPreferredApplication(false); diff --git a/src/power/SDL_power.c b/src/power/SDL_power.c index 3ffa72ef4..8676a316d 100644 --- a/src/power/SDL_power.c +++ b/src/power/SDL_power.c @@ -84,8 +84,7 @@ static SDL_GetPowerInfo_Impl implementations[] = { }; #endif -SDL_PowerState -SDL_GetPowerInfo(int *seconds, int *percent) +SDL_PowerState SDL_GetPowerInfo(int *seconds, int *percent) { #ifndef SDL_POWER_DISABLED const int total = sizeof(implementations) / sizeof(implementations[0]); diff --git a/src/power/android/SDL_syspower.c b/src/power/android/SDL_syspower.c index 83ec6c888..1e3c24880 100644 --- a/src/power/android/SDL_syspower.c +++ b/src/power/android/SDL_syspower.c @@ -27,8 +27,7 @@ #include "../../core/android/SDL_android.h" -SDL_bool -SDL_GetPowerInfo_Android(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *state, int *seconds, int *percent) { int battery; int plugged; diff --git a/src/power/emscripten/SDL_syspower.c b/src/power/emscripten/SDL_syspower.c index d2ede9e8b..c316a9e4f 100644 --- a/src/power/emscripten/SDL_syspower.c +++ b/src/power/emscripten/SDL_syspower.c @@ -25,8 +25,7 @@ #include -SDL_bool -SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent) { EmscriptenBatteryEvent batteryState; int haveBattery = 0; diff --git a/src/power/haiku/SDL_syspower.c b/src/power/haiku/SDL_syspower.c index 70cb6508f..6298ee581 100644 --- a/src/power/haiku/SDL_syspower.c +++ b/src/power/haiku/SDL_syspower.c @@ -40,8 +40,7 @@ #define APM_DEVICE_ALL 1 #define APM_BIOS_CALL (B_DEVICE_OP_CODES_END + 3) -SDL_bool -SDL_GetPowerInfo_Haiku(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *state, int *seconds, int *percent) { const int fd = open("/dev/misc/apm", O_RDONLY | O_CLOEXEC); SDL_bool need_details = SDL_FALSE; diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c index 397dd2d57..c39694e06 100644 --- a/src/power/linux/SDL_syspower.c +++ b/src/power/linux/SDL_syspower.c @@ -228,9 +228,7 @@ static void check_proc_acpi_ac_adapter(const char *node, SDL_bool *have_ac) } } -SDL_bool -SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *state, - int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *state, int *seconds, int *percent) { struct dirent *dent = NULL; DIR *dirp = NULL; @@ -313,9 +311,7 @@ static SDL_bool int_string(char *str, int *val) } /* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */ -SDL_bool -SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state, - int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state, int *seconds, int *percent) { SDL_bool need_details = SDL_FALSE; int ac_status = 0; @@ -421,8 +417,7 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state, return SDL_TRUE; } -SDL_bool -SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent) { const char *base = sys_class_power_supply_path; struct dirent *dent; @@ -611,8 +606,7 @@ static void check_upower_device(DBusConnection *conn, const char *path, SDL_Powe } #endif -SDL_bool -SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *seconds, int *percent) { SDL_bool retval = SDL_FALSE; diff --git a/src/power/macos/SDL_syspower.c b/src/power/macos/SDL_syspower.c index c2679a6f5..7c472e334 100644 --- a/src/power/macos/SDL_syspower.c +++ b/src/power/macos/SDL_syspower.c @@ -136,8 +136,7 @@ static void checkps(CFDictionaryRef dict, SDL_bool *have_ac, SDL_bool *have_batt #undef GETVAL #undef STRMATCH -SDL_bool -SDL_GetPowerInfo_MacOSX(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *state, int *seconds, int *percent) { CFTypeRef blob = IOPSCopyPowerSourcesInfo(); diff --git a/src/power/n3ds/SDL_syspower.c b/src/power/n3ds/SDL_syspower.c index 637f1ef92..511f1f987 100644 --- a/src/power/n3ds/SDL_syspower.c +++ b/src/power/n3ds/SDL_syspower.c @@ -25,15 +25,14 @@ #include <3ds.h> -SDL_FORCE_INLINE SDL_PowerState GetPowerState(void); -SDL_FORCE_INLINE int ReadStateFromPTMU(bool *is_plugged, u8 *is_charging); -SDL_FORCE_INLINE int GetBatteryPercentage(void); +static SDL_PowerState GetPowerState(void); +static int ReadStateFromPTMU(bool *is_plugged, u8 *is_charging); +static int GetBatteryPercentage(void); #define BATTERY_PERCENT_REG 0xB #define BATTERY_PERCENT_REG_SIZE 2 -SDL_bool -SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent) { *state = GetPowerState(); *percent = GetBatteryPercentage(); @@ -42,8 +41,7 @@ SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent) return SDL_TRUE; } -SDL_FORCE_INLINE SDL_PowerState -GetPowerState(void) +static SDL_PowerState GetPowerState(void) { bool is_plugged; u8 is_charging; @@ -63,8 +61,7 @@ GetPowerState(void) return SDL_POWERSTATE_ON_BATTERY; } -SDL_FORCE_INLINE int -ReadStateFromPTMU(bool *is_plugged, u8 *is_charging) +static int ReadStateFromPTMU(bool *is_plugged, u8 *is_charging) { if (R_FAILED(ptmuInit())) { return SDL_SetError("Failed to initialise PTMU service"); @@ -84,8 +81,7 @@ ReadStateFromPTMU(bool *is_plugged, u8 *is_charging) return 0; } -SDL_FORCE_INLINE int -GetBatteryPercentage(void) +static int GetBatteryPercentage(void) { u8 data[BATTERY_PERCENT_REG_SIZE]; diff --git a/src/power/psp/SDL_syspower.c b/src/power/psp/SDL_syspower.c index c63acf6d4..db670a371 100644 --- a/src/power/psp/SDL_syspower.c +++ b/src/power/psp/SDL_syspower.c @@ -26,9 +26,7 @@ #include -SDL_bool -SDL_GetPowerInfo_PSP(SDL_PowerState *state, int *seconds, - int *percent) +SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *state, int *seconds, int *percent) { int battery = scePowerIsBatteryExist(); int plugged = scePowerIsPowerOnline(); diff --git a/src/power/uikit/SDL_syspower.m b/src/power/uikit/SDL_syspower.m index af931d5f0..f1d29d393 100644 --- a/src/power/uikit/SDL_syspower.m +++ b/src/power/uikit/SDL_syspower.m @@ -50,8 +50,7 @@ void SDL_UIKit_UpdateBatteryMonitoring(void) } #endif /* !TARGET_OS_TV */ -SDL_bool -SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percent) { #if TARGET_OS_TV *state = SDL_POWERSTATE_NO_BATTERY; diff --git a/src/power/vita/SDL_syspower.c b/src/power/vita/SDL_syspower.c index 39d580a62..3f1d9a0ca 100644 --- a/src/power/vita/SDL_syspower.c +++ b/src/power/vita/SDL_syspower.c @@ -26,9 +26,7 @@ #include -SDL_bool -SDL_GetPowerInfo_VITA(SDL_PowerState *state, int *seconds, - int *percent) +SDL_bool SDL_GetPowerInfo_VITA(SDL_PowerState *state, int *seconds, int *percent) { int battery = 1; int plugged = scePowerIsPowerOnline(); diff --git a/src/power/windows/SDL_syspower.c b/src/power/windows/SDL_syspower.c index afc645f2c..7f978c591 100644 --- a/src/power/windows/SDL_syspower.c +++ b/src/power/windows/SDL_syspower.c @@ -25,8 +25,7 @@ #include "../../core/windows/SDL_windows.h" -SDL_bool -SDL_GetPowerInfo_Windows(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *state, int *seconds, int *percent) { SYSTEM_POWER_STATUS status; SDL_bool need_details = SDL_FALSE; diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c index f920c553d..bcc7cdfc0 100644 --- a/src/render/SDL_yuv_sw.c +++ b/src/render/SDL_yuv_sw.c @@ -27,8 +27,7 @@ #include "SDL_yuv_sw_c.h" #include "../video/SDL_yuv_c.h" -SDL_SW_YUVTexture * -SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) { SDL_SW_YUVTexture *swdata; diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index e81f7d79e..198bf0d7c 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1538,8 +1538,7 @@ static int D3D_SetVSync(SDL_Renderer *renderer, const int vsync) return 0; } -SDL_Renderer * -D3D_CreateRenderer(SDL_Window *window, Uint32 flags) +SDL_Renderer *D3D_CreateRenderer(SDL_Window *window, Uint32 flags) { SDL_Renderer *renderer; D3D_RenderData *data; @@ -1730,8 +1729,7 @@ SDL_RenderDriver D3D_RenderDriver = { #if defined(__WIN32__) || defined(__WINGDK__) /* This function needs to always exist on Windows, for the Dynamic API. */ -IDirect3DDevice9 * -SDL_GetRenderD3D9Device(SDL_Renderer *renderer) +IDirect3DDevice9 *SDL_GetRenderD3D9Device(SDL_Renderer *renderer) { IDirect3DDevice9 *device = NULL; diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index f6de782d4..f2b1cc1cc 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -2293,8 +2293,7 @@ static int D3D11_SetVSync(SDL_Renderer *renderer, const int vsync) } #endif -SDL_Renderer * -D3D11_CreateRenderer(SDL_Window *window, Uint32 flags) +SDL_Renderer *D3D11_CreateRenderer(SDL_Window *window, Uint32 flags) { SDL_Renderer *renderer; D3D11_RenderData *data; @@ -2401,8 +2400,7 @@ SDL_RenderDriver D3D11_RenderDriver = { #if defined(__WIN32__) || defined(__WINGDK__) /* This function needs to always exist on Windows, for the Dynamic API. */ -ID3D11Device * -SDL_GetRenderD3D11Device(SDL_Renderer *renderer) +ID3D11Device *SDL_GetRenderD3D11Device(SDL_Renderer *renderer) { ID3D11Device *device = NULL; diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 3637f1a5a..40866004e 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -2943,8 +2943,7 @@ static int D3D12_SetVSync(SDL_Renderer *renderer, const int vsync) return 0; } -SDL_Renderer * -D3D12_CreateRenderer(SDL_Window *window, Uint32 flags) +SDL_Renderer *D3D12_CreateRenderer(SDL_Window *window, Uint32 flags) { SDL_Renderer *renderer; D3D12_RenderData *data; diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index b4d7ad90b..a83f98222 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -549,8 +549,7 @@ static SDL_bool METAL_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode bl return SDL_TRUE; } -static int -METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; @@ -1465,8 +1464,7 @@ static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, } } -static int -METAL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, +static int METAL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 pixel_format, void *pixels, int pitch) { @autoreleasepool { diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 1c057ca3f..369d86e31 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -145,8 +145,7 @@ typedef struct GL_FBOList *fbo; } GL_TextureData; -SDL_FORCE_INLINE const char * -GL_TranslateError(GLenum error) +static const char *GL_TranslateError(GLenum error) { #define GL_ERROR_TRANSLATE(e) \ case e: \ @@ -166,8 +165,7 @@ GL_TranslateError(GLenum error) #undef GL_ERROR_TRANSLATE } -SDL_FORCE_INLINE void -GL_ClearErrors(SDL_Renderer *renderer) +static void GL_ClearErrors(SDL_Renderer *renderer) { GL_RenderData *data = (GL_RenderData *)renderer->driverdata; @@ -192,8 +190,7 @@ GL_ClearErrors(SDL_Renderer *renderer) } } -SDL_FORCE_INLINE int -GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) +static int GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) { GL_RenderData *data = (GL_RenderData *)renderer->driverdata; int ret = 0; @@ -400,8 +397,7 @@ static SDL_bool GL_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blend return SDL_TRUE; } -SDL_FORCE_INLINE SDL_bool -convert_format(GL_RenderData *renderdata, Uint32 pixel_format, +static SDL_bool convert_format(GL_RenderData *renderdata, Uint32 pixel_format, GLint *internalFormat, GLenum *format, GLenum *type) { switch (pixel_format) { diff --git a/src/render/opengl/SDL_shaders_gl.c b/src/render/opengl/SDL_shaders_gl.c index 0a308fb51..4a35e1e7f 100644 --- a/src/render/opengl/SDL_shaders_gl.c +++ b/src/render/opengl/SDL_shaders_gl.c @@ -488,8 +488,7 @@ static void DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data) ctx->glDeleteObjectARB(data->program); } -GL_ShaderContext * -GL_CreateShaderContext(void) +GL_ShaderContext *GL_CreateShaderContext(void) { GL_ShaderContext *ctx; SDL_bool shaders_supported; diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index e2a94edca..4750735c7 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -175,8 +175,7 @@ typedef struct GLES2_RenderData static const float inv255f = 1.0f / 255.0f; -SDL_FORCE_INLINE const char * -GL_TranslateError(GLenum error) +static const char *GL_TranslateError(GLenum error) { #define GL_ERROR_TRANSLATE(e) \ case e: \ @@ -193,8 +192,7 @@ GL_TranslateError(GLenum error) #undef GL_ERROR_TRANSLATE } -SDL_FORCE_INLINE void -GL_ClearErrors(SDL_Renderer *renderer) +static void GL_ClearErrors(SDL_Renderer *renderer) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; @@ -206,8 +204,7 @@ GL_ClearErrors(SDL_Renderer *renderer) } } -SDL_FORCE_INLINE int -GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) +static int GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; int ret = 0; diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index f258f25a1..151c360ae 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -1290,8 +1290,7 @@ static int PSP_SetVSync(SDL_Renderer *renderer, const int vsync) return 0; } -SDL_Renderer * -PSP_CreateRenderer(SDL_Window *window, Uint32 flags) +SDL_Renderer *PSP_CreateRenderer(SDL_Window *window, Uint32 flags) { SDL_Renderer *renderer; diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 24a2b10b6..762680f21 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -1089,8 +1089,7 @@ static void SW_SelectBestFormats(SDL_Renderer *renderer, Uint32 format) } } -SDL_Renderer * -SW_CreateRendererForSurface(SDL_Surface *surface) +SDL_Renderer *SW_CreateRendererForSurface(SDL_Surface *surface) { SDL_Renderer *renderer; SW_RenderData *data; diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index 8bdc8188a..9dddd6060 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -486,8 +486,7 @@ When using the NONE and MOD modes, color and alpha modulation must be applied be */ -SDL_Surface * -SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, int flipx, int flipy, +SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, int flipx, int flipy, const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center) { SDL_Surface *rz_dst; diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index e035932b2..3002a3cd5 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -209,8 +209,7 @@ static int VITA_GXM_SetVSync(SDL_Renderer *renderer, const int vsync) return 0; } -SDL_Renderer * -VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags) +SDL_Renderer *VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags) { SDL_Renderer *renderer; VITA_GXM_RenderData *data; diff --git a/src/render/vitagxm/SDL_render_vita_gxm_tools.c b/src/render/vitagxm/SDL_render_vita_gxm_tools.c index bc3e0d8c8..a7964594a 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_tools.c +++ b/src/render/vitagxm/SDL_render_vita_gxm_tools.c @@ -980,8 +980,7 @@ static SceGxmColorFormat tex_format_to_color_format(SceGxmTextureFormat format) } } -gxm_texture * -create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, SceGxmTextureFormat format, unsigned int isRenderTarget, unsigned int *return_w, unsigned int *return_h, unsigned int *return_pitch, float *return_wscale) +gxm_texture *create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, SceGxmTextureFormat format, unsigned int isRenderTarget, unsigned int *return_w, unsigned int *return_h, unsigned int *return_pitch, float *return_wscale) { gxm_texture *texture = SDL_calloc(1, sizeof(gxm_texture)); int aligned_w = ALIGN(w, 8); diff --git a/src/sensor/n3ds/SDL_n3dssensor.c b/src/sensor/n3ds/SDL_n3dssensor.c index c486996f1..21ccb4417 100644 --- a/src/sensor/n3ds/SDL_n3dssensor.c +++ b/src/sensor/n3ds/SDL_n3dssensor.c @@ -38,12 +38,11 @@ typedef struct static SDL_N3DSSensor N3DS_sensors[N3DS_SENSOR_COUNT]; -SDL_FORCE_INLINE int InitN3DSServices(void); -SDL_FORCE_INLINE void UpdateN3DSAccelerometer(SDL_Sensor *sensor); -SDL_FORCE_INLINE void UpdateN3DSGyroscope(SDL_Sensor *sensor); +static int InitN3DSServices(void); +static void UpdateN3DSAccelerometer(SDL_Sensor *sensor); +static void UpdateN3DSGyroscope(SDL_Sensor *sensor); -SDL_FORCE_INLINE SDL_bool -IsDeviceIndexValid(int device_index) +static SDL_bool IsDeviceIndexValid(int device_index) { return device_index >= 0 && device_index < N3DS_SENSOR_COUNT; } @@ -61,8 +60,7 @@ static int N3DS_SensorInit(void) return 0; } -SDL_FORCE_INLINE int -InitN3DSServices(void) +static int InitN3DSServices(void) { if (R_FAILED(hidInit())) { return -1; @@ -143,8 +141,7 @@ static void N3DS_SensorUpdate(SDL_Sensor *sensor) } } -SDL_FORCE_INLINE void -UpdateN3DSAccelerometer(SDL_Sensor *sensor) +static void UpdateN3DSAccelerometer(SDL_Sensor *sensor) { static accelVector previous_state = { 0, 0, 0 }; accelVector current_state; @@ -161,8 +158,7 @@ UpdateN3DSAccelerometer(SDL_Sensor *sensor) } } -SDL_FORCE_INLINE void -UpdateN3DSGyroscope(SDL_Sensor *sensor) +static void UpdateN3DSGyroscope(SDL_Sensor *sensor) { static angularRate previous_state = { 0, 0, 0 }; angularRate current_state; diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index c8cf85e8c..7d84cb128 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -161,8 +161,7 @@ int SDL_setenv(const char *name, const char *value, int overwrite) /* Retrieve a variable named "name" from the environment */ #ifdef HAVE_GETENV -char * -SDL_getenv(const char *name) +char *SDL_getenv(const char *name) { #ifdef __ANDROID__ /* Make sure variables from the application manifest are available */ @@ -177,8 +176,7 @@ SDL_getenv(const char *name) return getenv(name); } #elif defined(__WIN32__) || defined(__WINGDK__) -char * -SDL_getenv(const char *name) +char *SDL_getenv(const char *name) { size_t bufferlen; @@ -204,8 +202,7 @@ SDL_getenv(const char *name) return SDL_envmem; } #else -char * -SDL_getenv(const char *name) +char *SDL_getenv(const char *name) { size_t len, i; char *value; diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index 709d87723..5ae088ced 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -32,8 +32,7 @@ SDL_COMPILE_TIME_ASSERT(iconv_t, sizeof(iconv_t) <= sizeof(SDL_iconv_t)); -SDL_iconv_t -SDL_iconv_open(const char *tocode, const char *fromcode) +SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) { return (SDL_iconv_t)((uintptr_t)iconv_open(tocode, fromcode)); } @@ -43,8 +42,7 @@ int SDL_iconv_close(SDL_iconv_t cd) return iconv_close((iconv_t)((uintptr_t)cd)); } -size_t -SDL_iconv(SDL_iconv_t cd, +size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { @@ -188,8 +186,7 @@ static const char *getlocale(char *buffer, size_t bufsize) return buffer; } -SDL_iconv_t -SDL_iconv_open(const char *tocode, const char *fromcode) +SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) { int src_fmt = ENCODING_UNKNOWN; int dst_fmt = ENCODING_UNKNOWN; @@ -228,8 +225,7 @@ SDL_iconv_open(const char *tocode, const char *fromcode) return (SDL_iconv_t)-1; } -size_t -SDL_iconv(SDL_iconv_t cd, +size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { @@ -781,9 +777,7 @@ int SDL_iconv_close(SDL_iconv_t cd) #endif /* !HAVE_ICONV */ -char * -SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, - size_t inbytesleft) +char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft) { SDL_iconv_t cd; char *string; diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index 42a173ac5..9e44f89d0 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -22,8 +22,7 @@ #ifdef HAVE_QSORT -void -SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) +void SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) { qsort(base, nmemb, size, compare); } diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index f8eb4f4ee..6f7f1af76 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -50,8 +50,7 @@ static unsigned UTF8_GetTrailingBytes(unsigned char c) } #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) -static size_t -SDL_ScanLong(const char *text, int count, int radix, long *valuep) +static size_t SDL_ScanLong(const char *text, int count, int radix, long *valuep) { const char *textstart = text; long value = 0; @@ -95,8 +94,7 @@ SDL_ScanLong(const char *text, int count, int radix, long *valuep) #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) -static size_t -SDL_ScanUnsignedLong(const char *text, int count, int radix, unsigned long *valuep) +static size_t SDL_ScanUnsignedLong(const char *text, int count, int radix, unsigned long *valuep) { const char *textstart = text; unsigned long value = 0; @@ -135,8 +133,7 @@ SDL_ScanUnsignedLong(const char *text, int count, int radix, unsigned long *valu #endif #ifndef HAVE_VSSCANF -static size_t -SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep) +static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep) { const char *textstart = text; uintptr_t value = 0; @@ -167,8 +164,7 @@ SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep) #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL) -static size_t -SDL_ScanLongLong(const char *text, int count, int radix, Sint64 *valuep) +static size_t SDL_ScanLongLong(const char *text, int count, int radix, Sint64 *valuep) { const char *textstart = text; Sint64 value = 0; @@ -212,8 +208,7 @@ SDL_ScanLongLong(const char *text, int count, int radix, Sint64 *valuep) #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOULL) -static size_t -SDL_ScanUnsignedLongLong(const char *text, int count, int radix, Uint64 *valuep) +static size_t SDL_ScanUnsignedLongLong(const char *text, int count, int radix, Uint64 *valuep) { const char *textstart = text; Uint64 value = 0; @@ -252,8 +247,7 @@ SDL_ScanUnsignedLongLong(const char *text, int count, int radix, Uint64 *valuep) #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOD) -static size_t -SDL_ScanFloat(const char *text, double *valuep) +static size_t SDL_ScanFloat(const char *text, double *valuep) { const char *textstart = text; unsigned long lvalue = 0; @@ -339,8 +333,7 @@ int SDL_memcmp(const void *s1, const void *s2, size_t len) #endif /* HAVE_MEMCMP */ } -size_t -SDL_strlen(const char *string) +size_t SDL_strlen(const char *string) { #ifdef HAVE_STRLEN return strlen(string); @@ -353,8 +346,7 @@ SDL_strlen(const char *string) #endif /* HAVE_STRLEN */ } -size_t -SDL_wcslen(const wchar_t *string) +size_t SDL_wcslen(const wchar_t *string) { #ifdef HAVE_WCSLEN return wcslen(string); @@ -367,8 +359,7 @@ SDL_wcslen(const wchar_t *string) #endif /* HAVE_WCSLEN */ } -size_t -SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen) +size_t SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen) { #ifdef HAVE_WCSLCPY return wcslcpy(dst, src, maxlen); @@ -383,8 +374,7 @@ SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxle #endif /* HAVE_WCSLCPY */ } -size_t -SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen) +size_t SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen) { #ifdef HAVE_WCSLCAT return wcslcat(dst, src, maxlen); @@ -398,8 +388,7 @@ SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t max #endif /* HAVE_WCSLCAT */ } -wchar_t * -SDL_wcsdup(const wchar_t *string) +wchar_t *SDL_wcsdup(const wchar_t *string) { size_t len = ((SDL_wcslen(string) + 1) * sizeof(wchar_t)); wchar_t *newstr = (wchar_t *)SDL_malloc(len); @@ -409,8 +398,7 @@ SDL_wcsdup(const wchar_t *string) return newstr; } -wchar_t * -SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle) +wchar_t *SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle) { #ifdef HAVE_WCSSTR return SDL_const_cast(wchar_t *, wcsstr(haystack, needle)); @@ -542,8 +530,7 @@ int SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) #endif /* HAVE__WCSNICMP */ } -size_t -SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) +size_t SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) { #ifdef HAVE_STRLCPY return strlcpy(dst, src, maxlen); @@ -558,8 +545,7 @@ SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) #endif /* HAVE_STRLCPY */ } -size_t -SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes) +size_t SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes) { size_t src_bytes = SDL_strlen(src); size_t bytes = SDL_min(src_bytes, dst_bytes - 1); @@ -590,8 +576,7 @@ SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_ return bytes; } -size_t -SDL_utf8strlen(const char *str) +size_t SDL_utf8strlen(const char *str) { size_t retval = 0; const char *p = str; @@ -607,8 +592,7 @@ SDL_utf8strlen(const char *str) return retval; } -size_t -SDL_utf8strnlen(const char *str, size_t bytes) +size_t SDL_utf8strnlen(const char *str, size_t bytes) { size_t retval = 0; const char *p = str; @@ -624,8 +608,7 @@ SDL_utf8strnlen(const char *str, size_t bytes) return retval; } -size_t -SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) +size_t SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) { #ifdef HAVE_STRLCAT return strlcat(dst, src, maxlen); @@ -639,8 +622,7 @@ SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) #endif /* HAVE_STRLCAT */ } -char * -SDL_strdup(const char *string) +char *SDL_strdup(const char *string) { size_t len = SDL_strlen(string) + 1; char *newstr = (char *)SDL_malloc(len); @@ -650,8 +632,7 @@ SDL_strdup(const char *string) return newstr; } -char * -SDL_strrev(char *string) +char *SDL_strrev(char *string) { #ifdef HAVE__STRREV return _strrev(string); @@ -669,8 +650,7 @@ SDL_strrev(char *string) #endif /* HAVE__STRREV */ } -char * -SDL_strupr(char *string) +char *SDL_strupr(char *string) { #ifdef HAVE__STRUPR return _strupr(string); @@ -684,8 +664,7 @@ SDL_strupr(char *string) #endif /* HAVE__STRUPR */ } -char * -SDL_strlwr(char *string) +char *SDL_strlwr(char *string) { #ifdef HAVE__STRLWR return _strlwr(string); @@ -699,8 +678,7 @@ SDL_strlwr(char *string) #endif /* HAVE__STRLWR */ } -char * -SDL_strchr(const char *string, int c) +char *SDL_strchr(const char *string, int c) { #ifdef HAVE_STRCHR return SDL_const_cast(char *, strchr(string, c)); @@ -720,8 +698,7 @@ SDL_strchr(const char *string, int c) #endif /* HAVE_STRCHR */ } -char * -SDL_strrchr(const char *string, int c) +char *SDL_strrchr(const char *string, int c) { #ifdef HAVE_STRRCHR return SDL_const_cast(char *, strrchr(string, c)); @@ -739,8 +716,7 @@ SDL_strrchr(const char *string, int c) #endif /* HAVE_STRRCHR */ } -char * -SDL_strstr(const char *haystack, const char *needle) +char *SDL_strstr(const char *haystack, const char *needle) { #ifdef HAVE_STRSTR return SDL_const_cast(char *, strstr(haystack, needle)); @@ -756,8 +732,7 @@ SDL_strstr(const char *haystack, const char *needle) #endif /* HAVE_STRSTR */ } -char * -SDL_strcasestr(const char *haystack, const char *needle) +char *SDL_strcasestr(const char *haystack, const char *needle) { #ifdef HAVE_STRCASESTR return SDL_const_cast(char *, strcasestr(haystack, needle)); @@ -783,8 +758,7 @@ static const char ntoa_table[] = { }; #endif /* ntoa() conversion table */ -char * -SDL_itoa(int value, char *string, int radix) +char *SDL_itoa(int value, char *string, int radix) { #ifdef HAVE_ITOA return itoa(value, string, radix); @@ -793,8 +767,7 @@ SDL_itoa(int value, char *string, int radix) #endif /* HAVE_ITOA */ } -char * -SDL_uitoa(unsigned int value, char *string, int radix) +char *SDL_uitoa(unsigned int value, char *string, int radix) { #ifdef HAVE__UITOA return _uitoa(value, string, radix); @@ -803,8 +776,7 @@ SDL_uitoa(unsigned int value, char *string, int radix) #endif /* HAVE__UITOA */ } -char * -SDL_ltoa(long value, char *string, int radix) +char *SDL_ltoa(long value, char *string, int radix) { #ifdef HAVE__LTOA return _ltoa(value, string, radix); @@ -822,8 +794,7 @@ SDL_ltoa(long value, char *string, int radix) #endif /* HAVE__LTOA */ } -char * -SDL_ultoa(unsigned long value, char *string, int radix) +char *SDL_ultoa(unsigned long value, char *string, int radix) { #ifdef HAVE__ULTOA return _ultoa(value, string, radix); @@ -847,8 +818,7 @@ SDL_ultoa(unsigned long value, char *string, int radix) #endif /* HAVE__ULTOA */ } -char * -SDL_lltoa(Sint64 value, char *string, int radix) +char *SDL_lltoa(Sint64 value, char *string, int radix) { #ifdef HAVE__I64TOA return _i64toa(value, string, radix); @@ -866,8 +836,7 @@ SDL_lltoa(Sint64 value, char *string, int radix) #endif /* HAVE__I64TOA */ } -char * -SDL_ulltoa(Uint64 value, char *string, int radix) +char *SDL_ulltoa(Uint64 value, char *string, int radix) { #ifdef HAVE__UI64TOA return _ui64toa(value, string, radix); @@ -1477,8 +1446,7 @@ typedef struct int precision; } SDL_FormatInfo; -static size_t -SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string) +static size_t SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string) { size_t length = 0; size_t slen, sz; @@ -1563,8 +1531,7 @@ static void SDL_IntPrecisionAdjust(char *num, size_t maxlen, SDL_FormatInfo *inf } } -static size_t -SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) +static size_t SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) { char num[130], *p = num; @@ -1577,8 +1544,7 @@ SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value) +static size_t SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value) { char num[130]; @@ -1587,8 +1553,7 @@ SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) +static size_t SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) { char num[130], *p = num; @@ -1601,8 +1566,7 @@ SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value) +static size_t SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value) { char num[130]; @@ -1611,8 +1575,7 @@ SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint6 return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg, SDL_bool g) +static size_t SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg, SDL_bool g) { char num[327]; size_t length = 0; diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 02d390cd2..7533d0446 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -64,8 +64,7 @@ static void SDL_snprintfcat(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL va_end(ap); } -SDLTest_CommonState * -SDLTest_CommonCreateState(char **argv, Uint32 flags) +SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags) { int i; SDLTest_CommonState *state; @@ -124,8 +123,7 @@ SDLTest_CommonCreateState(char **argv, Uint32 flags) return state; } -void -SDLTest_CommonDestroyState(SDLTest_CommonState *state) { +void SDLTest_CommonDestroyState(SDLTest_CommonState *state) { SDLTest_LogAllocations(); SDL_free(state); } @@ -674,8 +672,7 @@ static char *common_usage_video = NULL; static char *common_usage_audio = NULL; static char *common_usage_videoaudio = NULL; -SDL_bool -SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv) +SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv) { int i = 1; while (i < argc) { @@ -1115,8 +1112,7 @@ static SDL_HitTestResult SDLCALL SDLTest_ExampleHitTestCallback(SDL_Window *win, return SDL_HITTEST_NORMAL; } -SDL_bool -SDLTest_CommonInit(SDLTest_CommonState *state) +SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) { int i, j, m, n, w, h; const SDL_DisplayMode *fullscreen_mode; diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index f3d5940b5..74716aff4 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -440,14 +440,12 @@ SDLTest_RandomDouble(void) return r; } -char * -SDLTest_RandomAsciiString(void) +char *SDLTest_RandomAsciiString(void) { return SDLTest_RandomAsciiStringWithMaximumLength(255); } -char * -SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) +char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) { int size; @@ -463,8 +461,7 @@ SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) return SDLTest_RandomAsciiStringOfSize(size); } -char * -SDLTest_RandomAsciiStringOfSize(int size) +char *SDLTest_RandomAsciiStringOfSize(int size) { char *string; int counter; diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index 658303ff6..4b8be17c1 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -60,8 +60,7 @@ static Uint32 SDLTest_TestCaseTimeout = 3600; * * \returns The generated seed string */ -char * -SDLTest_GenerateRunSeed(const int length) +char *SDLTest_GenerateRunSeed(const int length) { char *seed = NULL; SDLTest_RandomContext randomContext; diff --git a/src/test/SDL_test_log.c b/src/test/SDL_test_log.c index 3923f703a..54261f599 100644 --- a/src/test/SDL_test_log.c +++ b/src/test/SDL_test_log.c @@ -35,8 +35,7 @@ /* work around compiler warning on older GCCs. */ #if (defined(__GNUC__) && (__GNUC__ <= 2)) -static size_t -strftime_gcc2_workaround(char *s, size_t max, const char *fmt, const struct tm *tm) +static size_t strftime_gcc2_workaround(char *s, size_t max, const char *fmt, const struct tm *tm) { return strftime(s, max, fmt, tm); } @@ -57,8 +56,7 @@ strftime_gcc2_workaround(char *s, size_t max, const char *fmt, const struct tm * * * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02' */ -static const char * -SDLTest_TimestampToString(const time_t timestamp) +static const char *SDLTest_TimestampToString(const time_t timestamp) { time_t copy; static char buffer[64]; diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 172187d15..465a9eaad 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -26,8 +26,7 @@ #include "SDL_systhread.h" #include "../SDL_error_c.h" -SDL_TLSID -SDL_TLSCreate(void) +SDL_TLSID SDL_TLSCreate(void) { static SDL_AtomicInt SDL_tls_id; return SDL_AtomicIncRef(&SDL_tls_id) + 1; @@ -112,8 +111,7 @@ typedef struct SDL_TLSEntry static SDL_Mutex *SDL_generic_TLS_mutex; static SDL_TLSEntry *SDL_generic_TLS; -SDL_TLSData * -SDL_Generic_GetTLSData(void) +SDL_TLSData *SDL_Generic_GetTLSData(void) { SDL_threadID thread = SDL_ThreadID(); SDL_TLSEntry *entry; @@ -215,8 +213,7 @@ static void SDLCALL SDL_FreeErrBuf(void *data) #endif /* Routine to get the thread-specific error variable */ -SDL_error * -SDL_GetErrBuf(void) +SDL_error *SDL_GetErrBuf(void) { #ifdef SDL_THREADS_DISABLED return SDL_GetStaticErrBuf(); @@ -317,14 +314,12 @@ void SDL_RunThread(SDL_Thread *thread) #endif #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -SDL_Thread * -SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), +SDL_Thread *SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), const char *name, const size_t stacksize, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) #else -SDL_Thread * -SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), +SDL_Thread *SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), const char *name, const size_t stacksize, void *data) #endif { @@ -372,14 +367,12 @@ SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), } #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(int(SDLCALL *fn)(void *), +DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *), const char *name, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) #else -DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(int(SDLCALL *fn)(void *), +DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *), const char *name, void *data) #endif { @@ -405,8 +398,7 @@ SDL_CreateThread(int(SDLCALL *fn)(void *), #endif } -SDL_Thread * -SDL_CreateThreadInternal(int(SDLCALL *fn)(void *), const char *name, +SDL_Thread *SDL_CreateThreadInternal(int(SDLCALL *fn)(void *), const char *name, const size_t stacksize, void *data) { #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD @@ -416,8 +408,7 @@ SDL_CreateThreadInternal(int(SDLCALL *fn)(void *), const char *name, #endif } -SDL_threadID -SDL_GetThreadID(SDL_Thread *thread) +SDL_threadID SDL_GetThreadID(SDL_Thread *thread) { SDL_threadID id; @@ -429,8 +420,7 @@ SDL_GetThreadID(SDL_Thread *thread) return id; } -const char * -SDL_GetThreadName(SDL_Thread *thread) +const char *SDL_GetThreadName(SDL_Thread *thread) { if (thread) { return thread->name; diff --git a/src/thread/generic/SDL_syscond.c b/src/thread/generic/SDL_syscond.c index 50a865f2c..6535008a7 100644 --- a/src/thread/generic/SDL_syscond.c +++ b/src/thread/generic/SDL_syscond.c @@ -50,8 +50,7 @@ typedef struct SDL_cond_generic } SDL_cond_generic; /* Create a condition variable */ -SDL_Condition * -SDL_CreateCondition_generic(void) +SDL_Condition *SDL_CreateCondition_generic(void) { SDL_cond_generic *cond; diff --git a/src/thread/generic/SDL_sysmutex.c b/src/thread/generic/SDL_sysmutex.c index 10d06179c..a735db973 100644 --- a/src/thread/generic/SDL_sysmutex.c +++ b/src/thread/generic/SDL_sysmutex.c @@ -32,8 +32,7 @@ struct SDL_Mutex }; /* Create a mutex */ -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { SDL_Mutex *mutex; diff --git a/src/thread/generic/SDL_syssem.c b/src/thread/generic/SDL_syssem.c index 20833b7eb..3dae50be4 100644 --- a/src/thread/generic/SDL_syssem.c +++ b/src/thread/generic/SDL_syssem.c @@ -26,8 +26,7 @@ #ifdef SDL_THREADS_DISABLED -SDL_Semaphore * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) { SDL_SetError("SDL not built with thread support"); return (SDL_Semaphore *)0; @@ -62,8 +61,7 @@ struct SDL_Semaphore SDL_Condition *count_nonzero; }; -SDL_Semaphore * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) { SDL_Semaphore *sem; diff --git a/src/thread/generic/SDL_systhread.c b/src/thread/generic/SDL_systhread.c index 24e9bc94f..ce2c8df22 100644 --- a/src/thread/generic/SDL_systhread.c +++ b/src/thread/generic/SDL_systhread.c @@ -40,8 +40,7 @@ void SDL_SYS_SetupThread(const char *name) return; } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { return 0; } diff --git a/src/thread/generic/SDL_systls.c b/src/thread/generic/SDL_systls.c index 1186d7aa7..7ccfd48b3 100644 --- a/src/thread/generic/SDL_systls.c +++ b/src/thread/generic/SDL_systls.c @@ -22,8 +22,7 @@ #include "SDL_internal.h" #include "../SDL_thread_c.h" -SDL_TLSData * -SDL_SYS_GetTLSData(void) +SDL_TLSData *SDL_SYS_GetTLSData(void) { return SDL_Generic_GetTLSData(); } diff --git a/src/thread/n3ds/SDL_syscond.c b/src/thread/n3ds/SDL_syscond.c index e6d68677b..e170ab55e 100644 --- a/src/thread/n3ds/SDL_syscond.c +++ b/src/thread/n3ds/SDL_syscond.c @@ -32,8 +32,7 @@ struct SDL_Condition }; /* Create a condition variable */ -SDL_Condition * -SDL_CreateCondition(void) +SDL_Condition *SDL_CreateCondition(void) { SDL_Condition *cond = (SDL_Condition *)SDL_malloc(sizeof(SDL_Condition)); if (cond) { diff --git a/src/thread/n3ds/SDL_sysmutex.c b/src/thread/n3ds/SDL_sysmutex.c index 578be1308..0995ad11f 100644 --- a/src/thread/n3ds/SDL_sysmutex.c +++ b/src/thread/n3ds/SDL_sysmutex.c @@ -27,8 +27,7 @@ #include "SDL_sysmutex_c.h" /* Create a mutex */ -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { SDL_Mutex *mutex; diff --git a/src/thread/n3ds/SDL_systhread.c b/src/thread/n3ds/SDL_systhread.c index 2d2e6280f..1f74ae37e 100644 --- a/src/thread/n3ds/SDL_systhread.c +++ b/src/thread/n3ds/SDL_systhread.c @@ -67,8 +67,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread) return 0; } -static size_t -GetStackSize(size_t requested_size) +static size_t GetStackSize(size_t requested_size) { if (requested_size == 0) { return N3DS_THREAD_STACK_SIZE_DEFAULT; @@ -90,8 +89,7 @@ void SDL_SYS_SetupThread(const char *name) return; } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { u32 thread_ID = 0; svcGetThreadId(&thread_ID, CUR_THREAD_HANDLE); diff --git a/src/thread/ngage/SDL_sysmutex.cpp b/src/thread/ngage/SDL_sysmutex.cpp index 19d893030..9cc47d424 100644 --- a/src/thread/ngage/SDL_sysmutex.cpp +++ b/src/thread/ngage/SDL_sysmutex.cpp @@ -39,8 +39,7 @@ static TInt NewMutex(const TDesC &aName, TAny *aPtr1, TAny *) } /* Create a mutex */ -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { RMutex rmutex; @@ -83,8 +82,7 @@ int SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn /* Try to lock the mutex */ #if 0 -int -SDL_TryLockMutex(SDL_Mutex *mutex) +int SDL_TryLockMutex(SDL_Mutex *mutex) { if (mutex == NULL) { diff --git a/src/thread/ngage/SDL_syssem.cpp b/src/thread/ngage/SDL_syssem.cpp index 32eae6b77..8b15be46e 100644 --- a/src/thread/ngage/SDL_syssem.cpp +++ b/src/thread/ngage/SDL_syssem.cpp @@ -75,8 +75,7 @@ static void WaitAll(SDL_Semaphore *sem) } } -SDL_Semaphore * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) { RSemaphore s; TInt status = CreateUnique(NewSema, &s, &initial_value); diff --git a/src/thread/ngage/SDL_systhread.cpp b/src/thread/ngage/SDL_systhread.cpp index 4fc92c290..6ce6fdab7 100644 --- a/src/thread/ngage/SDL_systhread.cpp +++ b/src/thread/ngage/SDL_systhread.cpp @@ -78,8 +78,7 @@ void SDL_SYS_SetupThread(const char *name) return; } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { RThread current; TThreadId id = current.Id(); diff --git a/src/thread/psp/SDL_syscond.c b/src/thread/psp/SDL_syscond.c index 50fecf1db..a5389444c 100644 --- a/src/thread/psp/SDL_syscond.c +++ b/src/thread/psp/SDL_syscond.c @@ -38,8 +38,7 @@ struct SDL_Condition }; /* Create a condition variable */ -SDL_Condition * -SDL_CreateCondition(void) +SDL_Condition *SDL_CreateCondition(void) { SDL_Condition *cond; diff --git a/src/thread/psp/SDL_sysmutex.c b/src/thread/psp/SDL_sysmutex.c index 1555abec7..8aaa96224 100644 --- a/src/thread/psp/SDL_sysmutex.c +++ b/src/thread/psp/SDL_sysmutex.c @@ -37,8 +37,7 @@ struct SDL_Mutex }; /* Create a mutex */ -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { SDL_Mutex *mutex = NULL; SceInt32 res = 0; diff --git a/src/thread/pthread/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c index faf439482..f41602494 100644 --- a/src/thread/pthread/SDL_syscond.c +++ b/src/thread/pthread/SDL_syscond.c @@ -34,8 +34,7 @@ struct SDL_Condition }; /* Create a condition variable */ -SDL_Condition * -SDL_CreateCondition(void) +SDL_Condition *SDL_CreateCondition(void) { SDL_Condition *cond; diff --git a/src/thread/pthread/SDL_sysmutex.c b/src/thread/pthread/SDL_sysmutex.c index ed79e18c9..5e3dd696e 100644 --- a/src/thread/pthread/SDL_sysmutex.c +++ b/src/thread/pthread/SDL_sysmutex.c @@ -25,8 +25,7 @@ #include "SDL_sysmutex_c.h" -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { SDL_Mutex *mutex; pthread_mutexattr_t attr; diff --git a/src/thread/pthread/SDL_sysrwlock.c b/src/thread/pthread/SDL_sysrwlock.c index 3ddda2e45..3624d369e 100644 --- a/src/thread/pthread/SDL_sysrwlock.c +++ b/src/thread/pthread/SDL_sysrwlock.c @@ -29,8 +29,7 @@ struct SDL_RWLock }; -SDL_RWLock * -SDL_CreateRWLock(void) +SDL_RWLock *SDL_CreateRWLock(void) { SDL_RWLock *rwlock; diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index 64f6a4ab2..b1b38fa53 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -39,8 +39,7 @@ struct SDL_Semaphore }; /* Create a semaphore, initialized with value */ -SDL_Semaphore * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) { SDL_Semaphore *sem = (SDL_Semaphore *)SDL_malloc(sizeof(SDL_Semaphore)); if (sem != NULL) { diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index c79a5b7a9..b4b6193a5 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -168,8 +168,7 @@ void SDL_SYS_SetupThread(const char *name) #endif } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { return (SDL_threadID)pthread_self(); } diff --git a/src/thread/pthread/SDL_systls.c b/src/thread/pthread/SDL_systls.c index 78bf02658..17b3b64b1 100644 --- a/src/thread/pthread/SDL_systls.c +++ b/src/thread/pthread/SDL_systls.c @@ -29,8 +29,7 @@ static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY; static SDL_bool generic_local_storage = SDL_FALSE; -SDL_TLSData * -SDL_SYS_GetTLSData(void) +SDL_TLSData *SDL_SYS_GetTLSData(void) { if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { static SDL_SpinLock lock; diff --git a/src/thread/vita/SDL_syscond.c b/src/thread/vita/SDL_syscond.c index 3d374b6c0..dd32da5d0 100644 --- a/src/thread/vita/SDL_syscond.c +++ b/src/thread/vita/SDL_syscond.c @@ -38,8 +38,7 @@ struct SDL_Condition }; /* Create a condition variable */ -SDL_Condition * -SDL_CreateCondition(void) +SDL_Condition *SDL_CreateCondition(void) { SDL_Condition *cond; diff --git a/src/thread/vita/SDL_sysmutex.c b/src/thread/vita/SDL_sysmutex.c index 8d614caea..5e5ee47f9 100644 --- a/src/thread/vita/SDL_sysmutex.c +++ b/src/thread/vita/SDL_sysmutex.c @@ -33,8 +33,7 @@ struct SDL_Mutex }; /* Create a mutex */ -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { SDL_Mutex *mutex = NULL; SceInt32 res = 0; diff --git a/src/thread/windows/SDL_syscond_cv.c b/src/thread/windows/SDL_syscond_cv.c index dd5809d40..b0142d8b9 100644 --- a/src/thread/windows/SDL_syscond_cv.c +++ b/src/thread/windows/SDL_syscond_cv.c @@ -206,8 +206,7 @@ static const SDL_cond_impl_t SDL_cond_impl_generic = { }; #endif -SDL_Condition * -SDL_CreateCondition(void) +SDL_Condition *SDL_CreateCondition(void) { if (SDL_cond_impl_active.Create == NULL) { const SDL_cond_impl_t *impl = NULL; diff --git a/src/thread/windows/SDL_sysmutex.c b/src/thread/windows/SDL_sysmutex.c index 6fda0c9ff..16cc81f93 100644 --- a/src/thread/windows/SDL_sysmutex.c +++ b/src/thread/windows/SDL_sysmutex.c @@ -220,8 +220,7 @@ static const SDL_mutex_impl_t SDL_mutex_impl_cs = { * Runtime selection and redirection */ -SDL_Mutex * -SDL_CreateMutex(void) +SDL_Mutex *SDL_CreateMutex(void) { if (SDL_mutex_impl_active.Create == NULL) { /* Default to fallback implementation */ diff --git a/src/thread/windows/SDL_syssem.c b/src/thread/windows/SDL_syssem.c index 103af9b03..b1097e315 100644 --- a/src/thread/windows/SDL_syssem.c +++ b/src/thread/windows/SDL_syssem.c @@ -328,8 +328,7 @@ static const SDL_sem_impl_t SDL_sem_impl_kern = { * Runtime selection and redirection */ -SDL_Semaphore * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) { if (SDL_sem_impl_active.Create == NULL) { /* Default to fallback implementation */ diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 1f19afc08..f111c627a 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -162,8 +162,7 @@ void SDL_SYS_SetupThread(const char *name) } } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { return (SDL_threadID)GetCurrentThreadId(); } diff --git a/src/thread/windows/SDL_systls.c b/src/thread/windows/SDL_systls.c index 13279dcae..3a0dcc976 100644 --- a/src/thread/windows/SDL_systls.c +++ b/src/thread/windows/SDL_systls.c @@ -42,8 +42,7 @@ static DWORD thread_local_storage = TLS_OUT_OF_INDEXES; static SDL_bool generic_local_storage = SDL_FALSE; -SDL_TLSData * -SDL_SYS_GetTLSData(void) +SDL_TLSData *SDL_SYS_GetTLSData(void) { if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { static SDL_SpinLock lock; diff --git a/src/video/SDL_blit_0.c b/src/video/SDL_blit_0.c index 9851737bd..cebab0a63 100644 --- a/src/video/SDL_blit_0.c +++ b/src/video/SDL_blit_0.c @@ -506,8 +506,7 @@ static void Blit4bto4Key(SDL_BlitInfo *info) } } -SDL_BlitFunc -SDL_CalculateBlit0(SDL_Surface *surface) +SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface) { int which; diff --git a/src/video/SDL_blit_1.c b/src/video/SDL_blit_1.c index c59a41762..2c54a2e84 100644 --- a/src/video/SDL_blit_1.c +++ b/src/video/SDL_blit_1.c @@ -512,8 +512,7 @@ static const SDL_BlitFunc one_blitkey[] = { (SDL_BlitFunc)NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key }; -SDL_BlitFunc -SDL_CalculateBlit1(SDL_Surface *surface) +SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface) { int which; SDL_PixelFormat *dstfmt; diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 6de643146..ef0b8de4e 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1316,8 +1316,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) } } -SDL_BlitFunc -SDL_CalculateBlitA(SDL_Surface *surface) +SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) { SDL_PixelFormat *sf = surface->format; SDL_PixelFormat *df = surface->map->dst->format; diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 64dde718c..9f1000da5 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -48,8 +48,7 @@ enum blit_features #ifdef SDL_ALTIVEC_BLITTERS #ifdef __MACOS__ #include -static size_t -GetL3CacheSize(void) +static size_t GetL3CacheSize(void) { const char key[] = "hw.l3cachesize"; u_int64_t result = 0; @@ -63,8 +62,7 @@ GetL3CacheSize(void) return result; } #else -static size_t -GetL3CacheSize(void) +static size_t GetL3CacheSize(void) { /* XXX: Just guess G4 */ return 2097152; @@ -3336,8 +3334,7 @@ static const struct blit_table *const normal_blit[] = { /* Mask matches table, or table entry is zero */ #define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000)) -SDL_BlitFunc -SDL_CalculateBlitN(SDL_Surface *surface) +SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface) { SDL_PixelFormat *srcfmt; SDL_PixelFormat *dstfmt; diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 5ee6222fc..5c33c72b6 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -193,8 +193,7 @@ static void CorrectAlphaChannel(SDL_Surface *surface) } } -SDL_Surface * -SDL_LoadBMP_RW(SDL_RWops *src, int freesrc) +SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, int freesrc) { SDL_bool was_error; Sint64 fp_offset = 0; diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index 2e798b29f..d6809e1b4 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -22,8 +22,7 @@ #include "SDL_sysvideo.h" -int -SDL_SetClipboardData(SDL_ClipboardDataCallback callback, size_t mime_count, const char **mime_types, void *userdata) +int SDL_SetClipboardData(SDL_ClipboardDataCallback callback, size_t mime_count, const char **mime_types, void *userdata) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -93,8 +92,7 @@ void *SDL_GetClipboardData(size_t *length, const char *mime_type) } } -char * -SDL_GetClipboardText(void) +char *SDL_GetClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -114,8 +112,7 @@ SDL_GetClipboardText(void) } } -char * -SDL_GetPrimarySelectionText(void) +char *SDL_GetPrimarySelectionText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -135,8 +132,7 @@ SDL_GetPrimarySelectionText(void) } } -SDL_bool -SDL_HasClipboardData(const char *mime_type) +SDL_bool SDL_HasClipboardData(const char *mime_type) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); if (_this == NULL) { @@ -150,8 +146,7 @@ SDL_HasClipboardData(const char *mime_type) return SDL_FALSE; } -SDL_bool -SDL_HasClipboardText(void) +SDL_bool SDL_HasClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -171,8 +166,7 @@ SDL_HasClipboardText(void) } } -SDL_bool -SDL_HasPrimarySelectionText(void) +SDL_bool SDL_HasPrimarySelectionText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index c59e518c8..19b804286 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -949,8 +949,7 @@ int SDL_EGL_ChooseConfig(SDL_VideoDevice *_this) return SDL_EGL_SetError("Couldn't find matching EGL config", "eglChooseConfig"); } -SDL_GLContext -SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface) +SDL_GLContext SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface) { /* max 16 key+value pairs plus terminator. */ EGLint attribs[33]; @@ -1217,8 +1216,7 @@ int SDL_EGL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) return 0; } -EGLSurface * -SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw) +EGLSurface *SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw) { #ifdef SDL_VIDEO_DRIVER_ANDROID EGLint format_wanted; diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index deb7da735..c83742759 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -83,8 +83,7 @@ Uint8 *SDL_expand_byte[9] = { #define CASE(X) \ case X: \ return #X; -const char * -SDL_GetPixelFormatName(Uint32 format) +const char *SDL_GetPixelFormatName(Uint32 format) { switch (format) { @@ -134,9 +133,8 @@ SDL_GetPixelFormatName(Uint32 format) } #undef CASE -SDL_bool -SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask, - Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) +SDL_bool SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask, + Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) { Uint32 masks[4]; @@ -509,8 +507,7 @@ Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint3 static SDL_PixelFormat *formats; static SDL_SpinLock formats_lock = 0; -SDL_PixelFormat * -SDL_CreatePixelFormat(Uint32 pixel_format) +SDL_PixelFormat *SDL_CreatePixelFormat(Uint32 pixel_format) { SDL_PixelFormat *format; @@ -657,8 +654,7 @@ void SDL_DestroyPixelFormat(SDL_PixelFormat *format) return; } -SDL_Palette * -SDL_CreatePalette(int ncolors) +SDL_Palette *SDL_CreatePalette(int ncolors) { SDL_Palette *palette; @@ -998,8 +994,7 @@ static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical return Map1to1(&dithered, pal, identical); } -SDL_BlitMap * -SDL_AllocBlitMap(void) +SDL_BlitMap *SDL_AllocBlitMap(void) { SDL_BlitMap *map; diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c index 6149af36b..af3a809c7 100644 --- a/src/video/SDL_rect.c +++ b/src/video/SDL_rect.c @@ -24,8 +24,7 @@ /* There's no float version of this at the moment, because it's not a public API and internally we only need the int version. */ -SDL_bool -SDL_GetSpanEnclosingRect(int width, int height, +SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect *rects, SDL_Rect *span) { int i; diff --git a/src/video/SDL_rect_impl.h b/src/video/SDL_rect_impl.h index eb2a71120..4b8713c37 100644 --- a/src/video/SDL_rect_impl.h +++ b/src/video/SDL_rect_impl.h @@ -21,8 +21,7 @@ /* This file is #included twice to support int and float versions with the same code. */ -SDL_bool -SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) +SDL_bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -67,8 +66,7 @@ SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) return SDL_TRUE; } -SDL_bool -SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) +SDL_bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -287,9 +285,7 @@ static int COMPUTEOUTCODE(const RECTTYPE *rect, SCALARTYPE x, SCALARTYPE y) return code; } -SDL_bool -SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, - SCALARTYPE *Y2) +SDL_bool SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, SCALARTYPE *Y2) { SCALARTYPE x = 0; SCALARTYPE y = 0; diff --git a/src/video/SDL_shape.c b/src/video/SDL_shape.c index eeab2d839..3082c1bdc 100644 --- a/src/video/SDL_shape.c +++ b/src/video/SDL_shape.c @@ -23,8 +23,7 @@ #include "SDL_sysvideo.h" #include "SDL_shape_internals.h" -SDL_Window * -SDL_CreateShapedWindow(const char *title, int w, int h, Uint32 flags) +SDL_Window *SDL_CreateShapedWindow(const char *title, int w, int h, Uint32 flags) { SDL_Window *result = NULL; result = SDL_CreateWindow(title, w, h, (flags | SDL_WINDOW_BORDERLESS | SDL_WINDOW_HIDDEN) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE)); @@ -47,8 +46,7 @@ SDL_CreateShapedWindow(const char *title, int w, int h, Uint32 flags) return NULL; } -SDL_bool -SDL_IsShapedWindow(const SDL_Window *window) +SDL_bool SDL_IsShapedWindow(const SDL_Window *window) { if (window == NULL) { return SDL_FALSE; @@ -210,8 +208,7 @@ static SDL_ShapeTree *RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode, SD return result; } -SDL_ShapeTree * -SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape) +SDL_ShapeTree *SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape) { SDL_Rect dimensions; SDL_ShapeTree *result = NULL; diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 13afb9ba8..3b628c262 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -191,8 +191,7 @@ static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, // OK with clang 12.0.0 / Xcode __attribute__((noinline)) #endif -static void -get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_pad, int *right_pad) +static void get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_pad, int *right_pad) { int step = FIXED_POINT(src_nb) / (dst_nb); /* source step in fixed point */ @@ -568,8 +567,7 @@ static SDL_INLINE void INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1 *dst = vget_lane_u32(CAST_uint32x2_t e0, 0); } -static int -scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { BILINEAR___START diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 76eacabbb..c7a305add 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -42,8 +42,7 @@ SDL_COMPILE_TIME_ASSERT(can_indicate_overflow, SDL_SIZE_MAX > SDL_MAX_SINT32); * * for FOURCC, use SDL_CalculateYUVSize() */ -static int -SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size_t *size, size_t *pitch, SDL_bool minimal) +static int SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size_t *size, size_t *pitch, SDL_bool minimal) { if (SDL_BITSPERPIXEL(format) >= 8) { if (SDL_size_mul_overflow(width, SDL_BYTESPERPIXEL(format), pitch)) { @@ -113,8 +112,7 @@ int SDL_CalculateSize(Uint32 format, int width, int height, size_t *size, size_t * Create an empty RGB surface of the appropriate depth using the given * enum SDL_PIXELFORMAT_* format */ -SDL_Surface * -SDL_CreateSurface(int width, int height, Uint32 format) +SDL_Surface *SDL_CreateSurface(int width, int height, Uint32 format) { size_t pitch, size; SDL_Surface *surface; @@ -206,8 +204,7 @@ SDL_CreateSurface(int width, int height, Uint32 format) * Create an RGB surface from an existing memory buffer using the given given * enum SDL_PIXELFORMAT_* format */ -SDL_Surface * -SDL_CreateSurfaceFrom(void *pixels, +SDL_Surface *SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, Uint32 format) { @@ -285,8 +282,7 @@ int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag) return 0; } -SDL_bool -SDL_SurfaceHasRLE(SDL_Surface *surface) +SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface) { if (surface == NULL) { return SDL_FALSE; @@ -329,8 +325,7 @@ int SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key) return 0; } -SDL_bool -SDL_SurfaceHasColorKey(SDL_Surface *surface) +SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) { if (surface == NULL) { return SDL_FALSE; @@ -595,8 +590,7 @@ int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) return 0; } -SDL_bool -SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) +SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) { SDL_Rect full_rect; @@ -1087,8 +1081,7 @@ void SDL_UnlockSurface(SDL_Surface *surface) /* * Creates a new surface identical to the existing surface */ -SDL_Surface * -SDL_DuplicateSurface(SDL_Surface *surface) +SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface) { return SDL_ConvertSurface(surface, surface->format); } @@ -1096,8 +1089,7 @@ SDL_DuplicateSurface(SDL_Surface *surface) /* * Convert a surface into the specified pixel format. */ -SDL_Surface * -SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format) +SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format) { SDL_Surface *convert; Uint32 copy_flags; @@ -1350,8 +1342,7 @@ end: return convert; } -SDL_Surface * -SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format) +SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format) { SDL_PixelFormat *fmt; SDL_Surface *convert = NULL; diff --git a/src/video/android/SDL_androidclipboard.c b/src/video/android/SDL_androidclipboard.c index 92792eb35..4dffa4366 100644 --- a/src/video/android/SDL_androidclipboard.c +++ b/src/video/android/SDL_androidclipboard.c @@ -31,8 +31,7 @@ int Android_SetClipboardText(SDL_VideoDevice *_this, const char *text) return Android_JNI_SetClipboardText(text); } -char * -Android_GetClipboardText(SDL_VideoDevice *_this) +char *Android_GetClipboardText(SDL_VideoDevice *_this) { return Android_JNI_GetClipboardText(); } diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c index b08fc3cf0..2b02f8b6e 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -44,8 +44,7 @@ int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLC } } -SDL_GLContext -Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext ret; diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index f59f2d740..0d602345f 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -336,14 +336,12 @@ int Android_OnKeyUp(int keycode) return SDL_SendKeyboardKey(0, SDL_RELEASED, TranslateKeycode(keycode)); } -SDL_bool -Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this) +SDL_bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } -SDL_bool -Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) +SDL_bool Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { return Android_JNI_IsScreenKeyboardShown(); } diff --git a/src/video/cocoa/SDL_cocoaclipboard.m b/src/video/cocoa/SDL_cocoaclipboard.m index 1fa7fff32..5926e6fa1 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.m +++ b/src/video/cocoa/SDL_cocoaclipboard.m @@ -92,8 +92,7 @@ int Cocoa_SetClipboardText(SDL_VideoDevice *_this, const char *text) } } -char * -Cocoa_GetClipboardText(SDL_VideoDevice *_this) +char *Cocoa_GetClipboardText(SDL_VideoDevice *_this) { @autoreleasepool { NSPasteboard *pasteboard; @@ -122,8 +121,7 @@ Cocoa_GetClipboardText(SDL_VideoDevice *_this) } } -SDL_bool -Cocoa_HasClipboardText(SDL_VideoDevice *_this) +SDL_bool Cocoa_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = Cocoa_GetClipboardText(_this); diff --git a/src/video/cocoa/SDL_cocoaopengles.m b/src/video/cocoa/SDL_cocoaopengles.m index 9fe2d360c..bf28563e0 100644 --- a/src/video/cocoa/SDL_cocoaopengles.m +++ b/src/video/cocoa/SDL_cocoaopengles.m @@ -57,8 +57,7 @@ int Cocoa_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) return 0; } -SDL_GLContext -Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_GLContext context; @@ -147,8 +146,7 @@ int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) } } -SDL_EGLSurface -Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) +SDL_EGLSurface Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { return ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface; diff --git a/src/video/cocoa/SDL_cocoashape.m b/src/video/cocoa/SDL_cocoashape.m index 6e9dad98a..2e16741b7 100644 --- a/src/video/cocoa/SDL_cocoashape.m +++ b/src/video/cocoa/SDL_cocoashape.m @@ -38,8 +38,7 @@ @implementation SDL_CocoaClosure @end -SDL_WindowShaper * -Cocoa_CreateShaper(SDL_Window *window) +SDL_WindowShaper *Cocoa_CreateShaper(SDL_Window *window) { @autoreleasepool { SDL_WindowShaper *result; diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index c4ad521a9..72b8504d2 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -2483,8 +2483,7 @@ int Cocoa_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMi } } -SDL_bool -Cocoa_IsWindowInFullscreenSpace(SDL_Window *window) +SDL_bool Cocoa_IsWindowInFullscreenSpace(SDL_Window *window) { @autoreleasepool { SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; @@ -2497,8 +2496,7 @@ Cocoa_IsWindowInFullscreenSpace(SDL_Window *window) } } -SDL_bool -Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool state) +SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool state) { @autoreleasepool { SDL_bool succeeded = SDL_FALSE; diff --git a/src/video/haiku/SDL_bmessagebox.cc b/src/video/haiku/SDL_bmessagebox.cc index 47687e75c..3709f2c0a 100644 --- a/src/video/haiku/SDL_bmessagebox.cc +++ b/src/video/haiku/SDL_bmessagebox.cc @@ -346,8 +346,7 @@ protected: extern "C" { #endif -int -HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { // Initialize button by closed or error value first. *buttonid = G_CLOSE_BUTTON_ID; diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 365492808..7ddef3f4c 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -349,8 +349,7 @@ static void KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data) SDL_free(fb_info); } -KMSDRM_FBInfo * -KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) +KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) { SDL_VideoData *viddata = _this->driverdata; unsigned w, h; @@ -401,8 +400,7 @@ static void KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, uns *((SDL_bool *)data) = SDL_FALSE; } -SDL_bool -KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata) +SDL_bool KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata) { SDL_VideoData *viddata = _this->driverdata; diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index 4339bb82e..2e93c528f 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -33,12 +33,12 @@ typedef struct int width, height; } Dimensions; -SDL_FORCE_INLINE void FreePreviousWindowFramebuffer(SDL_Window *window); -SDL_FORCE_INLINE SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window); -SDL_FORCE_INLINE void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim); -SDL_FORCE_INLINE int GetDestOffset(int x, int y, int dest_width); -SDL_FORCE_INLINE int GetSourceOffset(int x, int y, int source_width); -SDL_FORCE_INLINE void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen); +static void FreePreviousWindowFramebuffer(SDL_Window *window); +static SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window); +static void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim); +static int GetDestOffset(int x, int y, int dest_width); +static int GetSourceOffset(int x, int y, int source_width); +static void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen); int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { @@ -58,15 +58,13 @@ int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, return 0; } -SDL_FORCE_INLINE void -FreePreviousWindowFramebuffer(SDL_Window *window) +static void FreePreviousWindowFramebuffer(SDL_Window *window) { SDL_Surface *surface = (SDL_Surface *)SDL_GetWindowData(window, N3DS_SURFACE); SDL_DestroySurface(surface); } -SDL_FORCE_INLINE SDL_Surface * -CreateNewWindowFramebuffer(SDL_Window *window) +static SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window) { int w, h; SDL_GetWindowSizeInPixels(window, &w, &h); @@ -97,8 +95,7 @@ int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, return 0; } -SDL_FORCE_INLINE void -CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim) +static void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim) { int rows = SDL_min(dest_dim.width, source_dim.height); int cols = SDL_min(dest_dim.height, source_dim.width); @@ -112,20 +109,17 @@ CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, c } } -SDL_FORCE_INLINE int -GetDestOffset(int x, int y, int dest_width) +static int GetDestOffset(int x, int y, int dest_width) { return dest_width - y - 1 + dest_width * x; } -SDL_FORCE_INLINE int -GetSourceOffset(int x, int y, int source_width) +static int GetSourceOffset(int x, int y, int source_width) { return x + y * source_width; } -SDL_FORCE_INLINE void -FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen) +static void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen) { GSPGPU_FlushDataCache(buffer, bufsize); gfxScreenSwapBuffers(screen, false); diff --git a/src/video/n3ds/SDL_n3dsswkb.c b/src/video/n3ds/SDL_n3dsswkb.c index de27d9ac2..033fa5b56 100644 --- a/src/video/n3ds/SDL_n3dsswkb.c +++ b/src/video/n3ds/SDL_n3dsswkb.c @@ -45,8 +45,7 @@ void N3DS_SwkbQuit() return; } -SDL_bool -N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this) +SDL_bool N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index 25861aa55..eb669fe09 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -31,7 +31,7 @@ #define N3DSVID_DRIVER_NAME "n3ds" -SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen); +static int AddN3DSDisplay(gfxScreen_t screen); static int N3DS_VideoInit(SDL_VideoDevice *_this); static void N3DS_VideoQuit(SDL_VideoDevice *_this); diff --git a/src/video/offscreen/SDL_offscreenopengles.c b/src/video/offscreen/SDL_offscreenopengles.c index b21a8bf27..3786d5408 100644 --- a/src/video/offscreen/SDL_offscreenopengles.c +++ b/src/video/offscreen/SDL_offscreenopengles.c @@ -54,8 +54,7 @@ int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) return 0; } -SDL_GLContext -OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *offscreen_window = window->driverdata; diff --git a/src/video/qnx/SDL_qnxgl.c b/src/video/qnx/SDL_qnxgl.c index 93507fbee..448322d03 100644 --- a/src/video/qnx/SDL_qnxgl.c +++ b/src/video/qnx/SDL_qnxgl.c @@ -30,8 +30,7 @@ static EGLDisplay egl_disp; * @param egl_conf EGL configuration to use * @return A SCREEN_FORMAT* constant for the pixel format to use */ -static int -chooseFormat(EGLConfig egl_conf) +static int chooseFormat(EGLConfig egl_conf) { EGLint buffer_bit_depth; EGLint alpha_bit_depth; @@ -64,8 +63,7 @@ chooseFormat(EGLConfig egl_conf) * @param[out] pformat The chosen pixel format * @return 0 if successful, -1 on error */ -int -glGetConfig(EGLConfig *pconf, int *pformat) +int glGetConfig(EGLConfig *pconf, int *pformat) { EGLConfig egl_conf = (EGLConfig)0; EGLConfig *egl_configs; @@ -132,8 +130,7 @@ glGetConfig(EGLConfig *pconf, int *pformat) * @param name unused * @return 0 if successful, -1 on error */ -int -glLoadLibrary(SDL_VideoDevice *_this, const char *name) +int glLoadLibrary(SDL_VideoDevice *_this, const char *name) { EGLNativeDisplayType disp_id = EGL_DEFAULT_DISPLAY; @@ -154,8 +151,7 @@ glLoadLibrary(SDL_VideoDevice *_this, const char *name) * @param proc Function name * @return Function address */ -SDL_FunctionPointer -glGetProcAddress(SDL_VideoDevice *_this, const char *proc) +SDL_FunctionPointer glGetProcAddress(SDL_VideoDevice *_this, const char *proc) { return eglGetProcAddress(proc); } @@ -167,8 +163,7 @@ glGetProcAddress(SDL_VideoDevice *_this, const char *proc) * @param window The SDL window to create the context for * @return A pointer to the created context, if successful, NULL on error */ -SDL_GLContext -glCreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext glCreateContext(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; EGLContext context; @@ -215,8 +210,7 @@ glCreateContext(SDL_VideoDevice *_this, SDL_Window *window) * @param interval New interval value * @return 0 if successful, -1 on error */ -int -glSetSwapInterval(SDL_VideoDevice *_this, int interval) +int glSetSwapInterval(SDL_VideoDevice *_this, int interval) { if (eglSwapInterval(egl_disp, interval) != EGL_TRUE) { return -1; @@ -231,8 +225,7 @@ glSetSwapInterval(SDL_VideoDevice *_this, int interval) * @param window Window to swap buffers for * @return 0 if successful, -1 on error */ -int -glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window) +int glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* !!! FIXME: should we migrate this all over to use SDL_egl.c? */ window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -246,8 +239,7 @@ glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window) * @param context The context to activate * @return 0 if successful, -1 on error */ -int -glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) +int glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { window_impl_t *impl; EGLSurface surface = NULL; @@ -269,8 +261,7 @@ glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) * @param SDL_VideoDevice *_this * @param context The context to destroy */ -void -glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) +void glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { eglDestroyContext(egl_disp, context); } @@ -279,8 +270,7 @@ glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) * Terminates access to the EGL library. * @param SDL_VideoDevice *_this */ -void -glUnloadLibrary(SDL_VideoDevice *_this) +void glUnloadLibrary(SDL_VideoDevice *_this) { eglTerminate(egl_disp); } diff --git a/src/video/qnx/SDL_qnxkeyboard.c b/src/video/qnx/SDL_qnxkeyboard.c index d2d1a139b..348af4af1 100644 --- a/src/video/qnx/SDL_qnxkeyboard.c +++ b/src/video/qnx/SDL_qnxkeyboard.c @@ -95,8 +95,7 @@ static int key_to_sdl[] = { * Translates the event such that it can be handled by SDL. * @param event Screen keyboard event */ -void -handleKeyboardEvent(screen_event_t event) +void handleKeyboardEvent(screen_event_t event) { int val; SDL_Scancode scancode; diff --git a/src/video/qnx/SDL_qnxvideo.c b/src/video/qnx/SDL_qnxvideo.c index b17aec410..4c7c2278a 100644 --- a/src/video/qnx/SDL_qnxvideo.c +++ b/src/video/qnx/SDL_qnxvideo.c @@ -32,8 +32,7 @@ static screen_event_t event; * @param SDL_VideoDevice *_this * @return 0 if successful, -1 on error */ -static int -videoInit(SDL_VideoDevice *_this) +static int videoInit(SDL_VideoDevice *_this) { SDL_VideoDisplay display; @@ -55,8 +54,7 @@ videoInit(SDL_VideoDevice *_this) return 0; } -static void -videoQuit(SDL_VideoDevice *_this) +static void videoQuit(SDL_VideoDevice *_this) { } @@ -67,8 +65,7 @@ videoQuit(SDL_VideoDevice *_this) * @param window SDL window to initialize * @return 0 if successful, -1 on error */ -static int -createWindow(SDL_VideoDevice *_this, SDL_Window *window) +static int createWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl; int size[2]; @@ -150,8 +147,7 @@ fail: * @param[out] pitch Holds the number of bytes per line * @return 0 if successful, -1 on error */ -static int -createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, +static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -186,8 +182,7 @@ createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo * @param numrects Rect array length * @return 0 if successful, -1 on error */ -static int -updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, +static int updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -207,8 +202,7 @@ updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Re * Runs the main event loop. * @param SDL_VideoDevice *_this */ -static void -pumpEvents(SDL_VideoDevice *_this) +static void pumpEvents(SDL_VideoDevice *_this) { int type; @@ -242,8 +236,7 @@ pumpEvents(SDL_VideoDevice *_this) * @param SDL_VideoDevice *_this * @param window SDL window to update */ -static void -setWindowSize(SDL_VideoDevice *_this, SDL_Window *window) +static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; int size[2]; @@ -261,8 +254,7 @@ setWindowSize(SDL_VideoDevice *_this, SDL_Window *window) * @param SDL_VideoDevice *_this * @param window SDL window to update */ -static void -showWindow(SDL_VideoDevice *_this, SDL_Window *window) +static void showWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; const int visible = 1; @@ -276,8 +268,7 @@ showWindow(SDL_VideoDevice *_this, SDL_Window *window) * @param SDL_VideoDevice *_this * @param window SDL window to update */ -static void -hideWindow(SDL_VideoDevice *_this, SDL_Window *window) +static void hideWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; const int visible = 0; @@ -291,8 +282,7 @@ hideWindow(SDL_VideoDevice *_this, SDL_Window *window) * @param SDL_VideoDevice *_this * @param window SDL window that is being destroyed */ -static void -destroyWindow(SDL_VideoDevice *_this, SDL_Window *window) +static void destroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -306,8 +296,7 @@ destroyWindow(SDL_VideoDevice *_this, SDL_Window *window) * Frees the plugin object created by createDevice(). * @param device Plugin object to free */ -static void -deleteDevice(SDL_VideoDevice *device) +static void deleteDevice(SDL_VideoDevice *device) { SDL_free(device); } @@ -316,8 +305,7 @@ deleteDevice(SDL_VideoDevice *device) * Creates the QNX video plugin used by SDL. * @return Initialized device if successful, NULL otherwise */ -static SDL_VideoDevice * -createDevice() +static SDL_VideoDevice *createDevice() { SDL_VideoDevice *device; diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index 9d5678ed5..f9d906bb9 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -85,8 +85,7 @@ static SDL_PixelFormatEnum RISCOS_ModeToPixelFormat(int ncolour, int modeflags, return SDL_PIXELFORMAT_UNKNOWN; } -static size_t -measure_mode_block(const int *block) +static size_t measure_mode_block(const int *block) { size_t blockSize = ((block[0] & 0xFF) == 3) ? 7 : 5; while (block[blockSize] != -1) { diff --git a/src/video/uikit/SDL_uikitclipboard.m b/src/video/uikit/SDL_uikitclipboard.m index df8433a99..589c55edf 100644 --- a/src/video/uikit/SDL_uikitclipboard.m +++ b/src/video/uikit/SDL_uikitclipboard.m @@ -39,8 +39,7 @@ int UIKit_SetClipboardText(SDL_VideoDevice *_this, const char *text) #endif } -char * -UIKit_GetClipboardText(SDL_VideoDevice *_this) +char *UIKit_GetClipboardText(SDL_VideoDevice *_this) { #if TARGET_OS_TV return SDL_strdup(""); // Unsupported. @@ -58,8 +57,7 @@ UIKit_GetClipboardText(SDL_VideoDevice *_this) #endif } -SDL_bool -UIKit_HasClipboardText(SDL_VideoDevice *_this) +SDL_bool UIKit_HasClipboardText(SDL_VideoDevice *_this) { @autoreleasepool { #if !TARGET_OS_TV diff --git a/src/video/uikit/SDL_uikitmessagebox.m b/src/video/uikit/SDL_uikitmessagebox.m index ad2a4fa24..b0b612a16 100644 --- a/src/video/uikit/SDL_uikitmessagebox.m +++ b/src/video/uikit/SDL_uikitmessagebox.m @@ -29,8 +29,7 @@ static SDL_bool s_showingMessageBox = SDL_FALSE; -SDL_bool -UIKit_ShowingMessageBox(void) +SDL_bool UIKit_ShowingMessageBox(void) { return s_showingMessageBox; } diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index c04beae7d..6d5ecd9ff 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -257,8 +257,7 @@ void UIKit_DelDisplay(UIScreen *uiscreen) } } -SDL_bool -UIKit_IsDisplayLandscape(UIScreen *uiscreen) +SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen) { #if !TARGET_OS_TV if (uiscreen == [UIScreen mainScreen]) { diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index be0928e5f..497c82458 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -523,8 +523,7 @@ static SDL_uikitviewcontroller *GetWindowViewController(SDL_Window *window) return data.viewcontroller; } -SDL_bool -UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this) +SDL_bool UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { return SDL_TRUE; } @@ -545,8 +544,7 @@ void UIKit_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) } } -SDL_bool -UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) +SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); diff --git a/src/video/vita/SDL_vitagl_pvr.c b/src/video/vita/SDL_vitagl_pvr.c index 482d5a69e..af9897e59 100644 --- a/src/video/vita/SDL_vitagl_pvr.c +++ b/src/video/vita/SDL_vitagl_pvr.c @@ -80,8 +80,7 @@ int VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); } -SDL_GLContext -VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { char gl_version[3]; SDL_GLContext context = NULL; @@ -115,8 +114,7 @@ VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) return context; } -SDL_FunctionPointer -VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) +SDL_FunctionPointer VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) { return gl4es_GetProcAddress(proc); } diff --git a/src/video/vita/SDL_vitagles_pvr.c b/src/video/vita/SDL_vitagles_pvr.c index 80321d694..c862d6cae 100644 --- a/src/video/vita/SDL_vitagles_pvr.c +++ b/src/video/vita/SDL_vitagles_pvr.c @@ -67,8 +67,7 @@ int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); } -SDL_GLContext -VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); } diff --git a/src/video/wayland/SDL_waylanddatamanager.c b/src/video/wayland/SDL_waylanddatamanager.c index 47d6a8bf7..c2d14141d 100644 --- a/src/video/wayland/SDL_waylanddatamanager.c +++ b/src/video/wayland/SDL_waylanddatamanager.c @@ -218,8 +218,7 @@ static void mime_data_list_free(struct wl_list *list) } } -static size_t -Wayland_send_data(void *data, size_t length, int fd) +static size_t Wayland_send_data(void *data, size_t length, int fd) { size_t result = 0; @@ -233,9 +232,7 @@ Wayland_send_data(void *data, size_t length, int fd) return result; } -ssize_t -Wayland_data_source_send(SDL_WaylandDataSource *source, - const char *mime_type, int fd) +ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd) { void *data = NULL; size_t length = 0; @@ -247,9 +244,7 @@ Wayland_data_source_send(SDL_WaylandDataSource *source, return Wayland_send_data(data, length, fd); } -ssize_t -Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, - const char *mime_type, int fd) +ssize_t Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, const char *mime_type, int fd) { void *data = NULL; size_t length = 0; diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 050c3cc88..80d96deb3 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -808,8 +808,7 @@ static void pointer_handle_axis(void *data, struct wl_pointer *pointer, } } -static void -pointer_handle_axis_relative_direction(void *data, struct wl_pointer *pointer, +static void pointer_handle_axis_relative_direction(void *data, struct wl_pointer *pointer, uint32_t axis, uint32_t axis_relative_direction) { struct SDL_WaylandInput *input = data; @@ -826,8 +825,7 @@ pointer_handle_axis_relative_direction(void *data, struct wl_pointer *pointer, } } -static void -pointer_handle_frame(void *data, struct wl_pointer *pointer) +static void pointer_handle_frame(void *data, struct wl_pointer *pointer) { struct SDL_WaylandInput *input = data; SDL_WindowData *window = input->pointer_focus; diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index ed8d51cfe..a991c8017 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -635,8 +635,7 @@ static void Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) wl_surface_set_user_data(cdata->surface, NULL); } -void -Wayland_RecreateCursors(void) +void Wayland_RecreateCursors(void) { SDL_Cursor *cursor; SDL_Mouse *mouse = SDL_GetMouse(); diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 6b75df53f..8166e0d7c 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -44,7 +44,7 @@ #endif -SDL_FORCE_INLINE SDL_bool FloatEqual(float a, float b) +static SDL_bool FloatEqual(float a, float b) { const float diff = SDL_fabsf(a - b); const float largest = SDL_max(SDL_fabsf(a), SDL_fabsf(b)); diff --git a/src/video/windows/SDL_windowsclipboard.c b/src/video/windows/SDL_windowsclipboard.c index f6869b79e..78aa4621f 100644 --- a/src/video/windows/SDL_windowsclipboard.c +++ b/src/video/windows/SDL_windowsclipboard.c @@ -100,8 +100,7 @@ int WIN_SetClipboardText(SDL_VideoDevice *_this, const char *text) return result; } -char * -WIN_GetClipboardText(SDL_VideoDevice *_this) +char *WIN_GetClipboardText(SDL_VideoDevice *_this) { char *text; @@ -127,8 +126,7 @@ WIN_GetClipboardText(SDL_VideoDevice *_this) return text; } -SDL_bool -WIN_HasClipboardText(SDL_VideoDevice *_this) +SDL_bool WIN_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = WIN_GetClipboardText(_this); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 45c488790..503218767 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -282,8 +282,7 @@ SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this) return SDL_FALSE; } -SDL_bool -IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) +SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { return SDL_FALSE; } @@ -994,8 +993,7 @@ static void IME_HideCandidateList(SDL_VideoData *videodata) IME_SendEditingEvent(videodata); } -SDL_bool -IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) +SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { SDL_bool trap = SDL_FALSE; HIMC himc = 0; diff --git a/src/video/windows/SDL_windowsopengles.c b/src/video/windows/SDL_windowsopengles.c index 5b4d50095..d956eaf25 100644 --- a/src/video/windows/SDL_windowsopengles.c +++ b/src/video/windows/SDL_windowsopengles.c @@ -60,8 +60,7 @@ int WIN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) return 0; } -SDL_GLContext -WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; SDL_WindowData *data = window->driverdata; diff --git a/src/video/windows/SDL_windowsshape.c b/src/video/windows/SDL_windowsshape.c index 093d3be3f..25c3f5e0a 100644 --- a/src/video/windows/SDL_windowsshape.c +++ b/src/video/windows/SDL_windowsshape.c @@ -25,8 +25,7 @@ #include "SDL_windowsshape.h" #include "SDL_windowsvideo.h" -SDL_WindowShaper * -Win32_CreateShaper(SDL_Window *window) +SDL_WindowShaper *Win32_CreateShaper(SDL_Window *window) { SDL_WindowShaper *result = (SDL_WindowShaper *)SDL_malloc(sizeof(SDL_WindowShaper)); if (result == NULL) { diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index aca7732ca..93427e971 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -472,8 +472,7 @@ void WIN_VideoQuit(SDL_VideoDevice *_this) #endif #endif -SDL_bool -D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface) +SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface) { *pD3DDLL = SDL_LoadObject("D3D9.DLL"); if (*pD3DDLL) { diff --git a/src/video/winrt/SDL_winrtpointerinput.cpp b/src/video/winrt/SDL_winrtpointerinput.cpp index 7f49d2ce8..ade322aa8 100644 --- a/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/src/video/winrt/SDL_winrtpointerinput.cpp @@ -111,8 +111,7 @@ WINRT_TransformCursorPosition(SDL_Window *window, return outputPosition; } -SDL_bool -WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed) +SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed) { using namespace Windows::UI::Input; diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index 5f5a7caa9..a61a45656 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -284,8 +284,7 @@ int X11_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text) SDL_strdup(text), SDL_TRUE); } -char * -X11_GetClipboardText(SDL_VideoDevice *_this) +char *X11_GetClipboardText(SDL_VideoDevice *_this) { size_t length; SDL_VideoData *videodata = _this->driverdata; @@ -298,15 +297,13 @@ X11_GetClipboardText(SDL_VideoDevice *_this) return GetSelectionData(_this, XA_CLIPBOARD, &length, text_mime_types[0], SDL_TRUE); } -char * -X11_GetPrimarySelectionText(SDL_VideoDevice *_this) +char *X11_GetPrimarySelectionText(SDL_VideoDevice *_this) { size_t length; return GetSelectionData(_this, XA_PRIMARY, &length, text_mime_types[0], SDL_TRUE); } -SDL_bool -X11_HasClipboardText(SDL_VideoDevice *_this) +SDL_bool X11_HasClipboardText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = X11_GetClipboardText(_this); @@ -317,8 +314,7 @@ X11_HasClipboardText(SDL_VideoDevice *_this) return result; } -SDL_bool -X11_HasPrimarySelectionText(SDL_VideoDevice *_this) +SDL_bool X11_HasPrimarySelectionText(SDL_VideoDevice *_this) { SDL_bool result = SDL_FALSE; char *text = X11_GetPrimarySelectionText(_this); @@ -329,8 +325,7 @@ X11_HasPrimarySelectionText(SDL_VideoDevice *_this) return result; } -void -X11_QuitClipboard(SDL_VideoDevice *_this) +void X11_QuitClipboard(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; if (data->primary_selection.internal == SDL_TRUE) { diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index 21bf7d2fc..9e8da1dd1 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -30,8 +30,7 @@ /* Shared memory error handler routine */ static int shm_error; static int (*X_handler)(Display *, XErrorEvent *) = NULL; -static int -shm_errhandler(Display *d, XErrorEvent *e) +static int shm_errhandler(Display *d, XErrorEvent *e) { if (e->error_code == BadAccess) { shm_error = True; diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index d557db869..2c25f4542 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -455,8 +455,7 @@ int X11_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) return 0; } -SDL_bool -X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this) +SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { SDL_VideoData *videodata = _this->driverdata; return videodata->is_steam_deck; @@ -489,8 +488,7 @@ void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) } } -SDL_bool -X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) +SDL_bool X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; diff --git a/src/video/x11/SDL_x11opengles.c b/src/video/x11/SDL_x11opengles.c index 979b8ce75..0a2b5831a 100644 --- a/src/video/x11/SDL_x11opengles.c +++ b/src/video/x11/SDL_x11opengles.c @@ -55,8 +55,7 @@ int X11_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)data->display, _this->gl_config.egl_platform); } -XVisualInfo * -X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent) +XVisualInfo *X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent) { XVisualInfo *egl_visualinfo = NULL; @@ -105,8 +104,7 @@ X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_boo return egl_visualinfo; } -SDL_GLContext -X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) +SDL_GLContext X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; SDL_WindowData *data = window->driverdata; @@ -119,8 +117,7 @@ X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) return context; } -SDL_EGLSurface -X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) +SDL_EGLSurface X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data = window->driverdata; return data->egl_surface; diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c index a1dc1ddc4..1acd33ce0 100644 --- a/src/video/x11/SDL_x11shape.c +++ b/src/video/x11/SDL_x11shape.c @@ -27,8 +27,7 @@ #include "SDL_x11window.h" #include "../SDL_shape_internals.h" -SDL_WindowShaper * -X11_CreateShaper(SDL_Window *window) +SDL_WindowShaper *X11_CreateShaper(SDL_Window *window) { SDL_WindowShaper *result = NULL; diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 6e8ef29fd..9fa9a718e 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -505,8 +505,7 @@ void X11_VideoQuit(SDL_VideoDevice *_this) X11_QuitClipboard(_this); } -SDL_bool -X11_UseDirectColorVisuals(void) +SDL_bool X11_UseDirectColorVisuals(void) { return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE; } diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index c2077df51..c391127a3 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -43,13 +43,11 @@ #define _NET_WM_STATE_REMOVE 0l #define _NET_WM_STATE_ADD 1l -static Bool -isMapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ +static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ { return ev->type == MapNotify && ev->xmap.window == *((Window *)win); } -static Bool -isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ +static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ { return ev->type == UnmapNotify && ev->xunmap.window == *((Window *)win); } @@ -775,8 +773,7 @@ int X11_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void return 0; } -char * -X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow) +char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow) { SDL_VideoData *data = _this->driverdata; Display *display = data->display;