Updated source to match SDL function prototype style

This commit is contained in:
Sam Lantinga 2023-05-23 09:37:07 -07:00
parent a828f5897e
commit 737aa881fa
39 changed files with 95 additions and 191 deletions

View file

@ -448,8 +448,7 @@ void SDL_QuitSubSystem(Uint32 flags)
#endif #endif
} }
Uint32 Uint32 SDL_WasInit(Uint32 flags)
SDL_WasInit(Uint32 flags)
{ {
int i; int i;
int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount); int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount);

View file

@ -203,8 +203,7 @@ int SDL_AtomicSet(SDL_AtomicInt *a, int v)
#endif #endif
} }
void * void *SDL_AtomicSetPtr(void **a, void *v)
SDL_AtomicSetPtr(void **a, void *v)
{ {
#ifdef HAVE_MSC_ATOMICS #ifdef HAVE_MSC_ATOMICS
return _InterlockedExchangePointer(a, v); return _InterlockedExchangePointer(a, v);
@ -270,8 +269,7 @@ int SDL_AtomicGet(SDL_AtomicInt *a)
#endif #endif
} }
void * void *SDL_AtomicGetPtr(void **a)
SDL_AtomicGetPtr(void **a)
{ {
#ifdef HAVE_ATOMIC_LOAD_N #ifdef HAVE_ATOMIC_LOAD_N
return __atomic_load_n(a, __ATOMIC_SEQ_CST); return __atomic_load_n(a, __ATOMIC_SEQ_CST);

View file

@ -495,8 +495,7 @@ int SDL_QueueAudio(SDL_AudioDeviceID devid, const void *data, Uint32 len)
return rc; return rc;
} }
Uint32 Uint32 SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)
SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)
{ {
SDL_AudioDevice *device = get_audio_device(devid); SDL_AudioDevice *device = get_audio_device(devid);
Uint32 rc; Uint32 rc;
@ -514,8 +513,7 @@ SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)
return rc; return rc;
} }
Uint32 Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid)
SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid)
{ {
Uint32 retval = 0; Uint32 retval = 0;
SDL_AudioDevice *device = get_audio_device(devid); SDL_AudioDevice *device = get_audio_device(devid);
@ -1074,8 +1072,7 @@ static void close_audio_device(SDL_AudioDevice *device)
SDL_free(device); SDL_free(device);
} }
static Uint16 static Uint16 GetDefaultSamplesFromFreq(int freq)
GetDefaultSamplesFromFreq(int freq)
{ {
/* Pick a default of ~46 ms at desired frequency */ /* Pick a default of ~46 ms at desired frequency */
/* !!! FIXME: remove this when the non-Po2 resampling is in. */ /* !!! FIXME: remove this when the non-Po2 resampling is in. */

View file

@ -120,8 +120,7 @@ void WIN_CoUninitialize(void)
} }
#ifndef __WINRT__ #ifndef __WINRT__
void * void *WIN_LoadComBaseFunction(const char *name)
WIN_LoadComBaseFunction(const char *name)
{ {
static SDL_bool s_bLoaded; static SDL_bool s_bLoaded;
static HMODULE s_hComBase; static HMODULE s_hComBase;

View file

@ -356,8 +356,7 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
typedef Sint32(SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize); typedef Sint32(SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize);
extern DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32); extern DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32);
Sint32 Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
{ {
return initialize_jumptable(apiver, table, tablesize); return initialize_jumptable(apiver, table, tablesize);
} }

View file

@ -885,8 +885,7 @@ void SDL_QuitMouse(void)
SDL_MouseRelativeWarpMotionChanged, mouse); SDL_MouseRelativeWarpMotionChanged, mouse);
} }
Uint32 Uint32 SDL_GetMouseState(float *x, float *y)
SDL_GetMouseState(float *x, float *y)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
@ -899,8 +898,7 @@ SDL_GetMouseState(float *x, float *y)
return GetButtonState(mouse, SDL_TRUE); return GetButtonState(mouse, SDL_TRUE);
} }
Uint32 Uint32 SDL_GetRelativeMouseState(float *x, float *y)
SDL_GetRelativeMouseState(float *x, float *y)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
@ -915,8 +913,7 @@ SDL_GetRelativeMouseState(float *x, float *y)
return GetButtonState(mouse, SDL_TRUE); return GetButtonState(mouse, SDL_TRUE);
} }
Uint32 Uint32 SDL_GetGlobalMouseState(float *x, float *y)
SDL_GetGlobalMouseState(float *x, float *y)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();

