mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-14 07:38:24 +02:00
Updated source to match SDL function prototype style
This commit is contained in:
@@ -58,8 +58,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;
|
||||
@@ -630,8 +629,7 @@ static char *common_usage_video = NULL;
|
||||
static char *common_usage_audio = NULL;
|
||||
static char *common_usage_videoaudio = NULL;
|
||||
|
||||
const char *
|
||||
SDLTest_CommonUsage(SDLTest_CommonState *state)
|
||||
const char *SDLTest_CommonUsage(SDLTest_CommonState *state)
|
||||
{
|
||||
|
||||
switch (state->flags & (SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
|
||||
@@ -646,8 +644,7 @@ SDLTest_CommonUsage(SDLTest_CommonState *state)
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -1052,8 +1049,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;
|
||||
SDL_DisplayMode fullscreen_mode;
|
||||
|
||||
@@ -87,40 +87,35 @@ Sint8 SDLTest_RandomSint8()
|
||||
return (Sint8)SDLTest_RandomInt(&rndContext) & 0x000000FF;
|
||||
}
|
||||
|
||||
Uint16
|
||||
SDLTest_RandomUint16()
|
||||
Uint16 SDLTest_RandomUint16()
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Uint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
|
||||
}
|
||||
|
||||
Sint16
|
||||
SDLTest_RandomSint16()
|
||||
Sint16 SDLTest_RandomSint16()
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Sint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
|
||||
}
|
||||
|
||||
Sint32
|
||||
SDLTest_RandomSint32()
|
||||
Sint32 SDLTest_RandomSint32()
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Sint32)SDLTest_RandomInt(&rndContext);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDLTest_RandomUint32()
|
||||
Uint32 SDLTest_RandomUint32()
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Uint32)SDLTest_RandomInt(&rndContext);
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDLTest_RandomUint64()
|
||||
Uint64 SDLTest_RandomUint64()
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -137,8 +132,7 @@ SDLTest_RandomUint64()
|
||||
return value.v64;
|
||||
}
|
||||
|
||||
Sint64
|
||||
SDLTest_RandomSint64()
|
||||
Sint64 SDLTest_RandomSint64()
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -155,8 +149,7 @@ SDLTest_RandomSint64()
|
||||
return (Sint64)value.v64;
|
||||
}
|
||||
|
||||
Sint32
|
||||
SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
|
||||
Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
|
||||
{
|
||||
Sint64 min = pMin;
|
||||
Sint64 max = pMax;
|
||||
@@ -270,8 +263,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Uint16
|
||||
SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
|
||||
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
|
||||
{
|
||||
/* max value for Uint16 */
|
||||
const Uint64 maxValue = USHRT_MAX;
|
||||
@@ -280,8 +272,7 @@ SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool v
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
|
||||
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
|
||||
{
|
||||
/* max value for Uint32 */
|
||||
#if ((ULONG_MAX) == (UINT_MAX))
|
||||
@@ -294,8 +285,7 @@ SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool v
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
|
||||
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
|
||||
{
|
||||
/* max value for Uint64 */
|
||||
const Uint64 maxValue = UINT64_MAX;
|
||||
@@ -400,8 +390,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Sint16
|
||||
SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
|
||||
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint16 */
|
||||
const Sint64 maxValue = SHRT_MAX;
|
||||
@@ -411,8 +400,7 @@ SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool v
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Sint32
|
||||
SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
|
||||
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint32 */
|
||||
#if ((ULONG_MAX) == (UINT_MAX))
|
||||
@@ -427,8 +415,7 @@ SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool v
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Sint64
|
||||
SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
|
||||
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint64 */
|
||||
const Sint64 maxValue = INT64_MAX;
|
||||
@@ -469,14 +456,12 @@ SDLTest_RandomDouble()
|
||||
return r;
|
||||
}
|
||||
|
||||
char *
|
||||
SDLTest_RandomAsciiString()
|
||||
char *SDLTest_RandomAsciiString()
|
||||
{
|
||||
return SDLTest_RandomAsciiStringWithMaximumLength(255);
|
||||
}
|
||||
|
||||
char *
|
||||
SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
|
||||
char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
|
||||
{
|
||||
int size;
|
||||
|
||||
@@ -490,8 +475,7 @@ SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
|
||||
return SDLTest_RandomAsciiStringOfSize(size);
|
||||
}
|
||||
|
||||
char *
|
||||
SDLTest_RandomAsciiStringOfSize(int size)
|
||||
char *SDLTest_RandomAsciiStringOfSize(int size)
|
||||
{
|
||||
char *string;
|
||||
int counter;
|
||||
|
||||
@@ -50,8 +50,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;
|
||||
|
||||
@@ -43,8 +43,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user