diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-01-15 15:19:24 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-01-15 15:19:24 +0100 |
| commit | 5e6e61c723285feb5287c5816e80b56be7212fa8 (patch) | |
| tree | f33b8ce2645af7b833c723fab0ef005e8cafe3bd /Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp | |
| parent | d657ad5932fc678037aa98a32048e8d70cca6562 (diff) | |
InputCommon/SDL: Avoid potential infinite loops from integer truncation.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index 3240a74914..edef47aeda 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -453,11 +453,11 @@ GameController::GameController(SDL_GameController* const gamecontroller, // Legacy inputs // Buttons - for (u8 i = 0; i != n_legacy_buttons; ++i) + for (int i = 0; i != n_legacy_buttons; ++i) AddInput(new LegacyButton(m_joystick, i, !is_button_mapped[i])); // Axes - for (u8 i = 0; i != n_legacy_axes; ++i) + for (int i = 0; i != n_legacy_axes; ++i) { // each axis gets a negative and a positive input instance associated with it AddAnalogInputs(new LegacyAxis(m_joystick, i, -32768, !is_axis_mapped[i]), @@ -465,7 +465,7 @@ GameController::GameController(SDL_GameController* const gamecontroller, } // Hats - for (u8 i = 0; i != n_legacy_hats; ++i) + for (int i = 0; i != n_legacy_hats; ++i) { // each hat gets 4 input instances associated with it, (up down left right) for (u8 d = 0; d != 4; ++d) |
