[hackers] [dwm] some sanity changes

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Sat Oct 27 18:22:09 2007

changeset: 1046:74aca4c70765
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Sat Oct 27 18:21:02 2007 +0200
summary: some sanity changes

diff -r 8a79aa547b6e -r 74aca4c70765 dwm.c
--- a/dwm.c Sat Oct 27 18:12:54 2007 +0200
+++ b/dwm.c Sat Oct 27 18:21:02 2007 +0200
@@ -666,7 +666,7 @@ expose(XEvent *e) {
 expose(XEvent *e) {
         XExposeEvent *ev = &e->xexpose;
 
- if(ev->count == 0) {
+ if(0 == ev->count) {
                 if(barwin == ev->window)
                         drawbar();
         }
@@ -780,7 +780,7 @@ gettextprop(Window w, Atom atom, char *t
         int n;
         XTextProperty name;
 
- if(!text || size == 0)
+ if(!text || 0 == size)
                 return False;
         text[0] = '\0';
         XGetTextProperty(dpy, w, &name, atom);
@@ -1398,7 +1398,7 @@ setmwfact(const char *arg) {
         if(!(ISTILE))
                 return;
         /* arg handling, manipulate mwfact */
- if(arg == NULL)
+ if(NULL == arg)
                 mwfact = MWFACT;
         else if(1 == sscanf(arg, "%lf", &delta)) {
                 if(arg[0] == '+' || arg[0] == '-')
@@ -1515,8 +1515,8 @@ spawn(const char *arg) {
                 return;
         /* The double-fork construct avoids zombie processes and keeps the code
          * clean from stupid signal handlers. */
- if(fork() == 0) {
- if(fork() == 0) {
+ if(0 == fork()) {
+ if(0 == fork()) {
                         if(dpy)
                                 close(ConnectionNumber(dpy));
                         setsid();
@@ -1576,7 +1576,7 @@ tile(void) {
         nw = 0; /* gcc stupidity requires this */
         for(i = 0, c = mc = nexttiled(clients); c; c = nexttiled(c->next), i++) {
                 c->ismax = False;
- if(i == 0) { /* master */
+ if(0 == i) { /* master */
                         nw = mw - 2 * c->border;
                         nh = wah - 2 * c->border;
                 }
@@ -1836,7 +1836,7 @@ view(const char *arg) {
 
         memcpy(prevtags, seltags, sizeof seltags);
         for(i = 0; i < NTAGS; i++)
- seltags[i] = arg == NULL;
+ seltags[i] = (NULL == arg);
         seltags[idxoftag(arg)] = True;
         arrange();
 }
Received on Sat Oct 27 2007 - 18:22:09 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:38 UTC