Windows: Fix a few more benign compiler warnings
authorChris Dickens <christopher.a.dickens@gmail.com>
Sat, 28 Nov 2020 02:42:52 +0000 (18:42 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Sat, 28 Nov 2020 03:21:24 +0000 (19:21 -0800)
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_common.c
libusb/os/windows_winusb.c
libusb/version_nano.h

index f25c340..119ed49 100644 (file)
@@ -114,7 +114,7 @@ HMODULE load_system_library(struct libusb_context *ctx, const char *name)
 
        filename_start = library_path + length;
        // Append '\' + name + ".dll" + NUL
-       length += 1 + strlen(name) + 4 + 1;
+       length += 1 + (UINT)strlen(name) + 4 + 1;
        if (length >= (UINT)sizeof(library_path)) {
                usbi_err(ctx, "program assertion failed - library path buffer overflow");
                return NULL;
index 7d47323..f291b8e 100644 (file)
@@ -994,6 +994,9 @@ make_descriptors:
                config_desc_length = ROOT_HUB_FS_CONFIG_DESC_LENGTH;
                ep_interval = 0xff;     // 255ms
                break;
+       default:                        // Impossible, buts keeps compiler happy
+               usbi_err(ctx, "program assertion failed - unknown root hub speed");
+               return LIBUSB_ERROR_INVALID_PARAM;
        }
 
        if (speed >= LIBUSB_SPEED_SUPER) {
index 18701f1..411b5f9 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11579
+#define LIBUSB_NANO 11580