View file

@ -669,8 +669,7 @@ void SDL_DestroyRW(SDL_RWops *area)
} }
/* Load all the data from an SDL data stream */ /* Load all the data from an SDL data stream */
void * void *SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc)
SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc)
{ {
static const Sint64 FILE_CHUNK_SIZE = 1024; static const Sint64 FILE_CHUNK_SIZE = 1024;
Sint64 size; Sint64 size;
@ -733,38 +732,32 @@ done:
return data; return data;
} }
void * void *SDL_LoadFile(const char *file, size_t *datasize)
SDL_LoadFile(const char *file, size_t *datasize)
{ {
return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1); return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1);
} }
Sint64 Sint64 SDL_RWsize(SDL_RWops *context)
SDL_RWsize(SDL_RWops *context)
{ {
return context->size(context); return context->size(context);
} }
Sint64 Sint64 SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence)
SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence)
{ {
return context->seek(context, offset, whence); return context->seek(context, offset, whence);
} }
Sint64 Sint64 SDL_RWtell(SDL_RWops *context)
SDL_RWtell(SDL_RWops *context)
{ {
return context->seek(context, 0, SDL_RW_SEEK_CUR); return context->seek(context, 0, SDL_RW_SEEK_CUR);
} }
Sint64 Sint64 SDL_RWread(SDL_RWops *context, void *ptr, Sint64 size)
SDL_RWread(SDL_RWops *context, void *ptr, Sint64 size)
{ {
return context->read(context, ptr, size); return context->read(context, ptr, size);
} }
Sint64 Sint64 SDL_RWwrite(SDL_RWops *context, const void *ptr, Sint64 size)
SDL_RWwrite(SDL_RWops *context, const void *ptr, Sint64 size)
{ {
return context->write(context, ptr, size); return context->write(context, ptr, size);
} }
@ -784,8 +777,7 @@ Uint8 SDL_ReadU8(SDL_RWops *src)
return value; return value;
} }
Uint16 Uint16 SDL_ReadLE16(SDL_RWops *src)
SDL_ReadLE16(SDL_RWops *src)
{ {
Uint16 value = 0; Uint16 value = 0;
@ -793,8 +785,7 @@ SDL_ReadLE16(SDL_RWops *src)
return SDL_SwapLE16(value); return SDL_SwapLE16(value);
} }
Uint16 Uint16 SDL_ReadBE16(SDL_RWops *src)
SDL_ReadBE16(SDL_RWops *src)
{ {
Uint16 value = 0; Uint16 value = 0;
@ -802,8 +793,7 @@ SDL_ReadBE16(SDL_RWops *src)
return SDL_SwapBE16(value); return SDL_SwapBE16(value);
} }
Uint32 Uint32 SDL_ReadLE32(SDL_RWops *src)
SDL_ReadLE32(SDL_RWops *src)
{ {
Uint32 value = 0; Uint32 value = 0;
@ -811,8 +801,7 @@ SDL_ReadLE32(SDL_RWops *src)
return SDL_SwapLE32(value); return SDL_SwapLE32(value);
} }
Uint32 Uint32 SDL_ReadBE32(SDL_RWops *src)
SDL_ReadBE32(SDL_RWops *src)
{ {
Uint32 value = 0; Uint32 value = 0;
@ -820,8 +809,7 @@ SDL_ReadBE32(SDL_RWops *src)
return SDL_SwapBE32(value); return SDL_SwapBE32(value);
} }
Uint64 Uint64 SDL_ReadLE64(SDL_RWops *src)
SDL_ReadLE64(SDL_RWops *src)
{ {
Uint64 value = 0; Uint64 value = 0;
@ -829,8 +817,7 @@ SDL_ReadLE64(SDL_RWops *src)
return SDL_SwapLE64(value); return SDL_SwapLE64(value);
} }
Uint64 Uint64 SDL_ReadBE64(SDL_RWops *src)
SDL_ReadBE64(SDL_RWops *src)
{ {
Uint64 value = 0; Uint64 value = 0;

View file

@ -943,8 +943,7 @@ int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
return 0; return 0;
} }
Uint32 Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{ {
Uint32 result = 0; Uint32 result = 0;
@ -1193,8 +1192,7 @@ int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
return SDL_Unsupported(); return SDL_Unsupported();
} }
Uint32 Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{ {
return 0; return 0;
} }

