diff --git a/src/conio/x_events.c b/src/conio/x_events.c index 2917161a5a1c35f9e2bf3e67f941cd8d4456bc3e..6c209ae076d35c15e4d256cc72b18516daba20c6 100644 --- a/src/conio/x_events.c +++ b/src/conio/x_events.c @@ -1590,14 +1590,14 @@ handle_configuration(int w, int h, bool map) handle_resize_event(w, h, map); } -static bool +static void x11_event(XEvent *ev) { bool resize; int x, y, w, h; if (x11.XFilterEvent(ev, win)) - return false; + return; switch (ev->type) { case ReparentNotify: parent = ev->xreparent.parent; @@ -1605,8 +1605,11 @@ x11_event(XEvent *ev) case ClientMessage: if (ev->xclient.format == 32 && ev->xclient.data.l[0] == A(WM_DELETE_WINDOW) && A(WM_DELETE_WINDOW) != None) { uint16_t key=CIO_KEY_QUIT; - if (write(key_pipe[1], &key, 2) == -1) - return false; + // Bow to GCC + if (write(key_pipe[1], &key, 2) == EXIT_FAILURE) + return; + else + return; } else if(ev->xclient.format == 32 && ev->xclient.data.l[0] == A(_NET_WM_PING) && A(_NET_WM_PING) != None) { ev->xclient.window = root; @@ -1898,8 +1901,11 @@ x11_event(XEvent *ev) else ch = cpchar_from_unicode_cpoint(getcodepage(), wbuf[i], 0); if (ch) { - if (write(key_pipe[1], &ch, 1) == -1) - return false; + // Bow to GCC + if (write(key_pipe[1], &ch, 1) == EXIT_SUCCESS) + return; + else + return; } } break; @@ -2109,17 +2115,20 @@ x11_event(XEvent *ev) uint16_t key=scan; if (key < 128) key = cpchar_from_unicode_cpoint(getcodepage(), key, key); - if(write(key_pipe[1], &key, (scan&0xff)?1:2) == -1) - return false; + // Bow to GCC + if (write(key_pipe[1], &key, (scan & 0xff) ? 1 : 2) != EXIT_SUCCESS) + return; + else + return; } break; } - return true; + return; } default: break; } - return false; + return; } static void x11_terminate_event_thread(void)