From: Ludovic Rousseau Date: Sat, 27 Feb 2016 16:37:49 +0000 (+0100) Subject: core: fix 2 compiler warnings X-Git-Tag: upstream/1.0.21~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=680828abf88096d802f8ab4e0e603ae7bc05af7f;p=platform%2Fupstream%2Flibusb.git core: fix 2 compiler warnings core.c:2361:35: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (header_len < 0 || header_len >= sizeof(buf)) { ~~~~~~~~~~ ^ ~~~~~~~~~~~ core.c:2370:44: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (text_len < 0 || text_len + header_len >= sizeof(buf)) { ~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ Signed-off-by: Ludovic Rousseau --- diff --git a/libusb/core.c b/libusb/core.c index 31f3d28..5317d26 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -2358,7 +2358,7 @@ void usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level, "libusb: %s [%s] ", prefix, function); } - if (header_len < 0 || header_len >= sizeof(buf)) { + if (header_len < 0 || header_len >= (int)sizeof(buf)) { /* Somehow snprintf failed to write to the buffer, * remove the header so something useful is output. */ header_len = 0; @@ -2367,7 +2367,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 + header_len >= (int)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/libusb/version_nano.h b/libusb/version_nano.h index 1f35b5b..2847bad 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11081 +#define LIBUSB_NANO 11083