mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Fix some format specifier warnings
The warnings were produced by GCC 9.2.x for x86_64-linux-gnu or i386-pc-msdosdjgpp targets. Most of the fixes involve changing the type of a variable rather than the format specifier. For many of the affected test conuter variables, a basic int seems sufficient. Some format specifier warnings still remain for cases where changing type or casting seemed inappropriate. Those warnings will probably require some new format specifier macros (e.g. SDL_PRIu32).
This commit is contained in:
@@ -62,7 +62,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
else if (SDL_strcasecmp(argv[i], "--execKey") == 0) {
|
||||
if (argv[i + 1]) {
|
||||
SDL_sscanf(argv[i + 1], "%"SDL_PRIu64, (long long unsigned int *)&userExecKey);
|
||||
SDL_sscanf(argv[i + 1], "%"SDL_PRIu64, &userExecKey);
|
||||
consumed = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,7 +1163,7 @@ sdltest_randomAsciiStringWithMaximumLength(void *arg)
|
||||
|
||||
targetLen = 16 + SDLTest_RandomUint8();
|
||||
result = SDLTest_RandomAsciiStringWithMaximumLength((int) targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", (int) targetLen);
|
||||
SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL");
|
||||
if (result != NULL) {
|
||||
len = SDL_strlen(result);
|
||||
@@ -1184,7 +1184,7 @@ sdltest_randomAsciiStringWithMaximumLength(void *arg)
|
||||
/* Negative test */
|
||||
targetLen = 0;
|
||||
result = SDLTest_RandomAsciiStringWithMaximumLength((int) targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", (int) targetLen);
|
||||
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
|
||||
lastError = (char *)SDL_GetError();
|
||||
SDLTest_AssertPass("SDL_GetError()");
|
||||
@@ -1217,7 +1217,7 @@ sdltest_randomAsciiStringOfSize(void *arg)
|
||||
/* Positive test */
|
||||
targetLen = 16 + SDLTest_RandomUint8();
|
||||
result = SDLTest_RandomAsciiStringOfSize((int) targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", (int) targetLen);
|
||||
SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL");
|
||||
if (result != NULL) {
|
||||
len = SDL_strlen(result);
|
||||
@@ -1238,7 +1238,7 @@ sdltest_randomAsciiStringOfSize(void *arg)
|
||||
/* Negative test */
|
||||
targetLen = 0;
|
||||
result = SDLTest_RandomAsciiStringOfSize((int) targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", targetLen);
|
||||
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", (int) targetLen);
|
||||
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
|
||||
lastError = (char *)SDL_GetError();
|
||||
SDLTest_AssertPass("SDL_GetError()");
|
||||
|
||||
@@ -107,7 +107,7 @@ main(int argc, char *argv[])
|
||||
now = SDL_GetPerformanceCounter();
|
||||
SDL_Log("1 million iterations of ticktock took %f ms\n", (double)((now - start)*1000) / SDL_GetPerformanceFrequency());
|
||||
|
||||
SDL_Log("Performance counter frequency: %"SDL_PRIu64"\n", (unsigned long long) SDL_GetPerformanceFrequency());
|
||||
SDL_Log("Performance counter frequency: %"SDL_PRIu64"\n", SDL_GetPerformanceFrequency());
|
||||
start32 = SDL_GetTicks();
|
||||
start = SDL_GetPerformanceCounter();
|
||||
SDL_Delay(1000);
|
||||
|
||||
Reference in New Issue
Block a user