Fix all -Wtype-limits warnings.

This commit is contained in:
marxin
2019-02-20 21:59:03 +01:00
parent a01dca79e2
commit 7de7f0ef17
9 changed files with 26 additions and 14 deletions

View File

@@ -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) {

View File

@@ -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);