From 3c2bf225ca283d58b3562d290a1e80e011a01881 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 12 Dec 2025 17:10:32 +0100 Subject: [PATCH] xnest: silence type mismatch warning on ming32 KeySym and xcb_keysym_t should both be 32bit, but for the compiler they're long vs int, so it's spitting out a warning here. That's coming from xorgproto's weird way of defining those types. Add static type size assert and hard typecast to silence it. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/Keyboard.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 2fcef5de8..3477c2a05 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -24,6 +24,8 @@ is" without express or implied warranty. #include #include +#include "os/osdep.h" + #include "screenint.h" #include "inputstr.h" #include "misc.h" @@ -89,6 +91,10 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl * ctrl) #endif } +/* make sure that KeySym and xcb_keysym_t are both 32 bit */ +__size_assert(KeySym, 4); +__size_assert(xcb_keysym_t, 4); + int xnestKeyboardProc(DeviceIntPtr pDev, int onoff) { @@ -115,7 +121,8 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) .minKeyCode = min_keycode, .maxKeyCode = max_keycode, .mapWidth = keymap_reply->keysyms_per_keycode, - .map = xcb_get_keyboard_mapping_keysyms(keymap_reply), + /* mingw32 complains on type mismatch, but we already made sure they're both 32bit */ + .map = (KeySym*)xcb_get_keyboard_mapping_keysyms(keymap_reply), }; xcb_generic_error_t *mod_err = NULL;