stress: test_get_device_list: change printf format for ssize_t
authorUri Lublin <uril@redhat.com>
Sun, 5 Jul 2020 13:29:57 +0000 (16:29 +0300)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 10 Aug 2020 17:51:42 +0000 (10:51 -0700)
The type of list_size is ssize_t.
First idea was to use "%zd" printf format specifier.
But that is not supported by Visual Studio 2013.

Use "%ld" + cast list_size to long.

Closes #751

Suggested-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Uri Lublin <uril@redhat.com>
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/version_nano.h
tests/stress.c

index 820c720..ea0c971 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11524
+#define LIBUSB_NANO 11525
index 0e2dbe5..1602ee9 100644 (file)
@@ -60,8 +60,8 @@ static libusb_testlib_result test_get_device_list(libusb_testlib_ctx * tctx)
                ssize_t list_size = libusb_get_device_list(ctx, &device_list);
                if (list_size < 0 || device_list == NULL) {
                        libusb_testlib_logf(tctx,
-                               "Failed to get device list on iteration %d: %d (%p)",
-                               i, -list_size, device_list);
+                               "Failed to get device list on iteration %d: %ld (%p)",
+                               i, (long)-list_size, device_list);
                        return TEST_STATUS_FAILURE;
                }
                libusb_free_device_list(device_list, 1);