Squashed 'external/SDL/' changes from 95c3ee77c10..b7362850534
b7362850534 examples/renderer/08-rotating-textures: Fix compiler warning on MSVC . 37d62deca16 examples/renderer/10-geometry: Fixes and cleanups. 0758b2a0c4c examples: Added renderer/10-geometry 1a90e092623 examples: Added renderer/09-scaling-textures 4fdeb6861bd examples: a few renderer fixes. 66b92e95acf examples: renamed renderer sources to match other example directories. ffcf372d275 examples: Added renderer/08-rotating-textures 0c7334cce39 examples: Added renderer/07-streaming-textures 2bd3d9cfb7b examples: Added renderer/06-textures 9d0b3eded61 examples: added renderer/05-rectangles 3413617cb64 examples: added renderer/04-points b0e528cc88a Switched ifdef from negative to positive 97d1056e16d GPU: MSAA fixes (#10917) 254b36361e5 Add SDL_PRILL? format specifiers specifically for long long type. 6f80d47d64d Use hexidecimal code for ± 4392233007d Removed tabs from headers 89c6bc5f502 Prefer Vulkan even on Windows (#10912) 980b4ff6dbe GPU: Vulkan descriptor management rewrite (#10910) fcb8a2c016c wayland: Fix animated cursor timing ea2e2e451d1 Better fix for initializing Android environment variables 095fb5f5221 Fixed infinite recursion at startup on Android 88a01fbc964 testautomation_stdlib.c: fix -Wformat warnings from mingw with %lld/%llu b4e2777820c examples/renderer/03-lines: Fix compiler warning on Visual Studio. 2e3e5abd7d4 examples/renderer/03-lines: use a gray background. fd0ce75e2ea tests: Fix tests when run with the --high-pixel-density flag 745d5e4991d examples/renderer/03-lines: Make this less obnoxious to look at. 1b266ec13d3 examples: added renderer/03-lines 6771a6020da testcamera: don't enable verbose logging 594edb6bd29 Add Thrustmaster TMX VID & PID to wheel device list. 34c60113607 Fixed Windows build d29a0e3f310 Fixed warning: no previous prototype for function 7a924b36aeb compile_shaders.sh shouldn't be in the SDL framework 1f727b61f3c Sync SDL3 wiki -> header 398dff7c259 Added support for the HORI licensed Steam Controller 481203c074d Fixed Xcode warnings 7edf7fad664 fix bool define when SDL_DEFINE_STDBOOL is defined: ff90570a3cf define SDL_DEFINE_STDBOOL for gcc < 3 git-subtree-dir: external/SDL git-subtree-split: b7362850534295f076c19f7f8bffa06e530d0968
This commit is contained in:
@@ -714,6 +714,9 @@ static int SDLCALL stdlib_getsetenv(void *arg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define FMT_PRILLd "%" SDL_PRILLd
|
||||
#define FMT_PRILLu "%" SDL_PRILLu
|
||||
|
||||
/**
|
||||
* Call to SDL_sscanf
|
||||
*/
|
||||
@@ -781,7 +784,7 @@ static int SDLCALL stdlib_sscanf(void *arg)
|
||||
|
||||
SIZED_TEST_CASE(short, short, "%hd")
|
||||
SIZED_TEST_CASE(long, long, "%ld")
|
||||
SIZED_TEST_CASE(long long, long_long, "%lld")
|
||||
SIZED_TEST_CASE(long long, long_long, FMT_PRILLd)
|
||||
|
||||
size_output = 123;
|
||||
expected_size_output = ~((size_t)0);
|
||||
@@ -1301,26 +1304,26 @@ static int SDLCALL stdlib_strtox(void *arg)
|
||||
} while (0)
|
||||
|
||||
// infer decimal
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "\t 123abcxyz", 0, 123, 6); // skip leading space
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "+123abcxyz", 0, 123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "+123abcxyz", 0, 123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "-123abcxyz", 0, -123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "9999999999999999999999999999999999999999abcxyz", 0, ullong_max, 40);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "\t 123abcxyz", 0, 123, 6); // skip leading space
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "+123abcxyz", 0, 123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "+123abcxyz", 0, 123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-123abcxyz", 0, -123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "9999999999999999999999999999999999999999abcxyz", 0, ullong_max, 40);
|
||||
|
||||
// infer hexadecimal
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "0x123abcxyz", 0, 0x123abc, 8);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "0X123ABCXYZ", 0, 0x123abc, 8); // uppercase X
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0x123abcxyz", 0, 0x123abc, 8);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0X123ABCXYZ", 0, 0x123abc, 8); // uppercase X
|
||||
|
||||
// infer octal
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "0123abcxyz", 0, 0123, 4);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0123abcxyz", 0, 0123, 4);
|
||||
|
||||
// arbitrary bases
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "00110011", 2, 51, 8);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "-uvwxyz", 32, -991, 3);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "ZzZzZzZzZzZzZzZzZzZzZzZzZ", 36, ullong_max, 25);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "00110011", 2, 51, 8);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-uvwxyz", 32, -991, 3);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "ZzZzZzZzZzZzZzZzZzZzZzZzZ", 36, ullong_max, 25);
|
||||
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "-0", 10, 0, 2);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", " - 1", 0, 0, 0); // invalid input
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-0", 10, 0, 2);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, " - 1", 0, 0, 0); // invalid input
|
||||
|
||||
// We know that SDL_strtol, SDL_strtoul and SDL_strtoll share the same code path as SDL_strtoull under the hood,
|
||||
// so the most interesting test cases are those close to the bounds of the integer type.
|
||||
@@ -1342,15 +1345,15 @@ static int SDLCALL stdlib_strtox(void *arg)
|
||||
}
|
||||
|
||||
if (sizeof(long long) == 8) {
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, "%lld", "9223372036854775807", 10, 9223372036854775807LL, 19);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, "%lld", "9223372036854775808", 10, 9223372036854775807LL, 19);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, "%lld", "-9223372036854775808", 10, -9223372036854775807LL - 1, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, "%lld", "-9223372036854775809", 10, -9223372036854775807LL - 1, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, "%lld", "-9999999999999999999999999999999999999999", 10, -9223372036854775807LL - 1, 41);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "9223372036854775807", 10, 9223372036854775807LL, 19);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "9223372036854775808", 10, 9223372036854775807LL, 19);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-9223372036854775808", 10, -9223372036854775807LL - 1, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-9223372036854775809", 10, -9223372036854775807LL - 1, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-9999999999999999999999999999999999999999", 10, -9223372036854775807LL - 1, 41);
|
||||
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "18446744073709551615", 10, 18446744073709551615ULL, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "18446744073709551616", 10, 18446744073709551615ULL, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, "%llu", "-18446744073709551615", 10, 1, 21);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLd, "18446744073709551615", 10, 18446744073709551615ULL, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLd, "18446744073709551616", 10, 18446744073709551615ULL, 20);
|
||||
STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLd, "-18446744073709551615", 10, 1, 21);
|
||||
}
|
||||
|
||||
#undef STRTOX_TEST_CASE
|
||||
|
||||
Reference in New Issue
Block a user