Browse Source

N3DS: Fix `-Wformat` warnings in tests.

All warnings were about invalid specifiers. Since U/Sint32 is a long,
using `%d` emits a -Wformat warning.
Pierre Wendling 2 years ago
parent
commit
6784d84c9d

+ 2 - 1
test/checkkeysthreads.c

@@ -162,7 +162,8 @@ loop()
     fprintf(stderr, "starting loop\n"); fflush(stderr);
     // while (SDL_PollEvent(&event)) {
     while (!done && SDL_WaitEvent(&event)) {
-        fprintf(stderr, "got event type: %d\n", event.type); fflush(stderr);
+        fprintf(stderr, "got event type: %" SDL_PRIu32 "\n", event.type);
+        fflush(stderr);
         switch (event.type) {
         case SDL_KEYDOWN:
         case SDL_KEYUP:

+ 3 - 3
test/controllermap.c

@@ -373,8 +373,8 @@ WatchJoystick(SDL_Joystick * joystick)
 
     /* Print info about the joystick we are watching */
     name = SDL_JoystickName(joystick);
-    SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick),
-           name ? name : "Unknown Joystick");
+    SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_JoystickInstanceID(joystick),
+            name ? name : "Unknown Joystick");
     SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n",
            SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick),
            SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick));
@@ -781,7 +781,7 @@ main(int argc, char *argv[])
             SDL_Log("      balls: %d\n", SDL_JoystickNumBalls(joystick));
             SDL_Log("       hats: %d\n", SDL_JoystickNumHats(joystick));
             SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
-            SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
+            SDL_Log("instance id: %" SDL_PRIu32 "\n", SDL_JoystickInstanceID(joystick));
             SDL_Log("       guid: %s\n", guid);
             SDL_Log("    VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
             SDL_JoystickClose(joystick);

+ 5 - 5
test/testautomation_audio.c

@@ -725,7 +725,7 @@ int audio_openCloseAndGetAudioStatus()
        /* Open device */
        id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
        SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device);
-       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %i", id);
+       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id);
        if (id > 1) {
 
          /* Check device audio status */
@@ -783,11 +783,11 @@ int audio_lockUnlockOpenAudioDevice()
        /* Open device */
        id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
        SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device);
-       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %i", id);
+       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id);
        if (id > 1) {
          /* Lock to protect callback */
          SDL_LockAudioDevice(id);
-         SDLTest_AssertPass("SDL_LockAudioDevice(%i)", id);
+         SDLTest_AssertPass("SDL_LockAudioDevice(%" SDL_PRIu32 ")", id);
 
          /* Simulate callback processing */
          SDL_Delay(10);
@@ -795,7 +795,7 @@ int audio_lockUnlockOpenAudioDevice()
 
          /* Unlock again */
          SDL_UnlockAudioDevice(id);
-         SDLTest_AssertPass("SDL_UnlockAudioDevice(%i)", id);
+         SDLTest_AssertPass("SDL_UnlockAudioDevice(%" SDL_PRIu32 ")", id);
 
          /* Close device again */
          SDL_CloseAudioDevice(id);
@@ -945,7 +945,7 @@ int audio_openCloseAudioDeviceConnected()
        /* Open device */
        id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
        SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device);
-       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %i", id);
+       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %" SDL_PRIu32, id);
        if (id > 1) {
 
 /* TODO: enable test code when function is available in SDL2 */

+ 1 - 1
test/testautomation_guid.c

@@ -108,7 +108,7 @@ TestGuidToString(void *arg)
             /* Check bytes before guid_str_buf */
             expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (fill_char << 24);
             SDL_memcpy(&actual_prefix, guid_str_buf, 4);
-            SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %i, got: %i, at size=%d", expected_prefix, actual_prefix, size);
+            SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32 ", at size=%d", expected_prefix, actual_prefix, size);
 
             /* Check that we did not overwrite too much */
             written_size = 0;

+ 13 - 13
test/testautomation_keyboard.c

@@ -67,37 +67,37 @@ keyboard_getKeyFromName(void *arg)
    /* Case where Key is known, 1 character input */
    result = SDL_GetKeyFromName("A");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)");
-   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %i", SDLK_a, result);
+   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result);
 
    /* Case where Key is known, 2 character input */
    result = SDL_GetKeyFromName("F1");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/double)");
-   SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %i", SDLK_F1, result);
+   SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_F1, result);
 
    /* Case where Key is known, 3 character input */
    result = SDL_GetKeyFromName("End");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/triple)");
-   SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %i", SDLK_END, result);
+   SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_END, result);
 
    /* Case where Key is known, 4 character input */
    result = SDL_GetKeyFromName("Find");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/quad)");
-   SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %i", SDLK_FIND, result);
+   SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_FIND, result);
 
    /* Case where Key is known, multiple character input */
    result = SDL_GetKeyFromName("AudioStop");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/multi)");
-   SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %i", SDLK_AUDIOSTOP, result);
+   SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_AUDIOSTOP, result);
 
    /* Case where Key is unknown */
    result = SDL_GetKeyFromName("NotThere");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(unknown)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
 
    /* Case where input is NULL/invalid */
    result = SDL_GetKeyFromName(NULL);
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(NULL)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
 
    return TEST_COMPLETED;
 }
@@ -134,12 +134,12 @@ keyboard_getKeyFromScancode(void *arg)
    /* Case where input is valid */
    result = SDL_GetKeyFromScancode(SDL_SCANCODE_A);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)");
-   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %i", SDLK_a, result);
+   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result);
 
    /* Case where input is zero */
    result = SDL_GetKeyFromScancode(0);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
 
    /* Clear error message */
    SDL_ClearError();
@@ -148,13 +148,13 @@ keyboard_getKeyFromScancode(void *arg)
    /* Case where input is invalid (too small) */
    result = SDL_GetKeyFromScancode(-999);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
    _checkInvalidScancodeError();
 
    /* Case where input is invalid (too big) */
    result = SDL_GetKeyFromScancode(999);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
    _checkInvalidScancodeError();
 
    return TEST_COMPLETED;
@@ -258,7 +258,7 @@ keyboard_getKeyNameNegative(void *arg)
    /* Unknown keycode */
    keycode = SDLK_UNKNOWN;
    result = (char *)SDL_GetKeyName(keycode);
-   SDLTest_AssertPass("Call to SDL_GetKeyName(%d/unknown)", keycode);
+   SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/unknown)", keycode);
    SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
    SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
 
@@ -269,7 +269,7 @@ keyboard_getKeyNameNegative(void *arg)
    /* Negative keycode */
    keycode = (SDL_Keycode)SDLTest_RandomIntegerInRange(-255, -1);
    result = (char *)SDL_GetKeyName(keycode);
-   SDLTest_AssertPass("Call to SDL_GetKeyName(%d/negative)", keycode);
+   SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/negative)", keycode);
    SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
    SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
    _checkInvalidScancodeError();

+ 6 - 6
test/testautomation_math.c

@@ -183,7 +183,7 @@ helper_range(const char *func_name, d_to_d_func func)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("%s: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("%s: Testing a range of %u values with steps of %" SDL_PRIu32,
                        func_name,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
@@ -770,7 +770,7 @@ copysign_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Copysign: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Copysign: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -973,7 +973,7 @@ fmod_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Fmod: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Fmod: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -1684,7 +1684,7 @@ pow_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Pow: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Pow: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -2011,7 +2011,7 @@ cos_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Cos: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Cos: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -2129,7 +2129,7 @@ sin_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Sin: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Sin: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 

+ 8 - 8
test/testautomation_mouse.c

@@ -41,21 +41,21 @@ mouse_getMouseState(void *arg)
    /* Case where x, y pointer is NULL */
    state = SDL_GetMouseState(NULL, NULL);
    SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)");
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x pointer is not NULL */
    x = INT_MIN;
    state = SDL_GetMouseState(&x, NULL);
    SDLTest_AssertPass("Call to SDL_GetMouseState(&x, NULL)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where y pointer is not NULL */
    y = INT_MIN;
    state = SDL_GetMouseState(NULL, &y);
    SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, &y)");
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x and y pointer is not NULL */
    x = INT_MIN;
@@ -64,7 +64,7 @@ mouse_getMouseState(void *arg)
    SDLTest_AssertPass("Call to SDL_GetMouseState(&x, &y)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    return TEST_COMPLETED;
 }
@@ -87,21 +87,21 @@ mouse_getRelativeMouseState(void *arg)
    /* Case where x, y pointer is NULL */
    state = SDL_GetRelativeMouseState(NULL, NULL);
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)");
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x pointer is not NULL */
    x = INT_MIN;
    state = SDL_GetRelativeMouseState(&x, NULL);
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, NULL)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where y pointer is not NULL */
    y = INT_MIN;
    state = SDL_GetRelativeMouseState(NULL, &y);
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, &y)");
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x and y pointer is not NULL */
    x = INT_MIN;
@@ -110,7 +110,7 @@ mouse_getRelativeMouseState(void *arg)
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, &y)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    return TEST_COMPLETED;
 }

+ 12 - 12
test/testautomation_pixels.c

@@ -137,18 +137,18 @@ pixels_allocFreeFormat(void *arg)
 
   /* Blank/unknown format */
   format = 0;
-  SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
+  SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
 
   /* Allocate format */
   result = SDL_AllocFormat(format);
   SDLTest_AssertPass("Call to SDL_AllocFormat()");
   SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
   if (result != NULL) {
-    SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
+    SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
     SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel);
     SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel);
     masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
-    SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %u", masks);
+    SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %" SDL_PRIu32, masks);
 
     /* Deallocate again */
     SDL_FreeFormat(result);
@@ -158,19 +158,19 @@ pixels_allocFreeFormat(void *arg)
   /* RGB formats */
   for (i = 0; i < _numRGBPixelFormats; i++) {
     format = _RGBPixelFormats[i];
-    SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
 
     /* Allocate format */
     result = SDL_AllocFormat(format);
     SDLTest_AssertPass("Call to SDL_AllocFormat()");
     SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
     if (result != NULL) {
-      SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
+      SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
       SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);
       SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);
       if (result->palette != NULL) {
          masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
-         SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks);
+         SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks);
       }
 
       /* Deallocate again */
@@ -182,7 +182,7 @@ pixels_allocFreeFormat(void *arg)
   /* Non-RGB formats */
   for (i = 0; i < _numNonRGBPixelFormats; i++) {
     format = _nonRGBPixelFormats[i];
-    SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
 
     /* Try to allocate format */
     result = SDL_AllocFormat(format);
@@ -198,7 +198,7 @@ pixels_allocFreeFormat(void *arg)
     SDLTest_AssertPass("Call to SDL_ClearError()");
     format = _invalidPixelFormats[i];
     result = SDL_AllocFormat(format);
-    SDLTest_AssertPass("Call to SDL_AllocFormat(%u)", format);
+    SDLTest_AssertPass("Call to SDL_AllocFormat(%" SDL_PRIu32 ")", format);
     SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
     error = SDL_GetError();
     SDLTest_AssertPass("Call to SDL_GetError()");
@@ -241,7 +241,7 @@ pixels_getPixelFormatName(void *arg)
 
   /* Blank/undefined format */
   format = 0;
-  SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
+  SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
 
   /* Get name of format */
   result = SDL_GetPixelFormatName(format);
@@ -256,7 +256,7 @@ pixels_getPixelFormatName(void *arg)
   /* RGB formats */
   for (i = 0; i < _numRGBPixelFormats; i++) {
     format = _RGBPixelFormats[i];
-    SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
 
     /* Get name of format */
     result = SDL_GetPixelFormatName(format);
@@ -272,7 +272,7 @@ pixels_getPixelFormatName(void *arg)
   /* Non-RGB formats */
   for (i = 0; i < _numNonRGBPixelFormats; i++) {
     format = _nonRGBPixelFormats[i];
-    SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
 
     /* Get name of format */
     result = SDL_GetPixelFormatName(format);
@@ -293,7 +293,7 @@ pixels_getPixelFormatName(void *arg)
   for (i = 0; i < _numInvalidPixelFormats; i++) {
     format = _invalidPixelFormats[i];
     result = SDL_GetPixelFormatName(format);
-    SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%u)", format);
+    SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%" SDL_PRIu32 ")", format);
     SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
     if (result != NULL) {
       SDLTest_AssertCheck(result[0] != '\0',

+ 1 - 1
test/testautomation_platform.c

@@ -106,7 +106,7 @@ int platform_testEndianessAndSwap(void *arg)
 
     /* Test 32 swap. */
     SDLTest_AssertCheck( SDL_Swap32(value32) == swapped32,
-             "SDL_Swap32(): 32 bit swapped: 0x%X => 0x%X",
+             "SDL_Swap32(): 32 bit swapped: 0x%" SDL_PRIX32 " => 0x%" SDL_PRIX32,
              value32, SDL_Swap32(value32) );
 
     /* Test 64 swap. */

+ 14 - 14
test/testautomation_rwops.c

@@ -239,7 +239,7 @@ rwops_testMem (void)
    if (rw == NULL) return TEST_ABORTED;
 
    /* Check type */
-   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY, "Verify RWops type is SDL_RWOPS_MEMORY; expected: %d, got: %d", SDL_RWOPS_MEMORY, rw->type);
+   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY, "Verify RWops type is SDL_RWOPS_MEMORY; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations(rw, 1);
@@ -275,7 +275,7 @@ rwops_testConstMem (void)
    if (rw == NULL) return TEST_ABORTED;
 
    /* Check type */
-   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY_RO, "Verify RWops type is SDL_RWOPS_MEMORY_RO; expected: %d, got: %d", SDL_RWOPS_MEMORY_RO, rw->type);
+   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY_RO, "Verify RWops type is SDL_RWOPS_MEMORY_RO; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY_RO, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations( rw, 0 );
@@ -321,8 +321,8 @@ rwops_testFileRead(void)
       "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type);
 #else
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 #endif
 
    /* Run generic tests */
@@ -368,8 +368,8 @@ rwops_testFileWrite(void)
       "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type);
 #else
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 #endif
 
    /* Run generic tests */
@@ -420,8 +420,8 @@ rwops_testFPRead(void)
 
    /* Check type */
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations( rw, 0 );
@@ -473,8 +473,8 @@ rwops_testFPWrite(void)
 
    /* Check type */
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations( rw, 1 );
@@ -506,8 +506,8 @@ rwops_testAllocFree (void)
 
    /* Check type */
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_UNKNOWN,
-      "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %d", SDL_RWOPS_UNKNOWN, rw->type);
+       rw->type == SDL_RWOPS_UNKNOWN,
+       "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_UNKNOWN, rw->type);
 
    /* Free context again */
    SDL_FreeRW(rw);
@@ -684,7 +684,7 @@ rwops_testFileWriteReadEndian(void)
      SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test);
      BE32test = SDL_ReadBE32(rw);
      SDLTest_AssertPass("Call to SDL_ReadBE32()");
-     SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test);
+     SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, BE32value, BE32test);
      BE64test = SDL_ReadBE64(rw);
      SDLTest_AssertPass("Call to SDL_ReadBE64()");
      SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, BE64value, BE64test);
@@ -693,7 +693,7 @@ rwops_testFileWriteReadEndian(void)
      SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test);
      LE32test = SDL_ReadLE32(rw);
      SDLTest_AssertPass("Call to SDL_ReadLE32()");
-     SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test);
+     SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, LE32value, LE32test);
      LE64test = SDL_ReadLE64(rw);
      SDLTest_AssertPass("Call to SDL_ReadLE64()");
      SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, LE64value, LE64test);

+ 14 - 14
test/testautomation_sdltest.c

@@ -891,8 +891,8 @@ sdltest_randomBoundaryNumberSint32(void *arg)
   sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE);
   SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
   SDLTest_AssertCheck(
-    sresult == long_min,
-    "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
+      sresult == long_min,
+      "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult);
   lastError = (char *)SDL_GetError();
   SDLTest_AssertPass("SDL_GetError()");
   SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
@@ -901,8 +901,8 @@ sdltest_randomBoundaryNumberSint32(void *arg)
   sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE);
   SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
   SDLTest_AssertCheck(
-    sresult == long_max,
-    "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_max, sresult);
+      sresult == long_max,
+      "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_max, sresult);
   lastError = (char *)SDL_GetError();
   SDLTest_AssertPass("SDL_GetError()");
   SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
@@ -911,8 +911,8 @@ sdltest_randomBoundaryNumberSint32(void *arg)
   sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE);
   SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
   SDLTest_AssertCheck(
-    sresult == long_min,
-    "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
+      sresult == long_min,
+      "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult);
   lastError = (char *)SDL_GetError();
   SDLTest_AssertPass("SDL_GetError()");
   SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
@@ -1058,56 +1058,56 @@ sdltest_randomIntegerInRange(void *arg)
   max = min + (Sint32)SDLTest_RandomUint8() + 2;
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,max)");
-  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
+  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
 
   /* One Range */
   min = (Sint32)SDLTest_RandomSint16();
   max = min + 1;
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min+1)");
-  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
+  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
 
   /* Zero range */
   min = (Sint32)SDLTest_RandomSint16();
   max = min;
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min)");
-  SDLTest_AssertCheck(min == result, "Validated returned value; expected: %d, got: %d", min, result);
+  SDLTest_AssertCheck(min == result, "Validated returned value; expected: %" SDL_PRIs32 ", got: %" SDL_PRIs32, min, result);
 
   /* Zero range at zero */
   min = 0;
   max = 0;
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)");
-  SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %d", result);
+  SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %" SDL_PRIs32, result);
 
   /* Swapped min-max */
   min = (Sint32)SDLTest_RandomSint16();
   max = min + (Sint32)SDLTest_RandomUint8() + 2;
   result = SDLTest_RandomIntegerInRange(max, min);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)");
-  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
+  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
 
   /* Range with min at integer limit */
   min = long_min;
   max = long_max + (Sint32)SDLTest_RandomSint16();
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)");
-  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
+  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
 
   /* Range with max at integer limit */
   min = long_min - (Sint32)SDLTest_RandomSint16();
   max = long_max;
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)");
-  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
+  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
 
   /* Full integer range */
   min = long_min;
   max = long_max;
   result = SDLTest_RandomIntegerInRange(min, max);
   SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,SINT32_MAX)");
-  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
+  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
 
   return TEST_COMPLETED;
 }

+ 5 - 5
test/testautomation_timer.c

@@ -88,17 +88,17 @@ timer_delayAndGetTicks(void *arg)
   /* Get ticks count - should be non-zero by now */
   result = SDL_GetTicks();
   SDLTest_AssertPass("Call to SDL_GetTicks()");
-  SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %d", result);
+  SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result);
 
   /* Delay a bit longer and measure ticks and verify difference */
   SDL_Delay(testDelay);
-  SDLTest_AssertPass("Call to SDL_Delay(%d)", testDelay);
+  SDLTest_AssertPass("Call to SDL_Delay(%" SDL_PRIu32 ")", testDelay);
   result2 = SDL_GetTicks();
   SDLTest_AssertPass("Call to SDL_GetTicks()");
-  SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %d", result2);
+  SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result2);
   difference = result2 - result;
-  SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%d, got: %d", testDelay - marginOfError, difference);
-  SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%d, got: %d", testDelay + marginOfError, difference);
+  SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay - marginOfError, difference);
+  SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay + marginOfError, difference);
 
   return TEST_COMPLETED;
 }

+ 5 - 5
test/testautomation_video.c

@@ -346,7 +346,7 @@ video_getWindowFlags(void *arg)
   if (window != NULL) {
       actualFlags = SDL_GetWindowFlags(window);
       SDLTest_AssertPass("Call to SDL_GetWindowFlags()");
-      SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %d", flags, actualFlags);
+      SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %" SDL_PRIu32, flags, actualFlags);
   }
 
   /* Clean up */
@@ -985,13 +985,13 @@ video_getWindowId(void *arg)
 
   /* Get window from ID */
   result = SDL_GetWindowFromID(id);
-  SDLTest_AssertPass("Call to SDL_GetWindowID(%d)", id);
+  SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 ")", id);
   SDLTest_AssertCheck(result == window, "Verify result matches window pointer");
 
   /* Get window from random large ID, no result check */
   randomId = SDLTest_RandomIntegerInRange(UINT8_MAX,UINT16_MAX);
   result = SDL_GetWindowFromID(randomId);
-  SDLTest_AssertPass("Call to SDL_GetWindowID(%d/random_large)", randomId);
+  SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 "/random_large)", randomId);
 
   /* Get window from 0 and Uint32 max ID, no result check */
   result = SDL_GetWindowFromID(0);
@@ -1004,7 +1004,7 @@ video_getWindowId(void *arg)
 
   /* Get window from ID for closed window */
   result = SDL_GetWindowFromID(id);
-  SDLTest_AssertPass("Call to SDL_GetWindowID(%d/closed_window)", id);
+  SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 "/closed_window)", id);
   SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
 
   /* Negative test */
@@ -1036,7 +1036,7 @@ video_getWindowPixelFormat(void *arg)
   /* Get format */
   format = SDL_GetWindowPixelFormat(window);
   SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat()");
-  SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != %d, got: %d", SDL_PIXELFORMAT_UNKNOWN, format);
+  SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != %d, got: %" SDL_PRIu32, SDL_PIXELFORMAT_UNKNOWN, format);
 
   /* Clean up */
   _destroyVideoSuiteTestWindow(window);

+ 18 - 20
test/testgamecontroller.c

@@ -577,28 +577,26 @@ loop(void *arg)
         case SDL_CONTROLLERTOUCHPADDOWN:
         case SDL_CONTROLLERTOUCHPADMOTION:
         case SDL_CONTROLLERTOUCHPADUP:
-            SDL_Log("Controller %d touchpad %d finger %d %s %.2f, %.2f, %.2f\n",
-                event.ctouchpad.which,
-                event.ctouchpad.touchpad,
-                event.ctouchpad.finger,
-                (event.type == SDL_CONTROLLERTOUCHPADDOWN ? "pressed at" :
-                (event.type == SDL_CONTROLLERTOUCHPADUP ? "released at" :
-                "moved to")),
-                event.ctouchpad.x,
-                event.ctouchpad.y,
-                event.ctouchpad.pressure);
+            SDL_Log("Controller %" SDL_PRIs32 " touchpad %" SDL_PRIs32 " finger %" SDL_PRIs32 " %s %.2f, %.2f, %.2f\n",
+                    event.ctouchpad.which,
+                    event.ctouchpad.touchpad,
+                    event.ctouchpad.finger,
+                    (event.type == SDL_CONTROLLERTOUCHPADDOWN ? "pressed at" : (event.type == SDL_CONTROLLERTOUCHPADUP ? "released at" : "moved to")),
+                    event.ctouchpad.x,
+                    event.ctouchpad.y,
+                    event.ctouchpad.pressure);
             break;
 
 #define VERBOSE_SENSORS
 #ifdef VERBOSE_SENSORS
         case SDL_CONTROLLERSENSORUPDATE:
-            SDL_Log("Controller %d sensor %s: %.2f, %.2f, %.2f (%"SDL_PRIu64")\n",
-                event.csensor.which,
-                GetSensorName((SDL_SensorType)event.csensor.sensor),
-                event.csensor.data[0],
-                event.csensor.data[1],
-                event.csensor.data[2],
-                event.csensor.timestamp_us);
+            SDL_Log("Controller %" SDL_PRIs32 " sensor %s: %.2f, %.2f, %.2f (%" SDL_PRIu64 ")\n",
+                    event.csensor.which,
+                    GetSensorName((SDL_SensorType) event.csensor.sensor),
+                    event.csensor.data[0],
+                    event.csensor.data[1],
+                    event.csensor.data[2],
+                    event.csensor.timestamp_us);
             break;
 #endif /* VERBOSE_SENSORS */
 
@@ -608,7 +606,7 @@ loop(void *arg)
             if (event.caxis.value <= (-SDL_JOYSTICK_AXIS_MAX / 2) || event.caxis.value >= (SDL_JOYSTICK_AXIS_MAX / 2)) {
                 SetController(event.caxis.which);
             }
-            SDL_Log("Controller %d axis %s changed to %d\n", event.caxis.which, SDL_GameControllerGetStringForAxis((SDL_GameControllerAxis)event.caxis.axis), event.caxis.value);
+            SDL_Log("Controller %" SDL_PRIs32 " axis %s changed to %d\n", event.caxis.which, SDL_GameControllerGetStringForAxis((SDL_GameControllerAxis) event.caxis.axis), event.caxis.value);
             break;
 #endif /* VERBOSE_AXES */
 
@@ -617,7 +615,7 @@ loop(void *arg)
             if (event.type == SDL_CONTROLLERBUTTONDOWN) {
                 SetController(event.cbutton.which);
             }
-            SDL_Log("Controller %d button %s %s\n", event.cbutton.which, SDL_GameControllerGetStringForButton((SDL_GameControllerButton)event.cbutton.button), event.cbutton.state ? "pressed" : "released");
+            SDL_Log("Controller %" SDL_PRIs32 " button %s %s\n", event.cbutton.which, SDL_GameControllerGetStringForButton((SDL_GameControllerButton) event.cbutton.button), event.cbutton.state ? "pressed" : "released");
 
             /* Cycle PS5 trigger effects when the microphone button is pressed */
             if (event.type == SDL_CONTROLLERBUTTONDOWN &&
@@ -628,7 +626,7 @@ loop(void *arg)
             break;
 
         case SDL_JOYBATTERYUPDATED:
-            SDL_Log("Controller %d battery state changed to %s\n", event.jbattery.which, power_level_strings[event.jbattery.level + 1]);
+            SDL_Log("Controller %" SDL_PRIs32 " battery state changed to %s\n", event.jbattery.which, power_level_strings[event.jbattery.level + 1]);
             break;
 
         case SDL_MOUSEBUTTONDOWN:

+ 2 - 2
test/testhotplug.c

@@ -79,7 +79,7 @@ main(int argc, char *argv[])
                     {
                         joystick = SDL_JoystickOpen(event.jdevice.which);
                         instance = SDL_JoystickInstanceID(joystick);
-                        SDL_Log("Joy Added  : %d : %s\n", event.jdevice.which, SDL_JoystickName(joystick));
+                        SDL_Log("Joy Added  : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_JoystickName(joystick));
                         if (enable_haptic)
                         {
                             if (SDL_JoystickIsHaptic(joystick))
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
                 case SDL_JOYDEVICEREMOVED:
                     if (instance == event.jdevice.which)
                     {
-                        SDL_Log("Joy Removed: %d\n", event.jdevice.which);
+                        SDL_Log("Joy Removed: %" SDL_PRIs32 "\n", event.jdevice.which);
                         instance = -1;
                         if(enable_haptic && haptic)
                         {

+ 9 - 8
test/testime.c

@@ -213,7 +213,7 @@ static int unifont_init(const char *fontname)
         if (codepoint <= UNIFONT_MAX_CODEPOINT)
         {
             if (unifontGlyph[codepoint].width > 0)
-                SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "unifont: Ignoring duplicate codepoint 0x%08x in hex file on line %d.\n", codepoint, lineNumber);
+                SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "unifont: Ignoring duplicate codepoint 0x%08" SDL_PRIx32 " in hex file on line %d.\n", codepoint, lineNumber);
             else
             {
                 unifontGlyph[codepoint].width = glyphWidth;
@@ -228,7 +228,7 @@ static int unifont_init(const char *fontname)
     } while (bytesRead > 0);
 
     SDL_RWclose(hexFile);
-    SDL_Log("unifont: Loaded %u glyphs.\n", numGlyphs);
+    SDL_Log("unifont: Loaded %" SDL_PRIu32 " glyphs.\n", numGlyphs);
     return 0;
 }
 
@@ -275,7 +275,7 @@ static int unifont_load_texture(Uint32 textureID)
 
     if (textureID >= UNIFONT_NUM_TEXTURES)
     {
-        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Tried to load out of range texture %u.\n", textureID);
+        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Tried to load out of range texture %" SDL_PRIu32 "\n", textureID);
         return -1;
     }
 
@@ -309,14 +309,14 @@ static int unifont_load_texture(Uint32 textureID)
         tex = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, UNIFONT_TEXTURE_WIDTH, UNIFONT_TEXTURE_WIDTH);
         if (tex == NULL)
         {
-            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to create texture %u for renderer %d.\n", textureID, i);
+            SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to create texture %" SDL_PRIu32 " for renderer %d.\n", textureID, i);
             return -1;
         }
         unifontTexture[UNIFONT_NUM_TEXTURES * i + textureID] = tex;
         SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND);
         if (SDL_UpdateTexture(tex, NULL, textureRGBA, UNIFONT_TEXTURE_PITCH) != 0)
         {
-            SDL_Log("unifont error: Failed to update texture %u data for renderer %d.\n", textureID, i);
+            SDL_Log("unifont error: Failed to update texture %" SDL_PRIu32 " data for renderer %d.\n", textureID, i);
         }
     }
 
@@ -762,10 +762,11 @@ int main(int argc, char *argv[])
                         break;
                     }
 
-                    SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08X = %s\n",
+                    SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s\n",
                             event.key.keysym.scancode,
                             SDL_GetScancodeName(event.key.keysym.scancode),
-                            event.key.keysym.sym, SDL_GetKeyName(event.key.keysym.sym));
+                            SDL_static_cast(Uint32, event.key.keysym.sym),
+                            SDL_GetKeyName(event.key.keysym.sym));
                     break;
 
                 case SDL_TEXTINPUT:
@@ -787,7 +788,7 @@ int main(int argc, char *argv[])
                     break;
 
                 case SDL_TEXTEDITING:
