Commit fb955af7a90af6bcc3b65612e0db76083eeb375d

Con Kolivas 2013-09-30T11:58:25

Fix trivial libusbx warnings.

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;