(joypad/connect) Change 'index' local variables

This commit is contained in:
twinaphex 2014-10-20 20:32:41 +02:00
parent faeca01e7a
commit 0fb301fa43
4 changed files with 12 additions and 12 deletions

View File

@ -165,11 +165,11 @@ static void hidpad_ps3_set_rumble(void *data,
enum retro_rumble_effect effect, uint16_t strength) enum retro_rumble_effect effect, uint16_t strength)
{ {
struct hidpad_ps3_data *device = (struct hidpad_ps3_data*)data; struct hidpad_ps3_data *device = (struct hidpad_ps3_data*)data;
unsigned index = (effect == RETRO_RUMBLE_STRONG) ? 0 : 1; unsigned idx = (effect == RETRO_RUMBLE_STRONG) ? 0 : 1;
if (device && (device->motors[index] != strength)) if (device && (device->motors[idx] != strength))
{ {
device->motors[index] = strength; device->motors[idx] = strength;
hidpad_ps3_send_control(device); hidpad_ps3_send_control(device);
} }
} }

View File

@ -168,11 +168,11 @@ static void hidpad_ps4_set_rumble(void *data,
/* TODO */ /* TODO */
#if 0 #if 0
struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data; struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data;
unsigned index = (effect == RETRO_RUMBLE_STRONG) ? 0 : 1; unsigned idx = (effect == RETRO_RUMBLE_STRONG) ? 0 : 1;
if (device && (device->motors[index] != strength)) if (device && (device->motors[idx] != strength))
{ {
device->motors[index] = strength; device->motors[idx] = strength;
hidpad_ps4_send_control(device); hidpad_ps4_send_control(device);
} }
#endif #endif

View File

@ -141,7 +141,7 @@ uint32_t pad_connection_get_buttons(joypad_connection_t *s, unsigned pad)
} }
int16_t pad_connection_get_axis(joypad_connection_t *s, int16_t pad_connection_get_axis(joypad_connection_t *s,
unsigned index, unsigned i) unsigned idx, unsigned i)
{ {
if (s->iface) if (s->iface)
return s->iface->get_axis(s->data, i); return s->iface->get_axis(s->data, i);

View File

@ -56,22 +56,22 @@ void *pad_connection_init(unsigned pads);
void pad_connection_destroy(joypad_connection_t *joyconn); void pad_connection_destroy(joypad_connection_t *joyconn);
void pad_connection_disconnect(joypad_connection_t *joyconn, void pad_connection_disconnect(joypad_connection_t *joyconn,
unsigned index); unsigned idx);
void pad_connection_packet(joypad_connection_t *joyconn, void pad_connection_packet(joypad_connection_t *joyconn,
unsigned index, uint8_t* data, uint32_t length); unsigned idx, uint8_t* data, uint32_t length);
uint32_t pad_connection_get_buttons(joypad_connection_t *joyconn, uint32_t pad_connection_get_buttons(joypad_connection_t *joyconn,
unsigned index); unsigned idx);
int16_t pad_connection_get_axis(joypad_connection_t *joyconn, int16_t pad_connection_get_axis(joypad_connection_t *joyconn,
unsigned index, unsigned i); unsigned idx, unsigned i);
/* Determine if connected joypad is a hidpad backed device. /* Determine if connected joypad is a hidpad backed device.
* If false, pad_connection_packet cannot be used */ * If false, pad_connection_packet cannot be used */
bool pad_connection_has_interface(joypad_connection_t *joyconn, bool pad_connection_has_interface(joypad_connection_t *joyconn,
unsigned index); unsigned idx);
bool pad_connection_rumble(joypad_connection_t *s, bool pad_connection_rumble(joypad_connection_t *s,
unsigned pad, enum retro_rumble_effect effect, uint16_t strength); unsigned pad, enum retro_rumble_effect effect, uint16_t strength);