From 61a708ffb5d8317e68025012aa02fcfc6ef03181 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 26 May 2023 21:05:54 -0700 Subject: [PATCH] build fixes --- libusb/hid.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libusb/hid.c b/libusb/hid.c index 3a8a97522..a82a404fa 100644 --- a/libusb/hid.c +++ b/libusb/hid.c @@ -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; @@ -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; @@ -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]; @@ -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++) {