mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-16 17:58:27 +00:00
Updated source to match SDL function prototype style
This commit is contained in:
parent
737aa881fa
commit
ddbdd73258
173 changed files with 481 additions and 942 deletions
13
src/SDL.c
13
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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) &&
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -27,16 +27,14 @@
|
|||
|
||||
#include <unistd.h>
|
||||
|
||||
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) {
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -29,15 +29,13 @@
|
|||
|
||||
#include <emscripten/emscripten.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -32,8 +32,7 @@
|
|||
#include <storage/Path.h>
|
||||
|
||||
|
||||
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");
|
||||
|
|
|
@ -29,18 +29,16 @@
|
|||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -34,16 +34,14 @@
|
|||
#include <limits.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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())) {
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
#include "../SDL_sysurl.h"
|
||||
#include <Url.h>
|
||||
|
||||
int
|
||||
SDL_SYS_OpenURL(const char *url)
|
||||
int SDL_SYS_OpenURL(const char *url)
|
||||
{
|
||||
BUrl burl(url);
|
||||
const status_t rc = burl.OpenWithPreferredApplication(false);
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
#include <emscripten/html5.h>
|
||||
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
|
||||
#include <psppower.h>
|
||||
|
||||
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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
|
||||
#include <psp2/power.h>
|
||||
|
||||
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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -32,8 +32,7 @@ struct SDL_Mutex
|
|||
};
|
||||
|
||||
/* Create a mutex */
|
||||
SDL_Mutex *
|
||||
SDL_CreateMutex(void)
|
||||
SDL_Mutex *SDL_CreateMutex(void)
|
||||
{
|
||||
SDL_Mutex *mutex;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -40,8 +40,7 @@ void SDL_SYS_SetupThread(const char *name)
|
|||
return;
|
||||
}
|
||||
|
||||
SDL_threadID
|
||||
SDL_ThreadID(void)
|
||||
SDL_threadID SDL_ThreadID(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue