SDL: Fixed warning C4244: '=': conversion from 'SDL_Keymod' to 'Uint16', possible loss of data (c95c4)

From c95c415a0b751cd29d8fb81ec78306650bc43f28 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 10 May 2024 16:21:45 -0700
Subject: [PATCH] Fixed warning C4244: '=': conversion from 'SDL_Keymod' to
 'Uint16', possible loss of data

---
 include/SDL3/SDL_keycode.h     |  2 +-
 test/testautomation_keyboard.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h
index 5c1452aef94f7..41b384e0001ef 100644
--- a/include/SDL3/SDL_keycode.h
+++ b/include/SDL3/SDL_keycode.h
@@ -300,7 +300,7 @@ typedef Uint32 SDL_Keycode;
  *
  * \since This datatype is available since SDL 3.0.0.
  */
-typedef Uint32 SDL_Keymod;
+typedef Uint16 SDL_Keymod;
 
 #define SDL_KMOD_NONE   0x0000u /**< no modifier is applicable. */
 #define SDL_KMOD_LSHIFT 0x0001u /**< the left Shift key is down. */
diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c
index 1ac7f9dce7342..2261af12ccfa0 100644
--- a/test/testautomation_keyboard.c
+++ b/test/testautomation_keyboard.c
@@ -298,31 +298,31 @@ static int keyboard_getSetModState(void *arg)
     /* Get state, cache for later reset */
     result = SDL_GetModState();
     SDLTest_AssertPass("Call to SDL_GetModState()");
-    SDLTest_AssertCheck(/*result >= 0 &&*/ result <= allStates, "Verify result from call is valid, expected: 0 <= result <= %" SDL_PRIu32 ", got: %" SDL_PRIu32, allStates, result);
+    SDLTest_AssertCheck(/*result >= 0 &&*/ result <= allStates, "Verify result from call is valid, expected: 0 <= result <= 0x%.4x, got: 0x%.4x", allStates, result);
     currentState = result;
 
     /* Set random state */
     newState = SDLTest_RandomIntegerInRange(0, allStates);
     SDL_SetModState(newState);
-    SDLTest_AssertPass("Call to SDL_SetModState(%" SDL_PRIu32 ")", newState);
+    SDLTest_AssertPass("Call to SDL_SetModState(0x%.4x)", newState);
     result = SDL_GetModState();
     SDLTest_AssertPass("Call to SDL_GetModState()");
-    SDLTest_AssertCheck(result == newState, "Verify result from call is valid, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, newState, result);
+    SDLTest_AssertCheck(result == newState, "Verify result from call is valid, expected: 0x%.4x, got: 0x%.4x", newState, result);
 
     /* Set zero state */
     SDL_SetModState(0);
     SDLTest_AssertPass("Call to SDL_SetModState(0)");
     result = SDL_GetModState();
     SDLTest_AssertPass("Call to SDL_GetModState()");
-    SDLTest_AssertCheck(result == 0, "Verify result from call is valid, expected: 0, got: %" SDL_PRIu32, result);
+    SDLTest_AssertCheck(result == 0, "Verify result from call is valid, expected: 0, got: 0x%.4x", result);
 
     /* Revert back to cached current state if needed */
     if (currentState != 0) {
         SDL_SetModState(currentState);
-        SDLTest_AssertPass("Call to SDL_SetModState(%" SDL_PRIu32 ")", currentState);
+        SDLTest_AssertPass("Call to SDL_SetModState(0x%.4x)", currentState);
         result = SDL_GetModState();
         SDLTest_AssertPass("Call to SDL_GetModState()");
-        SDLTest_AssertCheck(result == currentState, "Verify result from call is valid, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, currentState, result);
+        SDLTest_AssertCheck(result == currentState, "Verify result from call is valid, expected: 0x%.4x, got: 0x%.4x", currentState, result);
     }
 
     return TEST_COMPLETED;