Darwin: Fix format of 64-bit sessionIDs in log messages
authorMatthias Bolte <matthias.bolte@googlemail.com>
Mon, 14 Oct 2013 17:05:12 +0000 (19:05 +0200)
committerPete Batard <pete@akeo.ie>
Tue, 7 Jan 2014 21:15:16 +0000 (21:15 +0000)
* The sessionID value is 64-bit, so print it as such.
* Closes #153

libusb/os/darwin_usb.c
libusb/version_nano.h

index 146218b..35385d5 100644 (file)
@@ -750,7 +750,7 @@ static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t ser
   (void) get_ioregistry_value_number (service, CFSTR("sessionID"), kCFNumberSInt64Type, &sessionID);
   (void) get_ioregistry_value_number (service, CFSTR("PortNum"), kCFNumberSInt8Type, &port);
 
-  usbi_dbg("finding cached device for sessionID 0x\n" PRIx64, sessionID);
+  usbi_dbg("finding cached device for sessionID 0x%" PRIx64, sessionID);
 
   result = IORegistryEntryGetParentEntry (service, kIOUSBPlane, &parent);
 
@@ -764,7 +764,7 @@ static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t ser
     *cached_out = NULL;
 
     list_for_each_entry(new_device, &darwin_cached_devices, list, struct darwin_cached_device) {
-      usbi_dbg("matching sessionID 0x%x against cached device with sessionID 0x%x", sessionID, new_device->session);
+      usbi_dbg("matching sessionID 0x%" PRIx64 " against cached device with sessionID 0x%" PRIx64, sessionID, new_device->session);
       if (new_device->session == sessionID) {
         usbi_dbg("using cached device for device");
         *cached_out = new_device;
@@ -775,7 +775,7 @@ static int darwin_get_cached_device(struct libusb_context *ctx, io_service_t ser
     if (*cached_out)
       break;
 
-    usbi_dbg("caching new device with sessionID 0x%x\n", sessionID);
+    usbi_dbg("caching new device with sessionID 0x%" PRIx64, sessionID);
 
     device = darwin_device_from_service (service);
     if (!device) {
@@ -845,7 +845,7 @@ static int process_new_device (struct libusb_context *ctx, io_service_t service)
     if (ret)
       break;
 
-    usbi_dbg ("allocating new device in context %p for with session 0x%08x",
+    usbi_dbg ("allocating new device in context %p for with session 0x%" PRIx64,
               ctx, cached_device->session);
 
     dev = usbi_alloc_device(ctx, (unsigned long) cached_device->session);
index 6d6aaaa..4dc856c 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10859
+#define LIBUSB_NANO 10860