summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-17 20:13:34 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-07-17 14:35:43 +1000
commit88273287e1d7b3c06313f77d450f87a31bf53780 (patch)
tree33755f8a2a1a182f752b809580db5f4279300b34
parent4081b00d36d074eedf5c8d04196998d23cff28cf (diff)
dix: invert a loop condition
Change the single if condition in the loop body to a if (!foo) continue; and re-indent the rest. No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit a71a283934406d870bcd8dc376eb1c9ce1c8bbb4)
-rw-r--r--dix/touch.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/dix/touch.c b/dix/touch.c
index 0cbc2eb01..be4a7de00 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -718,21 +718,22 @@ TouchRemoveListener(TouchPointInfoPtr ti, XID resource)
int i;
for (i = 0; i < ti->num_listeners; i++) {
- if (ti->listeners[i].listener == resource) {
- int j;
+ int j;
- if (ti->listeners[i].grab) {
- ti->listeners[i].grab = NULL;
- ti->num_grabs--;
- }
+ if (ti->listeners[i].listener != resource)
+ continue;
- for (j = i; j < ti->num_listeners - 1; j++)
- ti->listeners[j] = ti->listeners[j + 1];
- ti->num_listeners--;
- ti->listeners[ti->num_listeners].listener = 0;
- ti->listeners[ti->num_listeners].state = LISTENER_AWAITING_BEGIN;
- return TRUE;
+ if (ti->listeners[i].grab) {
+ ti->listeners[i].grab = NULL;
+ ti->num_grabs--;
}
+
+ for (j = i; j < ti->num_listeners - 1; j++)
+ ti->listeners[j] = ti->listeners[j + 1];
+ ti->num_listeners--;
+ ti->listeners[ti->num_listeners].listener = 0;
+ ti->listeners[ti->num_listeners].state = LISTENER_AWAITING_BEGIN;
+ return TRUE;
}
return FALSE;
}