Windows: Silence VS2013 code analysis warnings
authorPete Batard <pete@akeo.ie>
Thu, 13 Nov 2014 22:03:30 +0000 (22:03 +0000)
committerPete Batard <pete@akeo.ie>
Thu, 13 Nov 2014 22:03:30 +0000 (22:03 +0000)
* Also update Windows version report for Windows 10

examples/xusb.c
libusb/os/threads_windows.c
libusb/os/windows_usb.c
libusb/os/windows_usb.h
libusb/version_nano.h

index f7549ca..0fdb19d 100644 (file)
@@ -1098,7 +1098,8 @@ int main(int argc, char** argv)
        // but since we can't call on libusb_set_debug() before libusb_init(), we use the env variable method
        old_dbg_str = getenv("LIBUSB_DEBUG");
        if (debug_mode) {
-               putenv("LIBUSB_DEBUG=4");       // LIBUSB_LOG_LEVEL_DEBUG
+               if (putenv("LIBUSB_DEBUG=4") != 0)      // LIBUSB_LOG_LEVEL_DEBUG
+                       printf("Unable to set debug level");
        }
 
        version = libusb_get_version();
index 8d34ed5..700bad6 100644 (file)
@@ -186,7 +186,8 @@ int usbi_cond_timedwait(usbi_cond_t *cond,
        // GetSystemTimeAsFileTime() is not available on CE
        SYSTEMTIME st;
        GetSystemTime(&st);
-       SystemTimeToFileTime(&st, &filetime);
+       if (!SystemTimeToFileTime(&st, &filetime))
+               return 0;
        rtime.LowPart   = filetime.dwLowDateTime;
        rtime.HighPart  = filetime.dwHighDateTime;
        rtime.QuadPart -= epoch_time;
index 59f7480..20ca448 100644 (file)
@@ -890,13 +890,13 @@ static void get_windows_version(void)
                                break;
                        case 0x63: w = (ws?"8.1":"2012_R2");
                                break;
-                       case 0x64: w = (ws?"8.2":"2012_R3");
+                       case 0x64: w = (ws?"10":"2015");
                                break;
                        default:
                                if (windows_version < 0x50)
                                        windows_version = WINDOWS_UNSUPPORTED;
                                else
-                                       w = "9 or later";
+                                       w = "11 or later";
                                break;
                        }
                }
index a36419e..817a469 100644 (file)
 
 #if defined(_MSC_VER)
 // disable /W4 MSVC warnings that are benign
-#pragma warning(disable:4127) // conditional expression is constant
-#pragma warning(disable:4100) // unreferenced formal parameter
-#pragma warning(disable:4214) // bit field types other than int
-#pragma warning(disable:4201) // nameless struct/union
+#pragma warning(disable:4100)  // unreferenced formal parameter
+#pragma warning(disable:4127)  // conditional expression is constant
+#pragma warning(disable:4201)  // nameless struct/union
+#pragma warning(disable:4214)  // bit field types other than int
+#pragma warning(disable:4996)  // deprecated API calls
+#pragma warning(disable:28159) // more deprecated API calls
 #endif
 
 // Missing from MSVC6 setupapi.h
index 1318c5e..958de46 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10921
+#define LIBUSB_NANO 10922