Fix trivial libusbx warnings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/compat/libusb-1.0/libusb/core.c b/compat/libusb-1.0/libusb/core.c
index e816284..8503cae 100644
--- a/compat/libusb-1.0/libusb/core.c
+++ b/compat/libusb-1.0/libusb/core.c
@@ -2138,7 +2138,7 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,
"libusbx: %s [%s] ", prefix, function);
}
- if (header_len < 0 || header_len >= sizeof(buf)) {
+ if (header_len < 0 || (size_t)header_len >= sizeof(buf)) {
/* Somehow snprintf failed to write to the buffer,
* remove the header so something useful is output. */
header_len = 0;
@@ -2147,7 +2147,7 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,
buf[header_len] = '\0';
text_len = vsnprintf(buf + header_len, sizeof(buf) - header_len,
format, args);
- if (text_len < 0 || text_len + header_len >= sizeof(buf)) {
+ if (text_len < 0 || text_len + (size_t)header_len >= sizeof(buf)) {
/* Truncated log output. On some platforms a -1 return value means
* that the output was truncated. */
text_len = sizeof(buf) - header_len;
diff --git a/compat/libusb-1.0/libusb/os/linux_udev.c b/compat/libusb-1.0/libusb/os/linux_udev.c
index 99ac943..2ee5866 100644
--- a/compat/libusb-1.0/libusb/os/linux_udev.c
+++ b/compat/libusb-1.0/libusb/os/linux_udev.c
@@ -158,7 +158,7 @@ int linux_udev_stop_event_monitor(void)
return LIBUSB_SUCCESS;
}
-static void *linux_udev_event_thread_main(void *arg)
+static void *linux_udev_event_thread_main(void __attribute__((unused)) *arg)
{
char dummy;
int r;
diff --git a/compat/libusb-1.0/libusb/os/linux_usbfs.c b/compat/libusb-1.0/libusb/os/linux_usbfs.c
index 142fa2b..596b577 100644
--- a/compat/libusb-1.0/libusb/os/linux_usbfs.c
+++ b/compat/libusb-1.0/libusb/os/linux_usbfs.c
@@ -784,7 +784,7 @@ static int op_get_active_config_descriptor(struct libusb_device *dev,
if (r < 0)
return r;
- len = MIN(len, r);
+ len = MIN(len, (size_t)r);
memcpy(buffer, config_desc, len);
return len;
}
@@ -814,7 +814,7 @@ static int op_get_config_descriptor(struct libusb_device *dev,
descriptors += r;
}
- len = MIN(len, r);
+ len = MIN(len, (size_t)r);
memcpy(buffer, descriptors, len);
return len;
}
@@ -1090,7 +1090,7 @@ void linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_na
usbi_mutex_static_unlock(&active_contexts_lock);
}
-void linux_device_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name)
+void linux_device_disconnected(uint8_t busnum, uint8_t devaddr, const char __attribute__((unused)) *sys_name)
{
struct libusb_context *ctx;
struct libusb_device *dev;