Windows: Silence VS2013 code analysis warnings
* Also update Windows version report for Windows 10
This commit is contained in:
parent
ab8f71c03f
commit
ada59db186
5 changed files with 13 additions and 9 deletions
|
@ -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
|
// 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");
|
old_dbg_str = getenv("LIBUSB_DEBUG");
|
||||||
if (debug_mode) {
|
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();
|
version = libusb_get_version();
|
||||||
|
|
|
@ -186,7 +186,8 @@ int usbi_cond_timedwait(usbi_cond_t *cond,
|
||||||
// GetSystemTimeAsFileTime() is not available on CE
|
// GetSystemTimeAsFileTime() is not available on CE
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
GetSystemTime(&st);
|
GetSystemTime(&st);
|
||||||
SystemTimeToFileTime(&st, &filetime);
|
if (!SystemTimeToFileTime(&st, &filetime))
|
||||||
|
return 0;
|
||||||
rtime.LowPart = filetime.dwLowDateTime;
|
rtime.LowPart = filetime.dwLowDateTime;
|
||||||
rtime.HighPart = filetime.dwHighDateTime;
|
rtime.HighPart = filetime.dwHighDateTime;
|
||||||
rtime.QuadPart -= epoch_time;
|
rtime.QuadPart -= epoch_time;
|
||||||
|
|
|
@ -890,13 +890,13 @@ static void get_windows_version(void)
|
||||||
break;
|
break;
|
||||||
case 0x63: w = (ws?"8.1":"2012_R2");
|
case 0x63: w = (ws?"8.1":"2012_R2");
|
||||||
break;
|
break;
|
||||||
case 0x64: w = (ws?"8.2":"2012_R3");
|
case 0x64: w = (ws?"10":"2015");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (windows_version < 0x50)
|
if (windows_version < 0x50)
|
||||||
windows_version = WINDOWS_UNSUPPORTED;
|
windows_version = WINDOWS_UNSUPPORTED;
|
||||||
else
|
else
|
||||||
w = "9 or later";
|
w = "11 or later";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,12 @@
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
// disable /W4 MSVC warnings that are benign
|
// 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:4100) // unreferenced formal parameter
|
#pragma warning(disable:4127) // conditional expression is constant
|
||||||
#pragma warning(disable:4214) // bit field types other than int
|
#pragma warning(disable:4201) // nameless struct/union
|
||||||
#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
|
#endif
|
||||||
|
|
||||||
// Missing from MSVC6 setupapi.h
|
// Missing from MSVC6 setupapi.h
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#define LIBUSB_NANO 10921
|
#define LIBUSB_NANO 10922
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue