Skip to content

Commit

Permalink
build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed May 27, 2023
1 parent e37ab8f commit 61a708f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libusb/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,14 +770,14 @@ static int is_xbox360(unsigned short vendor_id, const struct libusb_interface_de
0x24c6, /* PowerA */
0x2c22, /* Qanba */
0x2dc8, /* 8BitDo */
0x9886, /* ASTRO Gaming */
0x9886, /* ASTRO Gaming */
};

if (intf_desc->bInterfaceClass == LIBUSB_CLASS_VENDOR_SPEC &&
intf_desc->bInterfaceSubClass == XB360_IFACE_SUBCLASS &&
(intf_desc->bInterfaceProtocol == XB360_IFACE_PROTOCOL ||
intf_desc->bInterfaceProtocol == XB360W_IFACE_PROTOCOL)) {
int i;
size_t i;
for (i = 0; i < sizeof(SUPPORTED_VENDORS)/sizeof(SUPPORTED_VENDORS[0]); ++i) {
if (vendor_id == SUPPORTED_VENDORS[i]) {
return 1;
Expand All @@ -797,20 +797,20 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de
0x0738, /* Mad Catz */
0x0e6f, /* PDP */
0x0f0d, /* Hori */
0x10f5, /* Turtle Beach */
0x10f5, /* Turtle Beach */
0x1532, /* Razer Wildcat */
0x20d6, /* PowerA */
0x24c6, /* PowerA */
0x2dc8, /* 8BitDo */
0x2e24, /* Hyperkin */
0x3537, /* GameSir */
0x3537, /* GameSir */
};

if (intf_desc->bInterfaceNumber == 0 &&
intf_desc->bInterfaceClass == LIBUSB_CLASS_VENDOR_SPEC &&
intf_desc->bInterfaceSubClass == XB1_IFACE_SUBCLASS &&
intf_desc->bInterfaceProtocol == XB1_IFACE_PROTOCOL) {
int i;
size_t i;
for (i = 0; i < sizeof(SUPPORTED_VENDORS)/sizeof(SUPPORTED_VENDORS[0]); ++i) {
if (vendor_id == SUPPORTED_VENDORS[i]) {
return 1;
Expand Down Expand Up @@ -1144,6 +1144,8 @@ static void *read_thread(void *param)

static void init_xbox360(libusb_device_handle *device_handle, unsigned short idVendor, unsigned short idProduct, const struct libusb_config_descriptor *conf_desc)
{
(void)conf_desc;

if ((idVendor == 0x05ac && idProduct == 0x055b) /* Gamesir-G3w */ ||
idVendor == 0x0f0d /* Hori Xbox controllers */) {
unsigned char data[20];
Expand All @@ -1163,6 +1165,8 @@ static void init_xboxone(libusb_device_handle *device_handle, unsigned short idV
static const int XB1_IFACE_PROTOCOL = 208;
int j, k, res;

(void)idProduct;

for (j = 0; j < conf_desc->bNumInterfaces; j++) {
const struct libusb_interface *intf = &conf_desc->interface[j];
for (k = 0; k < intf->num_altsetting; k++) {
Expand Down

0 comments on commit 61a708f

Please sign in to comment.