diff --git a/input/input_autodetect.c b/input/input_autodetect.c index bbe2b42f6f..8843f1e4be 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -161,8 +161,6 @@ void input_config_autoconfigure_joypad(unsigned idx, const struct retro_keybind *input_get_auto_bind(unsigned port, unsigned id) { - int joy_idx = g_settings.input.joypad_map[port]; - if (joy_idx < 0) - return NULL; + unsigned int joy_idx = g_settings.input.joypad_map[port]; return &g_settings.input.autoconf_binds[joy_idx][id]; } diff --git a/input/input_common.c b/input/input_common.c index 43ce224e62..6cce3f7e33 100644 --- a/input/input_common.c +++ b/input/input_common.c @@ -148,8 +148,8 @@ bool input_joypad_set_rumble(const rarch_joypad_driver_t *drv, if (!drv || !drv->set_rumble) return false; - int joy_idx = g_settings.input.joypad_map[port]; - if (joy_idx < 0 || joy_idx >= MAX_PLAYERS) + unsigned int joy_idx = g_settings.input.joypad_map[port]; + if (joy_idx >= MAX_PLAYERS) return false; return drv->set_rumble(joy_idx, effect, strength); @@ -161,8 +161,8 @@ bool input_joypad_pressed(const rarch_joypad_driver_t *drv, if (!drv) return false; - int joy_idx = g_settings.input.joypad_map[port]; - if (joy_idx < 0 || joy_idx >= MAX_PLAYERS) + unsigned int joy_idx = g_settings.input.joypad_map[port]; + if (joy_idx >= MAX_PLAYERS) return false; /* Auto-binds are per joypad, not per player. */ @@ -195,8 +195,8 @@ int16_t input_joypad_analog(const rarch_joypad_driver_t *drv, if (!drv) return 0; - int joy_idx = g_settings.input.joypad_map[port]; - if (joy_idx < 0 || joy_idx >= MAX_PLAYERS) + unsigned int joy_idx = g_settings.input.joypad_map[port]; + if (joy_idx >= MAX_PLAYERS) return 0; /* Auto-binds are per joypad, not per player. */