diff --git a/test/testing.c b/test/testing.c index 542eadb0..2fa994e8 100644 --- a/test/testing.c +++ b/test/testing.c @@ -328,7 +328,15 @@ char *testingNsecString(int64_t nsec) unsec = (uint64_t) nsec; neg = 0; if (nsec < 0) { +#ifdef _MSC_VER +// TODO figure out a more explicit way to do this; until then, just go with what the standard says should happen, because it's what we want (TODO verify this) +#pragma warning(push) +#pragma warning(disable: 4146) +#endif unsec = -unsec; +#ifdef _MSC_VER +#pragma warning(pop) +#endif neg = 1; } diff --git a/windows/main.cpp b/windows/main.cpp index 48a68dd8..35be9942 100644 --- a/windows/main.cpp +++ b/windows/main.cpp @@ -42,8 +42,8 @@ static inline void setHInstance(void) ICC_DATE_CLASSES | /* date/time picker */ \ 0) -#define errGetDefaultIconFailed "failed to load default icon" -#define errGetDefaultCursorFailed "failed to load default cursor" +#define errLoadDefaultIconFailed "failed to load default icon" +#define errLoadDefaultCursorFailed "failed to load default cursor" #define errInitUtilWindowFailed "failed to initialize the utility window" #define errICCFailed "InitCommonControlsEx() failed" #define errICCFailedNoLastError "InitCommonControlsEx() failed, but didn't specify why. This usually means you forgot the Common Controls v6 manifest; refer to the libui documentation for instructions." @@ -51,8 +51,8 @@ static inline void setHInstance(void) #define errHRESULTInitErrorsSuffix ": 0x00000000" static const char *initErrors[] = { - errGetDefaultIconFailed errHRESULTInitErrorsSuffix - errGetDefaultCursorFailed errHRESULTInitErrorsSuffix + errLoadDefaultIconFailed errHRESULTInitErrorsSuffix + errLoadDefaultCursorFailed errHRESULTInitErrorsSuffix errInitUtilWindowFailed errHRESULTInitErrorsSuffix errICCFailed errHRESULTInitErrorsSuffix, errICCFailedNoLastError, diff --git a/windows/utilwin.cpp b/windows/utilwin.cpp index 3b9debd0..0f7a9561 100644 --- a/windows/utilwin.cpp +++ b/windows/utilwin.cpp @@ -29,7 +29,7 @@ HRESULT uiprivInitUtilWindow(HICON hDefaultIcon, HCURSOR hDefaultCursor) ZeroMemory(&wc, sizeof (WNDCLASSW)); wc.lpszClassName = utilWindowClass; wc.lpfnWndProc = utilWindowWndProc; - wc.hInstance = hInstance; + wc.hInstance = uipriv_hInstance; wc.hIcon = hDefaultIcon; wc.hCursor = hDefaultCursor; wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1); @@ -40,6 +40,6 @@ HRESULT uiprivInitUtilWindow(HICON hDefaultIcon, HCURSOR hDefaultCursor) utilWindowClass, L"libui utility window", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, - NULL, NULL, hInstance, NULL, + NULL, NULL, uipriv_hInstance, NULL, &uiprivUtilWindow); }