examples: fix 2 compiler warnings
ezusb.c:136:13: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] if (status != len) { ~~~~~~ ^ ~~~ ezusb.c:159:13: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] if (status != len) { ~~~~~~ ^ ~~~ Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
This commit is contained in:
parent
4bfa440e5f
commit
3661588fe6
2 changed files with 3 additions and 3 deletions
|
@ -133,7 +133,7 @@ static int ezusb_write(libusb_device_handle *device, const char *label,
|
||||||
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||||
opcode, addr & 0xFFFF, addr >> 16,
|
opcode, addr & 0xFFFF, addr >> 16,
|
||||||
(unsigned char*)data, (uint16_t)len, 1000);
|
(unsigned char*)data, (uint16_t)len, 1000);
|
||||||
if (status != len) {
|
if (status != (signed)len) {
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
logerror("%s: %s\n", label, libusb_error_name(status));
|
logerror("%s: %s\n", label, libusb_error_name(status));
|
||||||
else
|
else
|
||||||
|
@ -156,7 +156,7 @@ static int ezusb_read(libusb_device_handle *device, const char *label,
|
||||||
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
|
||||||
opcode, addr & 0xFFFF, addr >> 16,
|
opcode, addr & 0xFFFF, addr >> 16,
|
||||||
(unsigned char*)data, (uint16_t)len, 1000);
|
(unsigned char*)data, (uint16_t)len, 1000);
|
||||||
if (status != len) {
|
if (status != (signed)len) {
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
logerror("%s: %s\n", label, libusb_error_name(status));
|
logerror("%s: %s\n", label, libusb_error_name(status));
|
||||||
else
|
else
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#define LIBUSB_NANO 11084
|
#define LIBUSB_NANO 11085
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue