diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-06-09 20:53:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-06-09 20:53:54 +0100 |
commit | 35d7a2fb13fc833aa1b654ca6fd6e429e72e6b49 (patch) | |
tree | 257dbf4040c59cf01a5072d35f0c9e5264bba09d /src/gui_w32.c | |
parent | 63f32603789d1a27c559fc440325955fd0b8b500 (diff) |
patch 8.2.5073: clang on MS-Windows produces warningsv8.2.5073
Problem: Clang on MS-Windows produces warnings.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10546)
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r-- | src/gui_w32.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c index 3e1addbf91..cbfe6627ff 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -392,7 +392,7 @@ stubGetDpiForSystem(void) } static int WINAPI -stubGetSystemMetricsForDpi(int nIndex, UINT dpi) +stubGetSystemMetricsForDpi(int nIndex, UINT dpi UNUSED) { return GetSystemMetrics(nIndex); } @@ -4149,7 +4149,7 @@ init_mouse_wheel(void) * Mouse scroll event handler. */ static void -_OnMouseWheel(HWND hwnd, WPARAM wParam, LPARAM lParam, int horizontal) +_OnMouseWheel(HWND hwnd UNUSED, WPARAM wParam, LPARAM lParam, int horizontal) { int button; win_T *wp; @@ -4336,9 +4336,10 @@ static HWND hwndTip = NULL; static void show_sizing_tip(int cols, int rows) { - TOOLINFOA ti = {sizeof(ti)}; + TOOLINFOA ti; char buf[32]; + ti.cbSize = sizeof(ti); ti.hwnd = s_hwnd; ti.uId = (UINT_PTR)s_hwnd; ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND; @@ -4636,7 +4637,7 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) #endif static LRESULT -_OnDpiChanged(HWND hwnd, UINT xdpi, UINT ydpi, RECT *rc) +_OnDpiChanged(HWND hwnd, UINT xdpi UNUSED, UINT ydpi, RECT *rc UNUSED) { s_dpi = ydpi; s_in_dpichanged = TRUE; @@ -5106,12 +5107,12 @@ load_dpi_func(void) if (hUser32 == NULL) goto fail; - pGetDpiForSystem = (void*)GetProcAddress(hUser32, "GetDpiForSystem"); - pGetDpiForWindow = (void*)GetProcAddress(hUser32, "GetDpiForWindow"); - pGetSystemMetricsForDpi = (void*)GetProcAddress(hUser32, "GetSystemMetricsForDpi"); + pGetDpiForSystem = (UINT (WINAPI *)(void))GetProcAddress(hUser32, "GetDpiForSystem"); + pGetDpiForWindow = (UINT (WINAPI *)(HWND))GetProcAddress(hUser32, "GetDpiForWindow"); + pGetSystemMetricsForDpi = (int (WINAPI *)(int, UINT))GetProcAddress(hUser32, "GetSystemMetricsForDpi"); //pGetWindowDpiAwarenessContext = (void*)GetProcAddress(hUser32, "GetWindowDpiAwarenessContext"); - pSetThreadDpiAwarenessContext = (void*)GetProcAddress(hUser32, "SetThreadDpiAwarenessContext"); - pGetAwarenessFromDpiAwarenessContext = (void*)GetProcAddress(hUser32, "GetAwarenessFromDpiAwarenessContext"); + pSetThreadDpiAwarenessContext = (DPI_AWARENESS_CONTEXT (WINAPI *)(DPI_AWARENESS_CONTEXT))GetProcAddress(hUser32, "SetThreadDpiAwarenessContext"); + pGetAwarenessFromDpiAwarenessContext = (DPI_AWARENESS (WINAPI *)(DPI_AWARENESS_CONTEXT))GetProcAddress(hUser32, "GetAwarenessFromDpiAwarenessContext"); if (pSetThreadDpiAwarenessContext != NULL) { @@ -7799,8 +7800,9 @@ initialise_toolbar(void) update_toolbar_size(void) { int w, h; - TBMETRICS tbm = {sizeof(TBMETRICS)}; + TBMETRICS tbm; + tbm.cbSize = sizeof(TBMETRICS); tbm.dwMask = TBMF_PAD | TBMF_BUTTONSPACING; SendMessage(s_toolbarhwnd, TB_GETMETRICS, 0, (LPARAM)&tbm); //TRACE("Pad: %d, %d", tbm.cxPad, tbm.cyPad); @@ -8043,27 +8045,27 @@ dyn_imm_load(void) return; pImmGetCompositionStringW - = (void *)GetProcAddress(hLibImm, "ImmGetCompositionStringW"); + = (LONG (WINAPI *)(HIMC, DWORD, LPVOID, DWORD))GetProcAddress(hLibImm, "ImmGetCompositionStringW"); pImmGetContext - = (void *)GetProcAddress(hLibImm, "ImmGetContext"); + = (HIMC (WINAPI *)(HWND))GetProcAddress(hLibImm, "ImmGetContext"); pImmAssociateContext - = (void *)GetProcAddress(hLibImm, "ImmAssociateContext"); + = (HIMC (WINAPI *)(HWND, HIMC))GetProcAddress(hLibImm, "ImmAssociateContext"); pImmReleaseContext - = (void *)GetProcAddress(hLibImm, "ImmReleaseContext"); + = (BOOL (WINAPI *)(HWND, HIMC))GetProcAddress(hLibImm, "ImmReleaseContext"); pImmGetOpenStatus - = (void *)GetProcAddress(hLibImm, "ImmGetOpenStatus"); + = (BOOL (WINAPI *)(HIMC))GetProcAddress(hLibImm, "ImmGetOpenStatus"); pImmSetOpenStatus - = (void *)GetProcAddress(hLibImm, "ImmSetOpenStatus"); + = (BOOL (WINAPI *)(HIMC, BOOL))GetProcAddress(hLibImm, "ImmSetOpenStatus"); pImmGetCompositionFontW - = (void *)GetProcAddress(hLibImm, "ImmGetCompositionFontW"); + = (BOOL (WINAPI *)(HIMC, LPLOGFONTW))GetProcAddress(hLibImm, "ImmGetCompositionFontW"); pImmSetCompositionFontW - = (void *)GetProcAddress(hLibImm, "ImmSetCompositionFontW"); + = (BOOL (WINAPI *)(HIMC, LPLOGFONTW))GetProcAddress(hLibImm, "ImmSetCompositionFontW"); pImmSetCompositionWindow - = (void *)GetProcAddress(hLibImm, "ImmSetCompositionWindow"); + = (BOOL (WINAPI *)(HIMC, LPCOMPOSITIONFORM))GetProcAddress(hLibImm, "ImmSetCompositionWindow"); pImmGetConversionStatus - = (void *)GetProcAddress(hLibImm, "ImmGetConversionStatus"); + = (BOOL (WINAPI *)(HIMC, LPDWORD, LPDWORD))GetProcAddress(hLibImm, "ImmGetConversionStatus"); pImmSetConversionStatus - = (void *)GetProcAddress(hLibImm, "ImmSetConversionStatus"); + = (BOOL (WINAPI *)(HIMC, DWORD, DWORD))GetProcAddress(hLibImm, "ImmSetConversionStatus"); if ( pImmGetCompositionStringW == NULL || pImmGetContext == NULL |