diff options
-rw-r--r-- | src/win.c | 23 | ||||
-rw-r--r-- | src/x11.c | 11 |
2 files changed, 18 insertions, 16 deletions
@@ -450,11 +450,11 @@ static uint32_t getModifiers(void) { // clang-format off - return (((GetKeyState(VK_SHIFT) < 0) ? PUGL_MOD_SHIFT : 0U) | - ((GetKeyState(VK_CONTROL) < 0) ? PUGL_MOD_CTRL : 0U) | - ((GetKeyState(VK_MENU) < 0) ? PUGL_MOD_ALT : 0U) | - ((GetKeyState(VK_LWIN) < 0) ? PUGL_MOD_SUPER : 0U) | - ((GetKeyState(VK_RWIN) < 0) ? PUGL_MOD_SUPER : 0U)); + return (((GetKeyState(VK_SHIFT) < 0) ? (uint32_t)PUGL_MOD_SHIFT : 0U) | + ((GetKeyState(VK_CONTROL) < 0) ? (uint32_t)PUGL_MOD_CTRL : 0U) | + ((GetKeyState(VK_MENU) < 0) ? (uint32_t)PUGL_MOD_ALT : 0U) | + ((GetKeyState(VK_LWIN) < 0) ? (uint32_t)PUGL_MOD_SUPER : 0U) | + ((GetKeyState(VK_RWIN) < 0) ? (uint32_t)PUGL_MOD_SUPER : 0U)); // clang-format on } @@ -614,12 +614,13 @@ handleConfigure(PuglView* view, PuglEvent* event) event->configure.height = (PuglSpan)height; event->configure.style = - ((view->impl->mapped ? PUGL_VIEW_STYLE_MAPPED : 0U) | - (view->resizing ? PUGL_VIEW_STYLE_RESIZING : 0U) | - (view->impl->fullscreen ? PUGL_VIEW_STYLE_FULLSCREEN : 0U) | - (view->impl->minimized ? PUGL_VIEW_STYLE_HIDDEN : 0U) | - (view->impl->maximized ? (PUGL_VIEW_STYLE_TALL | PUGL_VIEW_STYLE_WIDE) - : 0U)); + ((view->impl->mapped ? (unsigned)PUGL_VIEW_STYLE_MAPPED : 0U) | + (view->resizing ? (unsigned)PUGL_VIEW_STYLE_RESIZING : 0U) | + (view->impl->fullscreen ? (unsigned)PUGL_VIEW_STYLE_FULLSCREEN : 0U) | + (view->impl->minimized ? (unsigned)PUGL_VIEW_STYLE_HIDDEN : 0U) | + (view->impl->maximized + ? (unsigned)(PUGL_VIEW_STYLE_TALL | PUGL_VIEW_STYLE_WIDE) + : 0U)); return rect; } @@ -848,7 +848,8 @@ translateKey(PuglView* const view, XEvent* const xevent, PuglEvent* const event) const PuglKey special = keySymToSpecial(sym); event->key.key = - ((special || ufound <= 0) ? special : puglDecodeUTF8((const uint8_t*)ustr)); + ((special || ufound <= 0) ? special + : (PuglKey)puglDecodeUTF8((const uint8_t*)ustr)); if (xevent->type == KeyPress && !filter && !special && view->impl->xic) { // Lookup shifted key for possible text event @@ -871,10 +872,10 @@ translateKey(PuglView* const view, XEvent* const xevent, PuglEvent* const event) static uint32_t translateModifiers(const unsigned xstate) { - return (((xstate & ShiftMask) ? PUGL_MOD_SHIFT : 0U) | - ((xstate & ControlMask) ? PUGL_MOD_CTRL : 0U) | - ((xstate & Mod1Mask) ? PUGL_MOD_ALT : 0U) | - ((xstate & Mod4Mask) ? PUGL_MOD_SUPER : 0U)); + return (((xstate & ShiftMask) ? (uint32_t)PUGL_MOD_SHIFT : 0U) | + ((xstate & ControlMask) ? (uint32_t)PUGL_MOD_CTRL : 0U) | + ((xstate & Mod1Mask) ? (uint32_t)PUGL_MOD_ALT : 0U) | + ((xstate & Mod4Mask) ? (uint32_t)PUGL_MOD_SUPER : 0U)); } static PuglStatus |