View file

@ -497,8 +497,7 @@ int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
return 0; return 0;
} }
Uint32 Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{ {
return SDL_JOYCAP_RUMBLE; return SDL_JOYCAP_RUMBLE;
} }
@ -583,8 +582,7 @@ int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
return SDL_Unsupported(); return SDL_Unsupported();
} }
Uint32 Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{ {
return 0; return 0;
} }

View file

@ -196,8 +196,7 @@ static const GUID SDL_IID_ID3D11DeviceContext1 = { 0xbb2c6faa, 0xb5fb, 0x4082, {
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
Uint32 Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
{ {
switch (dxgiFormat) { switch (dxgiFormat) {
case DXGI_FORMAT_B8G8R8A8_UNORM: case DXGI_FORMAT_B8G8R8A8_UNORM:

View file

@ -272,8 +272,7 @@ UINT D3D12_Align(UINT location, UINT alignment)
return (location + (alignment - 1)) & ~(alignment - 1); return (location + (alignment - 1)) & ~(alignment - 1);
} }
Uint32 Uint32 D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
{ {
switch (dxgiFormat) { switch (dxgiFormat) {
case DXGI_FORMAT_B8G8R8A8_UNORM: case DXGI_FORMAT_B8G8R8A8_UNORM:

View file

@ -25,8 +25,7 @@
#include "SDL_render_vita_gxm_memory.h" #include "SDL_render_vita_gxm_memory.h"
void * void *vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid)
vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid)
{ {
void *mem; void *mem;
@ -63,8 +62,7 @@ void vita_mem_free(SceUID uid)
sceKernelFreeMemBlock(uid); sceKernelFreeMemBlock(uid);
} }
void * void *vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size)
vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size)
{ {
void *mem; void *mem;
@ -122,8 +120,7 @@ void vita_gpu_mem_destroy(VITA_GXM_RenderData *data)
} }
} }
void * void *vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
{ {
void *mem = NULL; void *mem = NULL;
@ -150,8 +147,7 @@ void vita_mem_vertex_usse_free(SceUID uid)
sceKernelFreeMemBlock(uid); sceKernelFreeMemBlock(uid);
} }
void * void *vita_mem_fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
vita_mem_fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
{ {
void *mem = NULL; void *mem = NULL;

View file

@ -79,8 +79,7 @@ static void patcher_host_free(void *user_data, void *mem)
SDL_free(mem); SDL_free(mem);
} }
void * void *pool_malloc(VITA_GXM_RenderData *data, unsigned int size)
pool_malloc(VITA_GXM_RenderData *data, unsigned int size)
{ {
if ((data->pool_index + size) < VITA_GXM_POOL_SIZE) { if ((data->pool_index + size) < VITA_GXM_POOL_SIZE) {
@ -92,8 +91,7 @@ pool_malloc(VITA_GXM_RenderData *data, unsigned int size)
return NULL; return NULL;
} }
void * void *pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment)
pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment)
{ {
unsigned int new_index = (data->pool_index + alignment - 1) & ~(alignment - 1); unsigned int new_index = (data->pool_index + alignment - 1) & ~(alignment - 1);
if ((new_index + size) < VITA_GXM_POOL_SIZE) { if ((new_index + size) < VITA_GXM_POOL_SIZE) {
@ -957,8 +955,7 @@ gxm_texture_get_format(const gxm_texture *texture)
return sceGxmTextureGetFormat(&texture->gxm_tex); return sceGxmTextureGetFormat(&texture->gxm_tex);
} }
void * void *gxm_texture_get_datap(const gxm_texture *texture)
gxm_texture_get_datap(const gxm_texture *texture)
{ {
return sceGxmTextureGetData(&texture->gxm_tex); return sceGxmTextureGetData(&texture->gxm_tex);
} }

View file

@ -528,8 +528,7 @@ extern void qsortG(void *base, size_t nmemb, size_t size,
#endif /* HAVE_QSORT */ #endif /* HAVE_QSORT */
void * void *SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *))
SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *))
{ {
#ifdef HAVE_BSEARCH #ifdef HAVE_BSEARCH
return bsearch(key, base, nmemb, size, compare); return bsearch(key, base, nmemb, size, compare);

View file

@ -533,8 +533,7 @@ int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a' + ((x) - 'A'
/* This file contains a portable memcpy manipulation function for SDL */ /* This file contains a portable memcpy manipulation function for SDL */
void * void *SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
{ {
#ifdef __GNUC__ #ifdef __GNUC__
/* Presumably this is well tuned for speed. /* Presumably this is well tuned for speed.
@ -586,8 +585,7 @@ SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src,
#endif /* __GNUC__ */ #endif /* __GNUC__ */
} }
void * void *SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
{ {
#ifdef HAVE_MEMSET #ifdef HAVE_MEMSET
return memset(dst, c, len); return memset(dst, c, len);
@ -636,8 +634,7 @@ SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
} }
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ /* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
void * void *SDL_memset4(void *dst, Uint32 val, size_t dwords)
SDL_memset4(void *dst, Uint32 val, size_t dwords)
{ {
#if defined(__APPLE__) && defined(HAVE_STRING_H) #if defined(__APPLE__) && defined(HAVE_STRING_H)
memset_pattern4(dst, &val, dwords * 4); memset_pattern4(dst, &val, dwords * 4);

View file

@ -287,8 +287,7 @@ SDL_ScanFloat(const char *text, double *valuep)
} }
#endif #endif
void * void *SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
{ {
#ifdef HAVE_MEMMOVE #ifdef HAVE_MEMMOVE
return memmove(dst, src, len); return memmove(dst, src, len);
@ -959,8 +958,7 @@ SDL_strtoul(const char *string, char **endp, int base)
#endif /* HAVE_STRTOUL */ #endif /* HAVE_STRTOUL */
} }
Sint64 Sint64 SDL_strtoll(const char *string, char **endp, int base)
SDL_strtoll(const char *string, char **endp, int base)
{ {
#ifdef HAVE_STRTOLL #ifdef HAVE_STRTOLL
return strtoll(string, endp, base); return strtoll(string, endp, base);
@ -984,8 +982,7 @@ SDL_strtoll(const char *string, char **endp, int base)
#endif /* HAVE_STRTOLL */ #endif /* HAVE_STRTOLL */
} }
Uint64 Uint64 SDL_strtoull(const char *string, char **endp, int base)
SDL_strtoull(const char *string, char **endp, int base)
{ {
#ifdef HAVE_STRTOULL #ifdef HAVE_STRTOULL
return strtoull(string, endp, base); return strtoull(string, endp, base);

View file

@ -71,40 +71,35 @@ Sint8 SDLTest_RandomSint8(void)
return (Sint8)SDLTest_RandomInt(&rndContext) & 0x000000FF; return (Sint8)SDLTest_RandomInt(&rndContext) & 0x000000FF;
} }
Uint16 Uint16 SDLTest_RandomUint16(void)
SDLTest_RandomUint16(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
return (Uint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF; return (Uint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
} }
Sint16 Sint16 SDLTest_RandomSint16(void)
SDLTest_RandomSint16(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
return (Sint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF; return (Sint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
} }
Sint32 Sint32 SDLTest_RandomSint32(void)
SDLTest_RandomSint32(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
return (Sint32)SDLTest_RandomInt(&rndContext); return (Sint32)SDLTest_RandomInt(&rndContext);
} }
Uint32 Uint32 SDLTest_RandomUint32(void)
SDLTest_RandomUint32(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
return (Uint32)SDLTest_RandomInt(&rndContext); return (Uint32)SDLTest_RandomInt(&rndContext);
} }
Uint64 Uint64 SDLTest_RandomUint64(void)
SDLTest_RandomUint64(void)
{ {
union union
{ {
@ -121,8 +116,7 @@ SDLTest_RandomUint64(void)
return value.v64; return value.v64;
} }
Sint64 Sint64 SDLTest_RandomSint64(void)
SDLTest_RandomSint64(void)
{ {
union union
{ {
@ -139,8 +133,7 @@ SDLTest_RandomSint64(void)
return (Sint64)value.v64; return (Sint64)value.v64;
} }
Sint32 Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
{ {
Sint64 min = pMin; Sint64 min = pMin;
Sint64 max = pMax; Sint64 max = pMax;
@ -254,8 +247,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
validDomain); validDomain);
} }
Uint16 Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
{ {
/* max value for Uint16 */ /* max value for Uint16 */
const Uint64 maxValue = USHRT_MAX; const Uint64 maxValue = USHRT_MAX;
@ -264,8 +256,7 @@ SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool v
validDomain); validDomain);
} }
Uint32 Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
{ {
/* max value for Uint32 */ /* max value for Uint32 */
#if ((ULONG_MAX) == (UINT_MAX)) #if ((ULONG_MAX) == (UINT_MAX))
@ -278,8 +269,7 @@ SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool v
validDomain); validDomain);
} }
Uint64 Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
{ {
/* max value for Uint64 */ /* max value for Uint64 */
const Uint64 maxValue = UINT64_MAX; const Uint64 maxValue = UINT64_MAX;
@ -384,8 +374,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
validDomain); validDomain);
} }
Sint16 Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
{ {
/* min & max values for Sint16 */ /* min & max values for Sint16 */
const Sint64 maxValue = SHRT_MAX; const Sint64 maxValue = SHRT_MAX;
@ -395,8 +384,7 @@ SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool v
validDomain); validDomain);
} }
Sint32 Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
{ {
/* min & max values for Sint32 */ /* min & max values for Sint32 */
#if ((ULONG_MAX) == (UINT_MAX)) #if ((ULONG_MAX) == (UINT_MAX))
@ -411,8 +399,7 @@ SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool v
validDomain); validDomain);
} }
Sint64 Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
{ {
/* min & max values for Sint64 */ /* min & max values for Sint64 */
const Sint64 maxValue = INT64_MAX; const Sint64 maxValue = INT64_MAX;

View file

@ -33,8 +33,7 @@ SDL_TLSCreate(void)
return SDL_AtomicIncRef(&SDL_tls_id) + 1; return SDL_AtomicIncRef(&SDL_tls_id) + 1;
} }
void * void *SDL_TLSGet(SDL_TLSID id)
SDL_TLSGet(SDL_TLSID id)
{ {
SDL_TLSData *storage; SDL_TLSData *storage;

View file

@ -42,8 +42,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
return SDL_SetError("SDL not built with thread support"); return SDL_SetError("SDL not built with thread support");
} }
Uint32 Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
SDL_GetSemaphoreValue(SDL_Semaphore *sem)
{ {
return 0; return 0;
} }
@ -144,8 +143,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
return retval; return retval;
} }
Uint32 Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
SDL_GetSemaphoreValue(SDL_Semaphore *sem)
{ {
Uint32 value; Uint32 value;

View file

@ -139,8 +139,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
return info->iVal; return info->iVal;
} }
Uint32 Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
SDL_GetSemaphoreValue(SDL_Semaphore *sem)
{ {
if (sem == NULL) { if (sem == NULL) {
SDL_InvalidParamError("sem"); SDL_InvalidParamError("sem");

View file

@ -149,8 +149,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
return retval; return retval;
} }
Uint32 Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
SDL_GetSemaphoreValue(SDL_Semaphore *sem)
{ {
int ret = 0; int ret = 0;

View file

@ -377,8 +377,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
return SDL_sem_impl_active.WaitTimeoutNS(sem, timeoutNS); return SDL_sem_impl_active.WaitTimeoutNS(sem, timeoutNS);
} }
Uint32 Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
SDL_GetSemaphoreValue(SDL_Semaphore *sem)
{ {
return SDL_sem_impl_active.Value(sem); return SDL_sem_impl_active.Value(sem);
} }

View file

@ -565,8 +565,7 @@ void SDL_QuitTicks(void)
tick_start = 0; tick_start = 0;
} }
Uint64 Uint64 SDL_GetTicksNS(void)
SDL_GetTicksNS(void)
{ {
Uint64 starting_value, value; Uint64 starting_value, value;

View file

@ -22,15 +22,13 @@
#if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED) #if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED)
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
SDL_Unsupported(); SDL_Unsupported();
return 0; return 0;
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return 1; return 1;
} }

View file

@ -25,14 +25,12 @@
#include <kernel/OS.h> #include <kernel/OS.h>
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
return system_time(); return system_time();
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return SDL_US_PER_SECOND; return SDL_US_PER_SECOND;
} }

View file

@ -25,14 +25,12 @@
#include <3ds.h> #include <3ds.h>
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
return svcGetSystemTick(); return svcGetSystemTick();
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return SYSCLOCK_ARM11; return SYSCLOCK_ARM11;
} }

View file

@ -32,15 +32,13 @@ extern "C" {
#endif #endif
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
/* FIXME: Need to account for 32-bit wrapping */ /* FIXME: Need to account for 32-bit wrapping */
return (Uint64)User::TickCount(); return (Uint64)User::TickCount();
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return SDL_US_PER_SECOND; return SDL_US_PER_SECOND;
} }

View file

@ -29,14 +29,12 @@
#include <sys/time.h> #include <sys/time.h>
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
return GetTimerSystemTime(); return GetTimerSystemTime();
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return kBUSCLK; return kBUSCLK;
} }

View file

@ -29,8 +29,7 @@
#include <pspthreadman.h> #include <pspthreadman.h>
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
Uint64 ticks; Uint64 ticks;
struct timeval now; struct timeval now;
@ -42,8 +41,7 @@ SDL_GetPerformanceCounter(void)
return ticks; return ticks;
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return SDL_US_PER_SECOND; return SDL_US_PER_SECOND;
} }

