From a9d4df7da2fa0178ee30730ca7cba913563ee259 Mon Sep 17 00:00:00 2001 From: Antti Korpi Date: Sun, 22 Mar 2020 22:34:31 +0100 Subject: Tidy main loop formatting --- xkbcat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xkbcat.c b/xkbcat.c index 1d3bbee..ffc39a7 100644 --- a/xkbcat.c +++ b/xkbcat.c @@ -71,17 +71,15 @@ int main(int argc, char * argv[]) { XSync(disp, false); free(m.mask); - while (1) { // Forever + while ("forever") { XEvent event; XGenericEventCookie *cookie = (XGenericEventCookie*)&event.xcookie; XNextEvent(disp, &event); if (XGetEventData(disp, cookie) && cookie->type == GenericEvent && - cookie->extension == xiOpcode) - { - switch (cookie->evtype) - { + cookie->extension == xiOpcode) { + switch (cookie->evtype) { case XI_RawKeyRelease: if (!printKeyUps) continue; case XI_RawKeyPress: { XIRawEvent *ev = cookie->data; @@ -93,7 +91,8 @@ int main(int argc, char * argv[]) { if (NULL == str) continue; - if (printKeyUps) printf("%s", cookie->evtype == XI_RawKeyPress ? "+" : "-"); + if (printKeyUps) printf("%s", + cookie->evtype == XI_RawKeyPress ? "+" : "-"); printf("%s\n", str); break; } -- cgit v1.3-2-g0d8e