Updated source to match SDL function prototype style

This commit is contained in:
Sam Lantinga
2023-05-23 11:29:41 -07:00
parent 737aa881fa
commit ddbdd73258
173 changed files with 481 additions and 942 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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 <shellapi.h> /* 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