Cleanup set_rumble functions

This commit is contained in:
twinaphex 2020-08-29 22:22:26 +02:00
parent 48bdbe8dec
commit 84a312535e
11 changed files with 22 additions and 72 deletions

View File

@ -117,15 +117,7 @@ static void ctr_input_grab_mouse(void *data, bool state)
}
static bool ctr_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
enum retro_rumble_effect effect, uint16_t strength) { return false; }
input_driver_t input_ctr = {
ctr_input_init,

View File

@ -1000,9 +1000,9 @@ static bool dinput_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
struct dinput_input *di = (struct dinput_input*)data;
if (!di)
return false;
return input_joypad_set_rumble(di->joypad, port, effect, strength);
if (di)
return input_joypad_set_rumble(di->joypad, port, effect, strength);
return false;
}
static const input_device_driver_t *dinput_get_joypad_driver(void *data)

View File

@ -304,22 +304,9 @@ static const input_device_driver_t *gx_input_get_joypad_driver(void *data)
return gx->joypad;
}
static void gx_input_grab_mouse(void *data, bool state)
{
(void)data;
(void)state;
}
static void gx_input_grab_mouse(void *data, bool state) { }
static bool gx_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
enum retro_rumble_effect effect, uint16_t strength) { return false; }
input_driver_t input_gx = {
gx_input_init,

View File

@ -307,10 +307,7 @@ static bool ps3_input_set_sensor_state(void *data, unsigned port,
}
static bool ps3_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
return false;
}
enum retro_rumble_effect effect, uint16_t strength) { return false; }
static const input_device_driver_t *ps3_input_get_joypad_driver(void *data)
{

View File

@ -680,15 +680,7 @@ static void rwebinput_grab_mouse(void *data, bool state)
}
static bool rwebinput_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
enum retro_rumble_effect effect, uint16_t strength) { return false; }
static const input_device_driver_t *rwebinput_get_joypad_driver(void *data)
{

View File

@ -298,9 +298,9 @@ static bool sdl_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
sdl_input_t *sdl = (sdl_input_t*)data;
if (!sdl)
return false;
return input_joypad_set_rumble(sdl->joypad, port, effect, strength);
if (sdl)
return input_joypad_set_rumble(sdl->joypad, port, effect, strength);
return false;
}
static const input_device_driver_t *sdl_get_joypad_driver(void *data)

View File

@ -895,12 +895,10 @@ static bool switch_input_set_rumble(void *data, unsigned port,
{
#ifdef HAVE_LIBNX
switch_input_t *sw = (switch_input_t*) data;
if (!sw)
return false;
return input_joypad_set_rumble(sw->joypad, port, effect, strength);
#else
return false;
if (sw)
return input_joypad_set_rumble(sw->joypad, port, effect, strength);
#endif
return false;
}
static bool switch_input_set_sensor_state(void *data, unsigned port,

View File

@ -87,9 +87,9 @@ static bool uwp_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
struct uwp_input *uwp = (struct uwp_input*)data;
if (!uwp)
return false;
return input_joypad_set_rumble(uwp->joypad, port, effect, strength);
if (uwp)
return input_joypad_set_rumble(uwp->joypad, port, effect, strength);
return false;
}
static const input_device_driver_t *uwp_input_get_joypad_driver(void *data)

View File

@ -211,15 +211,7 @@ static void wiiu_input_grab_mouse(void *data, bool state)
}
static bool wiiu_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
enum retro_rumble_effect effect, uint16_t strength) { return false; }
input_driver_t input_wiiu = {
wiiu_input_init,

View File

@ -754,9 +754,9 @@ static bool x_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
x11_input_t *x11 = (x11_input_t*)data;
if (!x11)
return false;
return input_joypad_set_rumble(x11->joypad, port, effect, strength);
if (x11)
return input_joypad_set_rumble(x11->joypad, port, effect, strength);
return false;
}
static const input_device_driver_t *x_get_joypad_driver(void *data)

View File

@ -133,15 +133,7 @@ static void xenon360_input_grab_mouse(void *data, bool state)
}
static bool xenon360_input_set_rumble(void *data, unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
(void)data;
(void)port;
(void)effect;
(void)strength;
return false;
}
enum retro_rumble_effect effect, uint16_t strength) { return false; }
static const input_device_driver_t *xenon360_get_joypad_driver(void *data)
{