some stylistic changes d9779c06
Anselm R Garbe · 2009-07-14 16:01 1 file(s) · +8 −9
dwm.c +8 −9
51 51
#define MOUSEMASK               (BUTTONMASK|PointerMotionMask)
52 52
#define WIDTH(X)                ((X)->w + 2 * (X)->bw)
53 53
#define HEIGHT(X)               ((X)->h + 2 * (X)->bw)
54 -
#define TAGMASK                 ((int)((1LL << LENGTH(tags)) - 1))
54 +
#define TAGMASK                 ((int)((1 << LENGTH(tags)) - 1))
55 55
#define TEXTW(X)                (textnw(X, strlen(X)) + dc.font.height)
56 56
57 57
/* enums */
271 271
#include "config.h"
272 272
273 273
/* compile-time check if all tags fit into an unsigned int bit array. */
274 -
struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 : 1]; };
274 +
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
275 275
276 276
/* function implementations */
277 277
void
420 420
	}
421 421
	if(ev->window == selmon->barwin) {
422 422
		i = x = 0;
423 -
		do
423 +
		do {
424 424
			x += TEXTW(tags[i]);
425 -
		while(ev->x >= x && ++i < LENGTH(tags));
425 +
		} while(ev->x >= x && ++i < LENGTH(tags));
426 426
		if(i < LENGTH(tags)) {
427 427
			click = ClkTagBar;
428 428
			arg.ui = 1 << i;
977 977
		XFontSetExtents *font_extents;
978 978
		XFontStruct **xfonts;
979 979
		char **font_names;
980 +
980 981
		dc.font.ascent = dc.font.descent = 0;
981 982
		font_extents = XExtentsOfFontSet(dc.font.set);
982 983
		n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
1184 1185
				resize(c, nx, ny, c->w, c->h, True);
1185 1186
			break;
1186 1187
		}
1187 -
	}
1188 -
	while(ev.type != ButtonRelease);
1188 +
	} while(ev.type != ButtonRelease);
1189 1189
	XUngrabPointer(dpy, CurrentTime);
1190 1190
	if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) {
1191 1191
		sendmon(c, m);
1303 1303
				resize(c, c->x, c->y, nw, nh, True);
1304 1304
			break;
1305 1305
		}
1306 -
	}
1307 -
	while(ev.type != ButtonRelease);
1306 +
	} while(ev.type != ButtonRelease);
1308 1307
	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
1309 1308
	XUngrabPointer(dpy, CurrentTime);
1310 1309
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
1347 1346
	XSync(dpy, False);
1348 1347
	while(running && !XNextEvent(dpy, &ev))
1349 1348
		if(handler[ev.type])
1350 -
			(handler[ev.type])(&ev); /* call handler */
1349 +
			handler[ev.type](&ev); /* call handler */
1351 1350
}
1352 1351
1353 1352
void