int r = LIBUSB_ERROR_OTHER;
bool winusb_backend_init = false;
- sprintf(mutex_name, "libusb_init%08X", (unsigned int)(GetCurrentProcessId() & 0xFFFFFFFFU));
+ sprintf(mutex_name, "libusb_init%08lX", ULONG_CAST(GetCurrentProcessId() & 0xFFFFFFFFU));
mutex = CreateMutexA(NULL, FALSE, mutex_name);
if (mutex == NULL) {
usbi_err(ctx, "could not create mutex: %s", windows_error_str(0));
char mutex_name[11 + 8 + 1]; // strlen("libusb_init") + (32-bit hex PID) + '\0'
HANDLE mutex;
- sprintf(mutex_name, "libusb_init%08lX", (GetCurrentProcessId() & 0xFFFFFFFFU));
+ sprintf(mutex_name, "libusb_init%08lX", ULONG_CAST(GetCurrentProcessId() & 0xFFFFFFFFU));
mutex = CreateMutexA(NULL, FALSE, mutex_name);
if (mutex == NULL)
return;
// devices will have only MI_00 & MI_03 for instance), we retrieve the actual
// interface number from the path's MI value
mi_str = strstr(device_id, "MI_");
- if ((mi_str != NULL) && isdigit(mi_str[3]) && isdigit(mi_str[4])) {
+ if ((mi_str != NULL) && isdigit((unsigned char)mi_str[3]) && isdigit((unsigned char)mi_str[4])) {
interface_number = ((mi_str[3] - '0') * 10) + (mi_str[4] - '0');
} else {
usbi_warn(ctx, "failure to read interface number for %s, using default value", device_id);
#if defined(_MSC_VER)
// disable /W4 MSVC warnings that are benign
-#pragma warning(disable:4201) // nameless struct/union
#pragma warning(disable:4214) // bit field types other than int
#endif
-#define LIBUSB_NANO 11462
+#define LIBUSB_NANO 11463
#pragma warning(disable:4127)
/* Disable: warning C4200: nonstandard extension used : zero-sized array in struct/union */
#pragma warning(disable:4200)
+/* Disable: warning C4201: nonstandard extension used : nameless struct/union */
+#pragma warning(disable:4201)
/* Disable: warning C4324: structure was padded due to __declspec(align()) */
#pragma warning(disable:4324)
/* Disable: warning C4996: 'GetVersionExA': was declared deprecated */