input_common.c - small cleanups

This commit is contained in:
twinaphex 2014-09-16 07:06:23 +02:00
parent 191f0b6383
commit eeda9df418

View File

@ -126,10 +126,9 @@ const rarch_joypad_driver_t *input_joypad_init_first(void)
const char *input_joypad_name(const rarch_joypad_driver_t *driver, const char *input_joypad_name(const rarch_joypad_driver_t *driver,
unsigned joypad) unsigned joypad)
{ {
if (!driver) if (driver)
return NULL;
return driver->name(joypad); return driver->name(joypad);
return NULL;
} }
bool input_joypad_set_rumble(const rarch_joypad_driver_t *driver, bool input_joypad_set_rumble(const rarch_joypad_driver_t *driver,
@ -234,29 +233,26 @@ int16_t input_joypad_analog(const rarch_joypad_driver_t *driver,
int16_t input_joypad_axis_raw(const rarch_joypad_driver_t *driver, int16_t input_joypad_axis_raw(const rarch_joypad_driver_t *driver,
unsigned joypad, unsigned axis) unsigned joypad, unsigned axis)
{ {
if (!driver) if (driver)
return 0;
return driver->axis(joypad, AXIS_POS(axis)) + return driver->axis(joypad, AXIS_POS(axis)) +
driver->axis(joypad, AXIS_NEG(axis)); driver->axis(joypad, AXIS_NEG(axis));
return 0;
} }
bool input_joypad_button_raw(const rarch_joypad_driver_t *driver, bool input_joypad_button_raw(const rarch_joypad_driver_t *driver,
unsigned joypad, unsigned button) unsigned joypad, unsigned button)
{ {
if (!driver) if (driver)
return false;
return driver->button(joypad, button); return driver->button(joypad, button);
return false;
} }
bool input_joypad_hat_raw(const rarch_joypad_driver_t *driver, bool input_joypad_hat_raw(const rarch_joypad_driver_t *driver,
unsigned joypad, unsigned hat_dir, unsigned hat) unsigned joypad, unsigned hat_dir, unsigned hat)
{ {
if (!driver) if (driver)
return false;
return driver->button(joypad, HAT_MAP(hat, hat_dir)); return driver->button(joypad, HAT_MAP(hat, hat_dir));
return false;
} }
#ifndef IS_RETROLAUNCH #ifndef IS_RETROLAUNCH