diff options
author | Pete Batard <pete@akeo.ie> | 2014-11-13 22:03:30 +0000 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2014-11-13 22:03:30 +0000 |
commit | ada59db186aa95215158129db8cd42e079daff07 (patch) | |
tree | df9991bb82148db26d5c8e83b49e816c859bec66 | |
parent | ab8f71c03f8334df7b88a725a730d2020f2e9f80 (diff) | |
download | libusb-ada59db186aa95215158129db8cd42e079daff07.tar.gz |
Windows: Silence VS2013 code analysis warnings
* Also update Windows version report for Windows 10
-rw-r--r-- | examples/xusb.c | 3 | ||||
-rw-r--r-- | libusb/os/threads_windows.c | 3 | ||||
-rw-r--r-- | libusb/os/windows_usb.c | 4 | ||||
-rw-r--r-- | libusb/os/windows_usb.h | 10 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
5 files changed, 13 insertions, 9 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index f7549ca..0fdb19d 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -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(); diff --git a/libusb/os/threads_windows.c b/libusb/os/threads_windows.c index 8d34ed5..700bad6 100644 --- a/libusb/os/threads_windows.c +++ b/libusb/os/threads_windows.c @@ -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; diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 59f7480..20ca448 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -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; } } diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h index a36419e..817a469 100644 --- a/libusb/os/windows_usb.h +++ b/libusb/os/windows_usb.h @@ -26,10 +26,12 @@ #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 diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 1318c5e..958de46 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10921 +#define LIBUSB_NANO 10922 |