aewl

diff draw.c @ 532:651f2c868b31

code polishing, removed unnecessary newlines
author Anselm R. Garbe <arg@10kloc.org>
date Fri, 06 Oct 2006 11:50:15 +0200
parents 451f19d48845
children f05cfa7d5128
line diff
     1.1 --- a/draw.c	Fri Oct 06 11:37:12 2006 +0200
     1.2 +++ b/draw.c	Fri Oct 06 11:50:15 2006 +0200
     1.3 @@ -1,5 +1,4 @@
     1.4 -/*
     1.5 - * (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
     1.6 +/* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
     1.7   * See LICENSE file for license details.
     1.8   */
     1.9  #include "dwm.h"
    1.10 @@ -30,21 +29,17 @@
    1.11  
    1.12  	XSetForeground(dpy, dc.gc, col[ColBG]);
    1.13  	XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
    1.14 -
    1.15  	if(!text)
    1.16  		return;
    1.17 -
    1.18  	w = 0;
    1.19  	olen = len = strlen(text);
    1.20  	if(len >= sizeof(buf))
    1.21  		len = sizeof(buf) - 1;
    1.22  	memcpy(buf, text, len);
    1.23  	buf[len] = 0;
    1.24 -
    1.25  	h = dc.font.ascent + dc.font.descent;
    1.26  	y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
    1.27  	x = dc.x + (h / 2);
    1.28 -
    1.29  	/* shorten text if necessary */
    1.30  	while(len && (w = textnw(buf, len)) > dc.w - h)
    1.31  		buf[--len] = 0;
    1.32 @@ -56,7 +51,6 @@
    1.33  		if(len > 3)
    1.34  			buf[len - 3] = '.';
    1.35  	}
    1.36 -
    1.37  	if(w > dc.w)
    1.38  		return; /* too long */
    1.39  	gcv.foreground = col[ColFG];
    1.40 @@ -93,7 +87,6 @@
    1.41  	int i, x;
    1.42  
    1.43  	dc.x = dc.y = 0;
    1.44 -
    1.45  	for(i = 0; i < ntags; i++) {
    1.46  		dc.w = textw(tags[i]);
    1.47  		if(seltag[i])
    1.48 @@ -102,10 +95,8 @@
    1.49  			drawtext(tags[i], dc.norm, sel && sel->tags[i]);
    1.50  		dc.x += dc.w;
    1.51  	}
    1.52 -
    1.53  	dc.w = bmw;
    1.54  	drawtext(arrange == dofloat ?  FLOATSYMBOL : TILESYMBOL, dc.status, False);
    1.55 -
    1.56  	x = dc.x + dc.w;
    1.57  	dc.w = textw(stext);
    1.58  	dc.x = bx + bw - dc.w;
    1.59 @@ -114,7 +105,6 @@
    1.60  		dc.w = bw - x;
    1.61  	}
    1.62  	drawtext(stext, dc.status, False);
    1.63 -
    1.64  	if((dc.w = dc.x - x) > bh) {
    1.65  		dc.x = x;
    1.66  		if(sel)
    1.67 @@ -134,7 +124,6 @@
    1.68  		XSetWindowBorder(dpy, c->win, dc.sel[ColBG]);
    1.69  		return;
    1.70  	}
    1.71 -
    1.72  	XSetWindowBorder(dpy, c->win, dc.norm[ColBG]);
    1.73  	XMapWindow(dpy, c->twin);
    1.74  	dc.x = dc.y = 0;
    1.75 @@ -177,7 +166,6 @@
    1.76  		XFontSetExtents *font_extents;
    1.77  		XFontStruct **xfonts;
    1.78  		char **font_names;
    1.79 -
    1.80  		dc.font.ascent = dc.font.descent = 0;
    1.81  		font_extents = XExtentsOfFontSet(dc.font.set);
    1.82  		n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);