diff options
author | Ludovic Rousseau <ludovic.rousseau@free.fr> | 2016-03-06 13:42:13 +0100 |
---|---|---|
committer | Ludovic Rousseau <ludovic.rousseau@free.fr> | 2016-03-06 13:42:13 +0100 |
commit | 964cff46ccb929b4b713586215c8d80100c148d2 (patch) | |
tree | 37656c747514320db900d7efe620ccb8e840ad1e | |
parent | 79cc25a0a021aefef6ae811cca85b2bcfa0b610e (diff) | |
download | libusb-964cff46ccb929b4b713586215c8d80100c148d2.tar.gz |
examples: fix 3 compiler warnings
examples/hotplugtest.c:76:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
vendor_id = (argc > 1) ? strtol (argv[1], NULL, 0) : 0x045a;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
examples/hotplugtest.c:77:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
product_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
examples/hotplugtest.c:78:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
class_id = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r-- | examples/hotplugtest.c | 6 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/hotplugtest.c b/examples/hotplugtest.c index d2c1468..cc873f1 100644 --- a/examples/hotplugtest.c +++ b/examples/hotplugtest.c @@ -73,9 +73,9 @@ int main(int argc, char *argv[]) int product_id, vendor_id, class_id; int rc; - vendor_id = (argc > 1) ? strtol (argv[1], NULL, 0) : 0x045a; - product_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005; - class_id = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY; + vendor_id = (argc > 1) ? (int)strtol (argv[1], NULL, 0) : 0x045a; + product_id = (argc > 2) ? (int)strtol (argv[2], NULL, 0) : 0x5005; + class_id = (argc > 3) ? (int)strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY; rc = libusb_init (NULL); if (rc < 0) diff --git a/libusb/version_nano.h b/libusb/version_nano.h index c780400..f2124f1 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11094 +#define LIBUSB_NANO 11095 |