summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Antti Korpi2020-03-22 22:34:31 +0100
committerGravatar Antti Korpi2020-03-22 22:34:31 +0100
commita9d4df7da2fa0178ee30730ca7cba913563ee259 (patch)
treec45513495f22d8a5280ff5aca273248121690836
parent8cf0497d29dcb22e3a8f222405aa26b93dd1ba19 (diff)
downloadxkbcat-a9d4df7da2fa0178ee30730ca7cba913563ee259.tar.gz
xkbcat-a9d4df7da2fa0178ee30730ca7cba913563ee259.zip
Tidy main loop formatting
-rw-r--r--xkbcat.c11
1 files 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;
}