From 7de7f0ef178d2800f1ca70c15e8aff8aeb16bb8d Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 20 Feb 2019 21:59:03 +0100 Subject: Fix all -Wtype-limits warnings. --- platform/x11/joypad_linux.cpp | 2 +- platform/x11/os_x11.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index 907c652ab4..7cf0a1ef1e 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -476,7 +476,7 @@ void JoypadLinux::process_joypads() { // ev may be tainted and out of MAX_KEY range, which will cause // joy->key_map[ev.code] to crash - if (ev.code < 0 || ev.code >= MAX_KEY) + if (ev.code >= MAX_KEY) return; switch (ev.type) { diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 8db4635d68..879642d8f9 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1743,7 +1743,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { // is correct, but the xorg developers are // not very helpful today. - ::Time tresh = ABS(peek_event.xkey.time - xkeyevent->time); + ::Time tresh = ABSDIFF(peek_event.xkey.time, xkeyevent->time); if (peek_event.type == KeyPress && tresh < 5) { KeySym rk; XLookupString((XKeyEvent *)&peek_event, str, 256, &rk, NULL); -- cgit v1.2.3