View file

@ -82,8 +82,7 @@ static void CheckMonotonicTime(void)
checked_monotonic_time = SDL_TRUE; checked_monotonic_time = SDL_TRUE;
} }
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
Uint64 ticks; Uint64 ticks;
@ -116,8 +115,7 @@ SDL_GetPerformanceCounter(void)
return ticks; return ticks;
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
if (!checked_monotonic_time) { if (!checked_monotonic_time) {
CheckMonotonicTime(); CheckMonotonicTime();

View file

@ -29,14 +29,12 @@
#include <psp2/kernel/processmgr.h> #include <psp2/kernel/processmgr.h>
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
return sceKernelGetProcessTimeWide(); return sceKernelGetProcessTimeWide();
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
return SDL_US_PER_SECOND; return SDL_US_PER_SECOND;
} }

View file

@ -25,8 +25,7 @@
#include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_windows.h"
Uint64 Uint64 SDL_GetPerformanceCounter(void)
SDL_GetPerformanceCounter(void)
{ {
LARGE_INTEGER counter; LARGE_INTEGER counter;
const BOOL rc = QueryPerformanceCounter(&counter); const BOOL rc = QueryPerformanceCounter(&counter);
@ -34,8 +33,7 @@ SDL_GetPerformanceCounter(void)
return (Uint64)counter.QuadPart; return (Uint64)counter.QuadPart;
} }
Uint64 Uint64 SDL_GetPerformanceFrequency(void)
SDL_GetPerformanceFrequency(void)
{ {
LARGE_INTEGER frequency; LARGE_INTEGER frequency;
const BOOL rc = QueryPerformanceFrequency(&frequency); const BOOL rc = QueryPerformanceFrequency(&frequency);

View file

@ -78,8 +78,7 @@ int SDL_SetPrimarySelectionText(const char *text)
} }
} }
void * void *SDL_GetClipboardData(size_t *length, const char *mime_type)
SDL_GetClipboardData(size_t *length, const char *mime_type)
{ {
SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_VideoDevice *_this = SDL_GetVideoDevice();
if (_this == NULL) { if (_this == NULL) {
@ -193,8 +192,7 @@ SDL_HasPrimarySelectionText(void)
return SDL_FALSE; return SDL_FALSE;
} }
void * void *SDL_GetClipboardUserdata(void)
SDL_GetClipboardUserdata(void)
{ {
SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_VideoDevice *_this = SDL_GetVideoDevice();

View file

@ -301,9 +301,7 @@ SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask,
return SDL_TRUE; return SDL_TRUE;
} }
Uint32 Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
Uint32 Amask)
{ {
switch (bpp) { switch (bpp) {
case 1: case 1:
@ -861,8 +859,7 @@ void SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alph
} }
/* Find the opaque pixel value corresponding to an RGB triple */ /* Find the opaque pixel value corresponding to an RGB triple */
Uint32 Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
{ {
if (format->palette == NULL) { if (format->palette == NULL) {
return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask; return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask;
@ -872,8 +869,7 @@ SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
} }
/* Find the pixel value corresponding to an RGBA quadruple */ /* Find the pixel value corresponding to an RGBA quadruple */
Uint32 Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b,
SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b,
Uint8 a) Uint8 a)
{ {
if (format->palette == NULL) { if (format->palette == NULL) {

View file

@ -132,8 +132,7 @@ static int SDLCALL SDL_MetalViewEventWatch(void *userdata, SDL_Event *event)
@end @end
SDL_MetalView SDL_MetalView Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window)
Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -172,8 +171,7 @@ void Cocoa_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view)
} }
} }
void * void *Cocoa_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view)
Cocoa_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view)
{ {
@autoreleasepool { @autoreleasepool {
SDL_cocoametalview *cocoaview = (__bridge SDL_cocoametalview *)view; SDL_cocoametalview *cocoaview = (__bridge SDL_cocoametalview *)view;

View file

@ -2330,8 +2330,7 @@ void Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_V
} }
} }
void * void *Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size)
Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;

