Update SDL2 to version 2.28.1.

This commit is contained in:
Sasha Szpakowski
2023-08-31 22:21:03 -03:00
parent 99b2757fc5
commit a82fcdd079
1394 changed files with 313046 additions and 190617 deletions
+14 -17
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -15,8 +15,8 @@
static int SDLCALL
num_compare(const void *_a, const void *_b)
{
const int a = *((const int *) _a);
const int b = *((const int *) _b);
const int a = *((const int *)_a);
const int b = *((const int *)_b);
return (a < b) ? -1 : ((a > b) ? 1 : 0);
}
@@ -28,7 +28,7 @@ test_sort(const char *desc, int *nums, const int arraylen)
SDL_Log("test: %s arraylen=%d", desc, arraylen);
SDL_qsort(nums, arraylen, sizeof (nums[0]), num_compare);
SDL_qsort(nums, arraylen, sizeof(nums[0]), num_compare);
prev = nums[0];
for (i = 1; i < arraylen; i++) {
@@ -41,22 +41,21 @@ test_sort(const char *desc, int *nums, const int arraylen)
}
}
int
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
static int nums[1024 * 100];
static const int itervals[] = { SDL_arraysize(nums), 12 };
int iteration;
SDLTest_RandomContext rndctx;
if (argc > 1)
{
if (argc > 1) {
int success;
Uint64 seed = 0;
if (argv[1][0] == '0' && argv[1][1] == 'x')
success = SDL_sscanf(argv[1] + 2, "%"SDL_PRIx64, &seed);
else
success = SDL_sscanf(argv[1], "%"SDL_PRIu64, &seed);
if (argv[1][0] == '0' && argv[1][1] == 'x') {
success = SDL_sscanf(argv[1] + 2, "%" SDL_PRIx64, &seed);
} else {
success = SDL_sscanf(argv[1], "%" SDL_PRIu64, &seed);
}
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid seed. Use a decimal or hexadecimal number.\n");
return 1;
@@ -66,9 +65,7 @@ main(int argc, char *argv[])
return 1;
}
SDLTest_RandomInit(&rndctx, (unsigned int)(seed >> 32), (unsigned int)(seed & 0xffffffff));
}
else
{
} else {
SDLTest_RandomInitTime(&rndctx);
}
SDL_Log("Using random seed 0x%08x%08x\n", rndctx.x, rndctx.c);
@@ -85,11 +82,11 @@ main(int argc, char *argv[])
for (i = 0; i < arraylen; i++) {
nums[i] = i;
}
nums[arraylen-1] = -1;
nums[arraylen - 1] = -1;
test_sort("already sorted except last element", nums, arraylen);
for (i = 0; i < arraylen; i++) {
nums[i] = (arraylen-1) - i;
nums[i] = (arraylen - 1) - i;
}
test_sort("reverse sorted", nums, arraylen);