-                    SDL_Log("text editing \"%s\", selected range (%d, %d)\n",
+                    SDL_Log("text editing \"%s\", selected range (%" SDL_PRIs32 ", %" SDL_PRIs32 ")\n",
                             event.edit.text, event.edit.start, event.edit.length);
 
                     SDL_strlcpy(markedText, event.edit.text, SDL_TEXTEDITINGEVENT_TEXT_SIZE);

+ 13 - 13
test/testjoystick.c

@@ -87,7 +87,7 @@ PrintJoystick(SDL_Joystick *joy)
     SDL_Log("         balls: %d\n", SDL_JoystickNumBalls(joy));
     SDL_Log("          hats: %d\n", SDL_JoystickNumHats(joy));
     SDL_Log("       buttons: %d\n", SDL_JoystickNumButtons(joy));
-    SDL_Log("   instance id: %d\n", SDL_JoystickInstanceID(joy));
+    SDL_Log("   instance id: %" SDL_PRIs32 "\n", SDL_JoystickInstanceID(joy));
     SDL_Log("          guid: %s\n", guid);
     SDL_Log("       VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joy), SDL_JoystickGetProduct(joy));
 }
@@ -137,13 +137,13 @@ loop(void *arg)
             break;
 
         case SDL_JOYAXISMOTION:
-            SDL_Log("Joystick %d axis %d value: %d\n",
-                   event.jaxis.which,
-                   event.jaxis.axis, event.jaxis.value);
+            SDL_Log("Joystick %" SDL_PRIs32 " axis %d value: %d\n",
+                    event.jaxis.which,
+                    event.jaxis.axis, event.jaxis.value);
             break;
         case SDL_JOYHATMOTION:
-            SDL_Log("Joystick %d hat %d value:",
-                   event.jhat.which, event.jhat.hat);
+            SDL_Log("Joystick %" SDL_PRIs32 " hat %d value:",
+                    event.jhat.which, event.jhat.hat);
             if (event.jhat.value == SDL_HAT_CENTERED)
                 SDL_Log(" centered");
             if (event.jhat.value & SDL_HAT_UP)
@@ -157,21 +157,21 @@ loop(void *arg)
             SDL_Log("\n");
             break;
         case SDL_JOYBALLMOTION:
-            SDL_Log("Joystick %d ball %d delta: (%d,%d)\n",
-                   event.jball.which,
-                   event.jball.ball, event.jball.xrel, event.jball.yrel);
+            SDL_Log("Joystick %" SDL_PRIs32 " ball %d delta: (%d,%d)\n",
+                    event.jball.which,
+                    event.jball.ball, event.jball.xrel, event.jball.yrel);
             break;
         case SDL_JOYBUTTONDOWN:
-            SDL_Log("Joystick %d button %d down\n",
-                   event.jbutton.which, event.jbutton.button);
+            SDL_Log("Joystick %" SDL_PRIs32 " button %d down\n",
+                    event.jbutton.which, event.jbutton.button);
             /* First button triggers a 0.5 second full strength rumble */
             if (event.jbutton.button == 0) {
                 SDL_JoystickRumble(joystick, 0xFFFF, 0xFFFF, 500);
             }
             break;
         case SDL_JOYBUTTONUP:
-            SDL_Log("Joystick %d button %d up\n",
-                   event.jbutton.which, event.jbutton.button);
+            SDL_Log("Joystick %" SDL_PRIs32 " button %d up\n",
+                    event.jbutton.which, event.jbutton.button);
             break;
         case SDL_KEYDOWN:
             /* Press the L key to lag for 3 seconds, to see what happens

+ 3 - 3
test/testoffscreen.c

@@ -66,8 +66,8 @@ save_surface_to_bmp()
     surface = SDL_CreateRGBSurface(0, width, height, bbp, r_mask, g_mask, b_mask, a_mask);
     SDL_RenderReadPixels(renderer, NULL, pixel_format, (void*)surface->pixels, surface->pitch);
 
-    SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
-        SDL_GetWindowID(window), ++frame_number);
+    SDL_snprintf(file, sizeof(file), "SDL_window%" SDL_PRIs32 "-%8.8d.bmp",
+                 SDL_GetWindowID(window), ++frame_number);
 
     SDL_SaveBMP(surface, file);
     SDL_FreeSurface(surface);
@@ -154,7 +154,7 @@ main(int argc, char *argv[])
             now = SDL_GetTicks();
             if (now > then) {
                 double fps = ((double) frames * 1000) / (now - then);
-                SDL_Log("Frames remaining: %i rendering at %2.2f frames per second\n", max_frames - frames, fps);
+                SDL_Log("Frames remaining: %" SDL_PRIu32 " rendering at %2.2f frames per second\n", max_frames - frames, fps);
             }
         }
     }

+ 3 - 2
test/testplatform.c

@@ -149,8 +149,9 @@ TestEndian(SDL_bool verbose)
         ++error;
     }
     if (verbose) {
-        SDL_Log("Value 32 = 0x%X, swapped = 0x%X\n", value32,
-               SDL_Swap32(value32));
+        SDL_Log("Value 32 = 0x%" SDL_PRIX32 ", swapped = 0x%" SDL_PRIX32 "\n",
+                value32,
+                SDL_Swap32(value32));
     }
     if (SDL_Swap32(value32) != swapped32) {
         if (verbose) {

+ 1 - 1
test/testrendertarget.c

@@ -72,7 +72,7 @@ DrawComposite(DrawState *s)
         SDL_RenderCopy(s->renderer, A, NULL, NULL);
         SDL_RenderReadPixels(s->renderer, NULL, SDL_PIXELFORMAT_ARGB8888, &P, sizeof(P));
 
-        SDL_Log("Blended pixel: 0x%8.8X\n", P);
+        SDL_Log("Blended pixel: 0x%8.8" SDL_PRIX32 "\n", P);
 
         SDL_DestroyTexture(A);
         SDL_DestroyTexture(B);

+ 6 - 6
test/testsem.c

@@ -47,11 +47,11 @@ ThreadFuncRealWorld(void *data)
     Thread_State *state = (Thread_State *) data;
     while (alive) {
         SDL_SemWait(sem);
-        SDL_Log("Thread number %d has got the semaphore (value = %d)!\n",
+        SDL_Log("Thread number %d has got the semaphore (value = %" SDL_PRIu32 ")!\n",
                 state->number, SDL_SemValue(sem));
         SDL_Delay(200);
         SDL_SemPost(sem);
-        SDL_Log("Thread number %d has released the semaphore (value = %d)!\n",
+        SDL_Log("Thread number %d has released the semaphore (value = %" SDL_PRIu32 ")!\n",
                 state->number, SDL_SemValue(sem));
         ++state->loop_count;
         SDL_Delay(1);           /* For the scheduler */
@@ -114,7 +114,7 @@ TestWaitTimeout(void)
 
     /* Accept a little offset in the effective wait */
     SDL_assert(duration > 1900 && duration < 2050);
-    SDL_Log("Wait took %d milliseconds\n\n", duration);
+    SDL_Log("Wait took %" SDL_PRIu32 " milliseconds\n\n", duration);
 
     /* Check to make sure the return value indicates timed out */
     if (retval != SDL_MUTEX_TIMEDOUT)
@@ -146,7 +146,7 @@ TestOverheadUncontended(void)
     end_ticks = SDL_GetTicks();
 
     duration = end_ticks - start_ticks;
-    SDL_Log("Took %d milliseconds\n\n", duration);
+    SDL_Log("Took %" SDL_PRIu32 " milliseconds\n\n", duration);
 
     SDL_DestroySemaphore(sem);
 }
@@ -221,9 +221,9 @@ TestOverheadContended(SDL_bool try_wait)
     SDL_assert_release((loop_count - content_count) == NUM_OVERHEAD_OPS * NUM_OVERHEAD_OPS_MULT);
 
     duration = end_ticks - start_ticks;
-    SDL_Log("Took %d milliseconds, threads %s %d out of %d times in total (%.2f%%)\n",
+    SDL_Log("Took %" SDL_PRIu32 " milliseconds, threads %s %d out of %d times in total (%.2f%%)\n",
             duration, try_wait ? "where contended" : "timed out", content_count,
-            loop_count, ((float)content_count * 100) / loop_count);
+            loop_count, ((float) content_count * 100) / loop_count);
     /* Print how many semaphores where consumed per thread */
     SDL_snprintf(textBuffer, sizeof(textBuffer), "{ ");
     for (i = 0; i < NUM_THREADS; ++i) {

+ 6 - 6
test/testsensor.c

@@ -72,16 +72,16 @@ main(int argc, char **argv)
 
     SDL_Log("There are %d sensors available\n", num_sensors);
     for (i = 0; i < num_sensors; ++i) {
-        SDL_Log("Sensor %d: %s, type %s, platform type %d\n",
-            SDL_SensorGetDeviceInstanceID(i),
-            SDL_SensorGetDeviceName(i),
-            GetSensorTypeString(SDL_SensorGetDeviceType(i)),
-            SDL_SensorGetDeviceNonPortableType(i));
+        SDL_Log("Sensor %" SDL_PRIs32 ": %s, type %s, platform type %d\n",
+                SDL_SensorGetDeviceInstanceID(i),
+                SDL_SensorGetDeviceName(i),
+                GetSensorTypeString(SDL_SensorGetDeviceType(i)),
+                SDL_SensorGetDeviceNonPortableType(i));
 
         if (SDL_SensorGetDeviceType(i) != SDL_SENSOR_UNKNOWN) {
             SDL_Sensor *sensor = SDL_SensorOpen(i);
             if (sensor == NULL) {
-                SDL_Log("Couldn't open sensor %d: %s\n", SDL_SensorGetDeviceInstanceID(i), SDL_GetError());
+                SDL_Log("Couldn't open sensor %" SDL_PRIs32 ": %s\n", SDL_SensorGetDeviceInstanceID(i), SDL_GetError());
             } else {
                 ++num_opened;
             }

+ 1 - 1
test/testtimer.c

@@ -33,7 +33,7 @@ ticktock(Uint32 interval, void *param)
 static Uint32 SDLCALL
 callback(Uint32 interval, void *param)
 {
-    SDL_Log("Timer %d : param = %d\n", interval, (int) (uintptr_t) param);
+    SDL_Log("Timer %" SDL_PRIu32 " : param = %d\n", interval, (int) (uintptr_t) param);
     return interval;
 }
 

+ 1 - 1
test/testvulkan.c

@@ -1101,7 +1101,7 @@ int main(int argc, char **argv)
     }
 
     SDL_GetCurrentDisplayMode(0, &mode);
-    SDL_Log("Screen BPP    : %d\n", SDL_BITSPERPIXEL(mode.format));
+    SDL_Log("Screen BPP    : %" SDL_PRIu32 "\n", SDL_BITSPERPIXEL(mode.format));
     SDL_GetWindowSize(state->windows[0], &dw, &dh);
     SDL_Log("Window Size   : %d,%d\n", dw, dh);
     SDL_Vulkan_GetDrawableSize(state->windows[0], &dw, &dh);

+ 9 - 9
test/testwm2.c

@@ -156,20 +156,20 @@ loop()
                 if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
                     SDL_Window *window = SDL_GetWindowFromID(event.window.windowID);
                     if (window) {
-                        SDL_Log("Window %d resized to %dx%d\n",
-                            event.window.windowID,
-                            event.window.data1,
-                            event.window.data2);
+                        SDL_Log("Window %" SDL_PRIu32 " resized to %" SDL_PRIs32 "x%" SDL_PRIs32 "\n",
+                                event.window.windowID,
+                                event.window.data1,
+                                event.window.data2);
                     }
                 }
                 if (event.window.event == SDL_WINDOWEVENT_MOVED) {
                     SDL_Window *window = SDL_GetWindowFromID(event.window.windowID);
                     if (window) {
-                        SDL_Log("Window %d moved to %d,%d (display %s)\n",
-                            event.window.windowID,
-                            event.window.data1,
-                            event.window.data2,
-                            SDL_GetDisplayName(SDL_GetWindowDisplayIndex(window)));
+                        SDL_Log("Window %" SDL_PRIu32 " moved to %" SDL_PRIs32 ",%" SDL_PRIs32 " (display %s)\n",
+                                event.window.windowID,
+                                event.window.data1,
+                                event.window.data2,
+                                SDL_GetDisplayName(SDL_GetWindowDisplayIndex(window)));
                     }
                 }
                 if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) {

+ 1 - 1
test/testyuv.c

@@ -354,7 +354,7 @@ main(int argc, char **argv)
         SDL_ConvertPixels(original->w, original->h, yuv_format, raw_yuv, pitch, rgb_format, converted->pixels, converted->pitch);
     }
     now = SDL_GetTicks();
-    SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "%d iterations in %d ms, %.2fms each\n", iterations, (now - then), (float)(now - then)/iterations);
+    SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "%" SDL_PRIu32 " iterations in %" SDL_PRIu32 " ms, %.2fms each\n", iterations, (now - then), (float) (now - then) / iterations);
 
     window = SDL_CreateWindow("YUV test",
                               SDL_WINDOWPOS_UNDEFINED,