View file

@ -74,8 +74,7 @@
@end @end
SDL_MetalView SDL_MetalView UIKit_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window)
UIKit_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata;
@ -115,8 +114,7 @@ void UIKit_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view)
} }
} }
void * void *UIKit_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view)
UIKit_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view)
{ {
@autoreleasepool { @autoreleasepool {
SDL_uikitview *uiview = (__bridge SDL_uikitview *)view; SDL_uikitview *uiview = (__bridge SDL_uikitview *)view;

View file

@ -249,8 +249,7 @@ int X11_GetVisualInfoFromVisual(Display *display, Visual *visual, XVisualInfo *v
return -1; return -1;
} }
Uint32 Uint32 X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo)
X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo)
{ {
if (vinfo->class == DirectColor || vinfo->class == TrueColor) { if (vinfo->class == DirectColor || vinfo->class == TrueColor) {
int bpp; int bpp;

View file

@ -218,8 +218,7 @@ static void X11_SetKeyboardFocus(SDL_Window *window)
SDL_SetKeyboardFocus(window); SDL_SetKeyboardFocus(window);
} }
Uint32 Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow)
X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
Display *display = videodata->display; Display *display = videodata->display;
@ -1657,8 +1656,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop)
p->type = type; p->type = type;
} }
void * void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size)
X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size)
{ {
SDL_WindowData *data = window->driverdata; SDL_WindowData *data = window->driverdata;
Display *display = data->videodata->display; Display *display = data->videodata->display;