[hackers] [dwm] applied anonymous code cleanup patch || garbeam

From: <hg_AT_suckless.org>
Date: Wed, 27 Jul 2011 19:59:13 +0200 (CEST)

changeset: 1572:b46ae56abe65
tag: tip
user: garbeam_AT_gmail.com
date: Wed Jul 27 19:59:10 2011 +0200
files: dwm.c
description:
applied anonymous code cleanup patch

diff -r 701f651eaecc -r b46ae56abe65 dwm.c
--- a/dwm.c Sun Jul 24 10:41:43 2011 +0100
+++ b/dwm.c Wed Jul 27 19:59:10 2011 +0200
@@ -433,9 +433,9 @@
         }
         if(ev->window == selmon->barwin) {
                 i = x = 0;
- do {
+ do
                         x += TEXTW(tags[i]);
- } while(ev->x >= x && ++i < LENGTH(tags));
+ while(ev->x >= x && ++i < LENGTH(tags));
                 if(i < LENGTH(tags)) {
                         click = ClkTagBar;
                         arg.ui = 1 << i;
@@ -720,12 +720,10 @@
                 if(!(m = selmon->next))
                         m = mons;
         }
- else {
- if(selmon == mons)
- for(m = mons; m->next; m = m->next);
- else
- for(m = mons; m->next != selmon; m = m->next);
- }
+ else if(selmon == mons)
+ for(m = mons; m->next; m = m->next);
+ else
+ for(m = mons; m->next != selmon; m = m->next);
         return m;
 }
 
@@ -1017,12 +1015,11 @@
                 KeyCode code;
 
                 XUngrabKey(dpy, AnyKey, AnyModifier, root);
- for(i = 0; i < LENGTH(keys); i++) {
+ for(i = 0; i < LENGTH(keys); i++)
                         if((code = XKeysymToKeycode(dpy, keys[i].keysym)))
                                 for(j = 0; j < LENGTH(modifiers); j++)
                                         XGrabKey(dpy, code, keys[i].mod | modifiers[j], root,
                                                  True, GrabModeAsync, GrabModeAsync);
- }
         }
 }
 
@@ -1031,7 +1028,6 @@
         char *def, **missing;
         int n;
 
- missing = NULL;
         dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
         if(missing) {
                 while(n--)
@@ -1311,6 +1307,7 @@
                         return m;
         return selmon;
 }
+
 void
 quit(const Arg *arg) {
         running = False;
@@ -1415,10 +1412,9 @@
         XEvent ev;
         /* main event loop */
         XSync(dpy, False);
- while(running && !XNextEvent(dpy, &ev)) {
+ while(running && !XNextEvent(dpy, &ev))
                 if(handler[ev.type])
                         handler[ev.type](&ev); /* call handler */
- }
 }
 
 void
Received on Wed Jul 27 2011 - 19:59:13 CEST

This archive was generated by hypermail 2.2.0 : Wed Jul 27 2011 - 20:00:08 CEST