mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-02 18:07:40 +00:00
N3DS: Fix -Wformat
warnings in tests.
All warnings were about invalid specifiers. Since U/Sint32 is a long, using `%d` emits a -Wformat warning.
This commit is contained in:
parent
43a2b0b1e5
commit
6784d84c9d
26 changed files with 162 additions and 161 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue