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

@@ -528,8 +528,7 @@ extern void qsortG(void *base, size_t nmemb, size_t size,
#endif /* HAVE_QSORT */
void *
SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *))
void *SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *))
{
#ifdef HAVE_BSEARCH
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 */
void *
SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
void *SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len)
{
#ifdef __GNUC__
/* 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__ */
}
void *
SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
void *SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
{
#ifdef HAVE_MEMSET
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. */
void *
SDL_memset4(void *dst, Uint32 val, size_t dwords)
void *SDL_memset4(void *dst, Uint32 val, size_t dwords)
{
#if defined(__APPLE__) && defined(HAVE_STRING_H)
memset_pattern4(dst, &val, dwords * 4);

View File

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