From 37559c6f5f0f42c153a8188ff87f12ae69a434d6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 11 Dec 2016 08:31:55 +0100 Subject: [PATCH] Cleanups --- input/drivers_joypad/udev_joypad.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index fe4e0fff3e..2742df04a4 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -561,10 +561,10 @@ error: return false; } -static bool udev_joypad_hat(const struct udev_joypad *pad, uint16_t hat, - unsigned hat_dir) +static bool udev_joypad_button_hat(const void *data, uint16_t joykey, unsigned hat_dir) { - unsigned h = GET_HAT(hat); + const struct udev_joypad *pad = (const struct udev_joypad*)data; + unsigned h = GET_HAT(joykey); if (h >= NUM_HATS) return false; @@ -590,7 +590,7 @@ static bool udev_joypad_button(unsigned port, uint16_t joykey) unsigned hat_dir = GET_HAT_DIR(joykey); if (hat_dir) - return udev_joypad_hat(pad, joykey, hat_dir); + return udev_joypad_button_hat(pad, joykey, hat_dir); return joykey < UDEV_NUM_BUTTONS && BIT64_GET(pad->buttons, joykey); }