mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-21 18:28:31 +00:00
[WiiU] Change up wiiu_joypad_name semantics
Prevents warnings from GCC around the possibility of a negative index going into hidName.
This commit is contained in:
parent
c96a9dbf76
commit
e39c820cee
@ -65,17 +65,16 @@ static char hidName[HID_COUNT][255];
|
||||
|
||||
static const char* wiiu_joypad_name(unsigned pad)
|
||||
{
|
||||
if (pad == 0)
|
||||
if (pad > MAX_PADS) return "N/A";
|
||||
|
||||
if (pad == GAMEPAD_OFFSET)
|
||||
return "WIIU Gamepad";
|
||||
|
||||
if (pad < MAX_PADS && pad < (HID_OFFSET) && pad > GAMEPAD_OFFSET)
|
||||
if (pad >= KPAD_OFFSET && pad < KPAD_OFFSET + KPAD_COUNT)
|
||||
{
|
||||
int i = pad - KPAD_OFFSET;
|
||||
switch (pad_type[i])
|
||||
{
|
||||
case WIIUINPUT_TYPE_NONE:
|
||||
return "N/A";
|
||||
|
||||
case WIIUINPUT_TYPE_PRO_CONTROLLER:
|
||||
return "WIIU Pro Controller";
|
||||
|
||||
@ -87,13 +86,17 @@ static const char* wiiu_joypad_name(unsigned pad)
|
||||
|
||||
case WIIUINPUT_TYPE_CLASSIC_CONTROLLER:
|
||||
return "Classic Controller";
|
||||
|
||||
case WIIUINPUT_TYPE_NONE:
|
||||
default:
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
if (pad < MAX_PADS)
|
||||
if (pad >= HID_OFFSET && pad < HID_OFFSET + HID_COUNT)
|
||||
{
|
||||
s32 hid_index = pad-HID_OFFSET;
|
||||
sprintf(hidName[hid_index],"HID %04X/%04X(%02X)",hid_data[hid_index].device_info.vidpid.vid,hid_data[hid_index].device_info.vidpid.pid,hid_data[hid_index].pad);
|
||||
s32 hid_index = pad - HID_OFFSET;
|
||||
sprintf(hidName[hid_index], "HID %04X/%04X(%02X)", hid_data[hid_index].device_info.vidpid.vid, hid_data[hid_index].device_info.vidpid.pid, hid_data[hid_index].pad);
|
||||
return hidName[hid_index];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user