From 826fba62dbe327459b00d0a944a49ac727e4edff Mon Sep 17 00:00:00 2001
From: Ludovic Rousseau <ludovic.rousseau+github@gmail.com>
Date: Fri, 20 Apr 2012 10:35:53 +0200
Subject: [PATCH 4/4] Fix compiler warnings

os/linux_usbfs.c: In function 'handle_bulk_completion':
os/linux_usbfs.c:1960:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
os/linux_usbfs.c:2031:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
os/linux_usbfs.c: In function 'handle_iso_completion':
os/linux_usbfs.c:2127:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
---
 libusb/os/linux_usbfs.c |   12 ++++++------
 libusb/os/linux_usbfs.h |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index f71ab91..758091c 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -138,7 +138,7 @@ struct linux_transfer_priv {
 	};
 
 	enum reap_action reap_action;
-	int num_urbs;
+	unsigned int num_urbs;
 	unsigned int num_retired;
 	enum libusb_transfer_status reap_status;
 
@@ -1501,7 +1501,7 @@ static int discard_urbs(struct usbi_transfer *itransfer, int first, int last_plu
 
 static void free_iso_urbs(struct linux_transfer_priv *tpriv)
 {
-	int i;
+	unsigned int i;
 	for (i = 0; i < tpriv->num_urbs; i++) {
 		struct usbfs_urb *urb = tpriv->iso_urbs[i];
 		if (!urb)
@@ -1917,7 +1917,7 @@ static int handle_bulk_completion(struct usbi_transfer *itransfer,
 {
 	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
 	struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
-	int urb_idx = urb - tpriv->urbs;
+	unsigned int urb_idx = urb - tpriv->urbs;
 
 	usbi_mutex_lock(&itransfer->lock);
 	usbi_dbg("handling completion status %d of bulk urb %d/%d", urb->status,
@@ -2054,9 +2054,9 @@ static int handle_iso_completion(struct usbi_transfer *itransfer,
 	struct libusb_transfer *transfer =
 		USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
 	struct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);
-	int num_urbs = tpriv->num_urbs;
-	int urb_idx = 0;
-	int i;
+	unsigned int num_urbs = tpriv->num_urbs;
+	unsigned int urb_idx = 0;
+	unsigned int i;
 	enum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED;
 
 	usbi_mutex_lock(&itransfer->lock);
diff --git a/libusb/os/linux_usbfs.h b/libusb/os/linux_usbfs.h
index 326f372..3b9615d 100644
--- a/libusb/os/linux_usbfs.h
+++ b/libusb/os/linux_usbfs.h
@@ -92,7 +92,7 @@ struct usbfs_urb {
 	int buffer_length;
 	int actual_length;
 	int start_frame;
-	int number_of_packets;
+	unsigned int number_of_packets;
 	int error_count;
 	unsigned int signr;
 	void *usercontext;
-- 
1.7.9.5

