mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-29 01:51:37 +00:00
Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]"
https://stackoverflow.com/questions/42125/warning-error-function-declaration-isnt-a-prototype In C int foo() and int foo(void) are different functions. int foo() accepts an arbitrary number of arguments, while int foo(void) accepts 0 arguments. In C++ they mean the same thing.
This commit is contained in:
@@ -107,7 +107,7 @@ void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,
|
||||
/*
|
||||
* Resets the assert summary counters to zero.
|
||||
*/
|
||||
void SDLTest_ResetAssertSummary()
|
||||
void SDLTest_ResetAssertSummary(void)
|
||||
{
|
||||
SDLTest_AssertsPassed = 0;
|
||||
SDLTest_AssertsFailed = 0;
|
||||
@@ -117,7 +117,7 @@ void SDLTest_ResetAssertSummary()
|
||||
* Logs summary of all assertions (total, pass, fail) since last reset
|
||||
* as INFO (failed==0) or ERROR (failed > 0).
|
||||
*/
|
||||
void SDLTest_LogAssertSummary()
|
||||
void SDLTest_LogAssertSummary(void)
|
||||
{
|
||||
int totalAsserts = SDLTest_AssertsPassed + SDLTest_AssertsFailed;
|
||||
if (SDLTest_AssertsFailed == 0) {
|
||||
@@ -130,7 +130,7 @@ void SDLTest_LogAssertSummary()
|
||||
/*
|
||||
* Converts the current assert state into a test result
|
||||
*/
|
||||
int SDLTest_AssertSummaryToTestResult()
|
||||
int SDLTest_AssertSummaryToTestResult(void)
|
||||
{
|
||||
if (SDLTest_AssertsFailed > 0) {
|
||||
return TEST_RESULT_FAILED;
|
||||
|
||||
@@ -68,54 +68,54 @@ void SDLTest_FuzzerInit(Uint64 execKey)
|
||||
fuzzerInvocationCounter = 0;
|
||||
}
|
||||
|
||||
int SDLTest_GetFuzzerInvocationCount()
|
||||
int SDLTest_GetFuzzerInvocationCount(void)
|
||||
{
|
||||
return fuzzerInvocationCounter;
|
||||
}
|
||||
|
||||
Uint8 SDLTest_RandomUint8()
|
||||
Uint8 SDLTest_RandomUint8(void)
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Uint8)SDLTest_RandomInt(&rndContext) & 0x000000FF;
|
||||
}
|
||||
|
||||
Sint8 SDLTest_RandomSint8()
|
||||
Sint8 SDLTest_RandomSint8(void)
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Sint8)SDLTest_RandomInt(&rndContext) & 0x000000FF;
|
||||
}
|
||||
|
||||
Uint16 SDLTest_RandomUint16()
|
||||
Uint16 SDLTest_RandomUint16(void)
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Uint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
|
||||
}
|
||||
|
||||
Sint16 SDLTest_RandomSint16()
|
||||
Sint16 SDLTest_RandomSint16(void)
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Sint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF;
|
||||
}
|
||||
|
||||
Sint32 SDLTest_RandomSint32()
|
||||
Sint32 SDLTest_RandomSint32(void)
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Sint32)SDLTest_RandomInt(&rndContext);
|
||||
}
|
||||
|
||||
Uint32 SDLTest_RandomUint32()
|
||||
Uint32 SDLTest_RandomUint32(void)
|
||||
{
|
||||
fuzzerInvocationCounter++;
|
||||
|
||||
return (Uint32)SDLTest_RandomInt(&rndContext);
|
||||
}
|
||||
|
||||
Uint64 SDLTest_RandomUint64()
|
||||
Uint64 SDLTest_RandomUint64(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -132,7 +132,7 @@ Uint64 SDLTest_RandomUint64()
|
||||
return value.v64;
|
||||
}
|
||||
|
||||
Sint64 SDLTest_RandomSint64()
|
||||
Sint64 SDLTest_RandomSint64(void)
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -425,24 +425,24 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
|
||||
validDomain);
|
||||
}
|
||||
|
||||
float SDLTest_RandomUnitFloat()
|
||||
float SDLTest_RandomUnitFloat(void)
|
||||
{
|
||||
return SDLTest_RandomUint32() / (float)UINT_MAX;
|
||||
}
|
||||
|
||||
float SDLTest_RandomFloat()
|
||||
float SDLTest_RandomFloat(void)
|
||||
{
|
||||
return (float)(SDLTest_RandomUnitDouble() * 2.0 * (double)FLT_MAX - (double)(FLT_MAX));
|
||||
}
|
||||
|
||||
double
|
||||
SDLTest_RandomUnitDouble()
|
||||
SDLTest_RandomUnitDouble(void)
|
||||
{
|
||||
return (double)(SDLTest_RandomUint64() >> 11) * (1.0 / 9007199254740992.0);
|
||||
}
|
||||
|
||||
double
|
||||
SDLTest_RandomDouble()
|
||||
SDLTest_RandomDouble(void)
|
||||
{
|
||||
double r = 0.0;
|
||||
double s = 1.0;
|
||||
@@ -456,7 +456,7 @@ SDLTest_RandomDouble()
|
||||
return r;
|
||||
}
|
||||
|
||||
char *SDLTest_RandomAsciiString()
|
||||
char *SDLTest_RandomAsciiString(void)
|
||||
{
|
||||
return SDLTest_RandomAsciiStringWithMaximumLength(255);
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
|
||||
#endif
|
||||
|
||||
/* Gets a timer value in seconds */
|
||||
static float GetClock()
|
||||
static float GetClock(void)
|
||||
{
|
||||
float currentClock = SDL_GetPerformanceCounter() / (float)SDL_GetPerformanceFrequency();
|
||||
return currentClock;
|
||||
|
||||
@@ -540,7 +540,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlit = {
|
||||
/**
|
||||
* \brief Returns the Blit test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlit()
|
||||
SDL_Surface *SDLTest_ImageBlit(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlit.pixel_data,
|
||||
@@ -1014,7 +1014,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
|
||||
/**
|
||||
* \brief Returns the BlitColor test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitColor()
|
||||
SDL_Surface *SDLTest_ImageBlitColor(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitColor.pixel_data,
|
||||
@@ -1651,7 +1651,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
|
||||
/**
|
||||
* \brief Returns the BlitAlpha test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitAlpha()
|
||||
SDL_Surface *SDLTest_ImageBlitAlpha(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitAlpha.pixel_data,
|
||||
|
||||
@@ -580,7 +580,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = {
|
||||
/**
|
||||
* \brief Returns the BlitBlendAdd test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitBlendAdd()
|
||||
SDL_Surface *SDLTest_ImageBlitBlendAdd(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitBlendAdd.pixel_data,
|
||||
@@ -1171,7 +1171,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = {
|
||||
/**
|
||||
* \brief Returns the BlitBlend test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitBlend()
|
||||
SDL_Surface *SDLTest_ImageBlitBlend(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitBlend.pixel_data,
|
||||
@@ -1592,7 +1592,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = {
|
||||
/**
|
||||
* \brief Returns the BlitBlendMod test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitBlendMod()
|
||||
SDL_Surface *SDLTest_ImageBlitBlendMod(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitBlendMod.pixel_data,
|
||||
@@ -2396,7 +2396,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = {
|
||||
/**
|
||||
* \brief Returns the BlitBlendNone test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitBlendNone()
|
||||
SDL_Surface *SDLTest_ImageBlitBlendNone(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitBlendNone.pixel_data,
|
||||
@@ -2932,7 +2932,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = {
|
||||
/**
|
||||
* \brief Returns the BlitBlendAll test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageBlitBlendAll()
|
||||
SDL_Surface *SDLTest_ImageBlitBlendAll(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageBlitBlendAll.pixel_data,
|
||||
|
||||
@@ -223,7 +223,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageFace = {
|
||||
/**
|
||||
* \brief Returns the Face test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImageFace()
|
||||
SDL_Surface *SDLTest_ImageFace(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imageFace.pixel_data,
|
||||
|
||||
@@ -504,7 +504,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = {
|
||||
/**
|
||||
* \brief Returns the Primitives test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImagePrimitives()
|
||||
SDL_Surface *SDLTest_ImagePrimitives(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imagePrimitives.pixel_data,
|
||||
|
||||
@@ -677,7 +677,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = {
|
||||
/**
|
||||
* \brief Returns the PrimitivesBlend test image as SDL_Surface.
|
||||
*/
|
||||
SDL_Surface *SDLTest_ImagePrimitivesBlend()
|
||||
SDL_Surface *SDLTest_ImagePrimitivesBlend(void)
|
||||
{
|
||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
(void *)SDLTest_imagePrimitivesBlend.pixel_data,
|
||||
|
||||
@@ -195,7 +195,7 @@ static void SDLCALL SDLTest_TrackedFree(void *ptr)
|
||||
SDL_free_orig(ptr);
|
||||
}
|
||||
|
||||
int SDLTest_TrackAllocations()
|
||||
int SDLTest_TrackAllocations(void)
|
||||
{
|
||||
if (SDL_malloc_orig) {
|
||||
return 0;
|
||||
@@ -220,7 +220,7 @@ int SDLTest_TrackAllocations()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SDLTest_LogAllocations()
|
||||
void SDLTest_LogAllocations(void)
|
||||
{
|
||||
char *message = NULL;
|
||||
size_t message_size = 0;
|
||||
|
||||
Reference in New Issue
Block a user