From e0c4660c1b454b519aad6b1542ffb19e4b8a2159 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Mon, 8 Jul 2019 14:12:14 -0700 Subject: [PATCH] windows_winusb: fix pedantic format string warnings. clang is pedantic about requiring the l prefix for DWORD, which is a typedef to unsigned long. Closes #590 Signed-off-by: Nathan Hjelm --- libusb/os/windows_winusb.c | 16 ++++++++-------- libusb/version_nano.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 51eca35..e3d5cfa 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -283,7 +283,7 @@ static int get_interface_details(struct libusb_context *ctx, HDEVINFO dev_info, for (;;) { if (!pSetupDiEnumDeviceInfo(dev_info, *_index, dev_info_data)) { if (GetLastError() != ERROR_NO_MORE_ITEMS) { - usbi_err(ctx, "Could not obtain device info data for %s index %u: %s", + usbi_err(ctx, "Could not obtain device info data for %s index %lu: %s", guid_to_string(guid), *_index, windows_error_str(0)); return LIBUSB_ERROR_OTHER; } @@ -299,7 +299,7 @@ static int get_interface_details(struct libusb_context *ctx, HDEVINFO dev_info, break; if (GetLastError() != ERROR_NO_MORE_ITEMS) { - usbi_err(ctx, "Could not obtain interface data for %s devInst %X: %s", + usbi_err(ctx, "Could not obtain interface data for %s devInst %lX: %s", guid_to_string(guid), dev_info_data->DevInst, windows_error_str(0)); return LIBUSB_ERROR_OTHER; } @@ -311,7 +311,7 @@ static int get_interface_details(struct libusb_context *ctx, HDEVINFO dev_info, if (!pSetupDiGetDeviceInterfaceDetailA(dev_info, &dev_interface_data, NULL, 0, &size, NULL)) { // The dummy call should fail with ERROR_INSUFFICIENT_BUFFER if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { - usbi_err(ctx, "could not access interface data (dummy) for %s devInst %X: %s", + usbi_err(ctx, "could not access interface data (dummy) for %s devInst %lX: %s", guid_to_string(guid), dev_info_data->DevInst, windows_error_str(0)); return LIBUSB_ERROR_OTHER; } @@ -322,7 +322,7 @@ static int get_interface_details(struct libusb_context *ctx, HDEVINFO dev_info, dev_interface_details = malloc(size); if (dev_interface_details == NULL) { - usbi_err(ctx, "could not allocate interface data for %s devInst %X", + usbi_err(ctx, "could not allocate interface data for %s devInst %lX", guid_to_string(guid), dev_info_data->DevInst); return LIBUSB_ERROR_NO_MEM; } @@ -330,7 +330,7 @@ static int get_interface_details(struct libusb_context *ctx, HDEVINFO dev_info, dev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A); if (!pSetupDiGetDeviceInterfaceDetailA(dev_info, &dev_interface_data, dev_interface_details, size, NULL, NULL)) { - usbi_err(ctx, "could not access interface data (actual) for %s devInst %X: %s", + usbi_err(ctx, "could not access interface data (actual) for %s devInst %lX: %s", guid_to_string(guid), dev_info_data->DevInst, windows_error_str(0)); free(dev_interface_details); return LIBUSB_ERROR_OTHER; @@ -340,7 +340,7 @@ static int get_interface_details(struct libusb_context *ctx, HDEVINFO dev_info, free(dev_interface_details); if (*dev_interface_path == NULL) { - usbi_err(ctx, "could not allocate interface path for %s devInst %X", + usbi_err(ctx, "could not allocate interface path for %s devInst %lX", guid_to_string(guid), dev_info_data->DevInst); return LIBUSB_ERROR_NO_MEM; } @@ -1251,7 +1251,7 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_ // Read the Device ID path if (!pSetupDiGetDeviceInstanceIdA(*dev_info, &dev_info_data, dev_id, sizeof(dev_id), NULL)) { - usbi_warn(ctx, "could not read the device instance ID for devInst %X, skipping", + usbi_warn(ctx, "could not read the device instance ID for devInst %lX, skipping", dev_info_data.DevInst); continue; } @@ -2567,7 +2567,7 @@ static enum libusb_transfer_status usbd_status_to_libusb_transfer_status(USBD_ST case 0xC0007000: /* USBD_STATUS_DEVICE_GONE */ return LIBUSB_TRANSFER_NO_DEVICE; default: - usbi_dbg("USBD_STATUS 0x%08x translated to LIBUSB_TRANSFER_ERROR", status); + usbi_dbg("USBD_STATUS 0x%08lx translated to LIBUSB_TRANSFER_ERROR", status); return LIBUSB_TRANSFER_ERROR; } } diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 80acfb4..46449d4 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11385 +#define LIBUSB_NANO 11387 -- 2.7.4