diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index 607d8da1e..c0963e09b 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -629,8 +629,6 @@ static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) { struct darwin_cached_device *old_device; io_service_t device; - UInt64 session, locationID; - int ret; usbi_mutex_lock(&active_contexts_lock); @@ -638,7 +636,9 @@ static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) { bool is_reenumerating = false; /* get the location from the i/o registry */ - ret = get_ioregistry_value_number (device, CFSTR("sessionID"), kCFNumberSInt64Type, &session); + UInt64 session = 0; + bool ret = get_ioregistry_value_number (device, CFSTR("sessionID"), kCFNumberSInt64Type, &session); + UInt32 locationID = 0; (void) get_ioregistry_value_number (device, CFSTR("locationID"), kCFNumberSInt32Type, &locationID); IOObjectRelease (device); if (!ret) @@ -652,8 +652,8 @@ static void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) { if (old_device->in_reenumerate) { /* device is re-enumerating. do not dereference the device at this time. libusb_reset_device() * will deref if needed. */ - usbi_dbg (NULL, "detected device detached due to re-enumeration. sessionID: 0x%" PRIx64 ", locationID: 0x%" PRIx64, - session, locationID); + usbi_dbg (NULL, "detected device detached due to re-enumeration. sessionID: 0x%" PRIx64 + ", locationID: 0x%" PRIx32, session, locationID); /* the device object is no longer usable so go ahead and release it */ if (old_device->device) { @@ -1287,7 +1287,7 @@ static enum libusb_error darwin_get_cached_device(struct libusb_context *ctx, io usbi_mutex_lock(&darwin_cached_devices_mutex); do { list_for_each_entry(new_device, &darwin_cached_devices, list, struct darwin_cached_device) { - usbi_dbg(ctx, "matching sessionID/locationID 0x%" PRIx64 "/0x%x against cached device with sessionID/locationID 0x%" PRIx64 "/0x%x", + usbi_dbg(ctx, "matching sessionID/locationID 0x%" PRIx64 "/0x%" PRIx32 " against cached device with sessionID/locationID 0x%" PRIx64 "/0x%" PRIx32, sessionID, locationID, new_device->session, new_device->location); if (new_device->location == locationID && new_device->in_reenumerate) { usbi_dbg (ctx, "found cached device with matching location that is being re-enumerated"); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 3a55cda49..b4ca6bb9c 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11869 +#define LIBUSB_NANO 11870