summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-09-12 10:57:28 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-09-12 10:57:28 +0200
commitca65478c8968434c78aacf4a102ccbbe4a66ad9e (patch)
treea7b8e02be5fb457e1c3f0e646e212911048390b6
parentsome more simplifications of intro comment in dwm.h, this should suffice for ... (diff)
downloaddwm-ca65478c8968434c78aacf4a102ccbbe4a66ad9e.tar.gz
dwm-ca65478c8968434c78aacf4a102ccbbe4a66ad9e.zip
removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
-rw-r--r--client.c50
-rw-r--r--draw.c24
-rw-r--r--event.c59
-rw-r--r--main.c30
-rw-r--r--tag.c18
-rw-r--r--util.c12
-rw-r--r--view.c48
7 files changed, 83 insertions, 158 deletions
diff --git a/client.c b/client.c
index a794f44..956b13f 100644
--- a/client.c
+++ b/client.c
@@ -11,16 +11,14 @@
11/* static functions */ 11/* static functions */
12 12
13static void 13static void
14detachstack(Client *c) 14detachstack(Client *c) {
15{
16 Client **tc; 15 Client **tc;
17 for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext); 16 for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
18 *tc = c->snext; 17 *tc = c->snext;
19} 18}
20 19
21static void 20static void
22grabbuttons(Client *c, Bool focused) 21grabbuttons(Client *c, Bool focused) {
23{
24 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 22 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
25 23
26 if(focused) { 24 if(focused) {
@@ -54,12 +52,10 @@ grabbuttons(Client *c, Bool focused)
54 else 52 else
55 XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK, 53 XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, BUTTONMASK,
56 GrabModeAsync, GrabModeSync, None, None); 54 GrabModeAsync, GrabModeSync, None, None);
57
58} 55}
59 56
60static void 57static void
61resizetitle(Client *c) 58resizetitle(Client *c) {
62{
63 c->tw = textw(c->name); 59 c->tw = textw(c->name);
64 if(c->tw > c->w) 60 if(c->tw > c->w)
65 c->tw = c->w + 2; 61 c->tw = c->w + 2;
@@ -69,27 +65,23 @@ resizetitle(Client *c)
69 XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th); 65 XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
70 else 66 else
71 XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th); 67 XMoveResizeWindow(dpy, c->twin, c->tx + 2 * sw, c->ty, c->tw, c->th);
72
73} 68}
74 69
75static int 70static int
76xerrordummy(Display *dsply, XErrorEvent *ee) 71xerrordummy(Display *dsply, XErrorEvent *ee) {
77{
78 return 0; 72 return 0;
79} 73}
80 74
81/* extern functions */ 75/* extern functions */
82 76
83void 77void
84ban(Client *c) 78ban(Client *c) {
85{
86 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 79 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
87 XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty); 80 XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
88} 81}
89 82
90void 83void
91focus(Client *c) 84focus(Client *c) {
92{
93 Client *old; 85 Client *old;
94 86
95 if(!issel) 87 if(!issel)
@@ -119,8 +111,7 @@ focus(Client *c)
119} 111}
120 112
121Client * 113Client *
122getclient(Window w) 114getclient(Window w) {
123{
124 Client *c; 115 Client *c;
125 116
126 for(c = clients; c; c = c->next) 117 for(c = clients; c; c = c->next)
@@ -130,8 +121,7 @@ getclient(Window w)
130} 121}
131 122
132Client * 123Client *
133getctitle(Window w) 124getctitle(Window w) {
134{
135 Client *c; 125 Client *c;
136 126
137 for(c = clients; c; c = c->next) 127 for(c = clients; c; c = c->next)
@@ -141,8 +131,7 @@ getctitle(Window w)
141} 131}
142 132
143void 133void
144gravitate(Client *c, Bool invert) 134gravitate(Client *c, Bool invert) {
145{
146 int dx = 0, dy = 0; 135 int dx = 0, dy = 0;
147 136
148 switch(c->grav) { 137 switch(c->grav) {
@@ -196,8 +185,7 @@ gravitate(Client *c, Bool invert)
196} 185}
197 186
198void 187void
199killclient(Arg *arg) 188killclient(Arg *arg) {
200{
201 if(!sel) 189 if(!sel)
202 return; 190 return;
203 if(sel->proto & PROTODELWIN) 191 if(sel->proto & PROTODELWIN)
@@ -207,8 +195,7 @@ killclient(Arg *arg)
207} 195}
208 196
209void 197void
210manage(Window w, XWindowAttributes *wa) 198manage(Window w, XWindowAttributes *wa) {
211{
212 Client *c; 199 Client *c;
213 Window trans; 200 Window trans;
214 XSetWindowAttributes twa; 201 XSetWindowAttributes twa;
@@ -270,8 +257,7 @@ manage(Window w, XWindowAttributes *wa)
270} 257}
271 258
272void 259void
273resize(Client *c, Bool sizehints, Corner sticky) 260resize(Client *c, Bool sizehints, Corner sticky) {
274{
275 int bottom = c->y + c->h; 261 int bottom = c->y + c->h;
276 int right = c->x + c->w; 262 int right = c->x + c->w;
277 XWindowChanges wc; 263 XWindowChanges wc;
@@ -309,8 +295,7 @@ resize(Client *c, Bool sizehints, Corner sticky)
309} 295}
310 296
311void 297void
312updatesize(Client *c) 298updatesize(Client *c) {
313{
314 long msize; 299 long msize;
315 XSizeHints size; 300 XSizeHints size;
316 301
@@ -348,8 +333,7 @@ updatesize(Client *c)
348} 333}
349 334
350void 335void
351updatetitle(Client *c) 336updatetitle(Client *c) {
352{
353 char **list = NULL; 337 char **list = NULL;
354 int n; 338 int n;
355 XTextProperty name; 339 XTextProperty name;
@@ -376,8 +360,7 @@ updatetitle(Client *c)
376} 360}
377 361
378void 362void
379togglemax(Arg *arg) 363togglemax(Arg *arg) {
380{
381 int ox, oy, ow, oh; 364 int ox, oy, ow, oh;
382 Client *c; 365 Client *c;
383 XEvent ev; 366 XEvent ev;
@@ -412,8 +395,7 @@ togglemax(Arg *arg)
412} 395}
413 396
414void 397void
415unmanage(Client *c) 398unmanage(Client *c) {
416{
417 Client *nc; 399 Client *nc;
418 400
419 XGrabServer(dpy); 401 XGrabServer(dpy);
diff --git a/draw.c b/draw.c
index b8b6c1d..e8ee08d 100644
--- a/draw.c
+++ b/draw.c
@@ -10,8 +10,7 @@
10/* static */ 10/* static */
11 11
12static unsigned int 12static unsigned int
13textnw(const char *text, unsigned int len) 13textnw(const char *text, unsigned int len) {
14{
15 XRectangle r; 14 XRectangle r;
16 15
17 if(dc.font.set) { 16 if(dc.font.set) {
@@ -22,8 +21,7 @@ textnw(const char *text, unsigned int len)
22} 21}
23 22
24static void 23static void
25drawtext(const char *text, unsigned long col[ColLast], Bool highlight) 24drawtext(const char *text, unsigned long col[ColLast], Bool highlight) {
26{
27 int x, y, w, h; 25 int x, y, w, h;
28 static char buf[256]; 26 static char buf[256];
29 unsigned int len, olen; 27 unsigned int len, olen;
@@ -82,8 +80,7 @@ drawtext(const char *text, unsigned long col[ColLast], Bool highlight)
82/* extern */ 80/* extern */
83 81
84void 82void
85drawall() 83drawall() {
86{
87 Client *c; 84 Client *c;
88 85
89 for(c = clients; c; c = getnext(c->next)) 86 for(c = clients; c; c = getnext(c->next))
@@ -92,8 +89,7 @@ drawall()
92} 89}
93 90
94void 91void
95drawstatus() 92drawstatus() {
96{
97 int i, x; 93 int i, x;
98 94
99 dc.x = dc.y = 0; 95 dc.x = dc.y = 0;
@@ -131,8 +127,7 @@ drawstatus()
131} 127}
132 128
133void 129void
134drawtitle(Client *c) 130drawtitle(Client *c) {
135{
136 if(c == sel && issel) { 131 if(c == sel && issel) {
137 drawstatus(); 132 drawstatus();
138 XUnmapWindow(dpy, c->twin); 133 XUnmapWindow(dpy, c->twin);
@@ -150,8 +145,7 @@ drawtitle(Client *c)
150} 145}
151 146
152unsigned long 147unsigned long
153getcolor(const char *colstr) 148getcolor(const char *colstr) {
154{
155 Colormap cmap = DefaultColormap(dpy, screen); 149 Colormap cmap = DefaultColormap(dpy, screen);
156 XColor color; 150 XColor color;
157 151
@@ -160,8 +154,7 @@ getcolor(const char *colstr)
160} 154}
161 155
162void 156void
163setfont(const char *fontstr) 157setfont(const char *fontstr) {
164{
165 char **missing, *def; 158 char **missing, *def;
166 int i, n; 159 int i, n;
167 160
@@ -211,7 +204,6 @@ setfont(const char *fontstr)
211} 204}
212 205
213unsigned int 206unsigned int
214textw(const char *text) 207textw(const char *text) {
215{
216 return textnw(text, strlen(text)) + dc.font.height; 208 return textnw(text, strlen(text)) + dc.font.height;
217} 209}
diff --git a/event.c b/event.c
index 74ae276..c59385d 100644
--- a/event.c
+++ b/event.c
@@ -21,8 +21,7 @@ KEYS
21#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) 21#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
22 22
23static void 23static void
24movemouse(Client *c) 24movemouse(Client *c) {
25{
26 int x1, y1, ocx, ocy, di; 25 int x1, y1, ocx, ocy, di;
27 unsigned int dui; 26 unsigned int dui;
28 Window dummy; 27 Window dummy;
@@ -37,7 +36,8 @@ movemouse(Client *c)
37 for(;;) { 36 for(;;) {
38 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); 37 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
39 switch (ev.type) { 38 switch (ev.type) {
40 default: break; 39 default:
40 break;
41 case Expose: 41 case Expose:
42 handler[Expose](&ev); 42 handler[Expose](&ev);
43 break; 43 break;
@@ -55,8 +55,7 @@ movemouse(Client *c)
55} 55}
56 56
57static void 57static void
58resizemouse(Client *c) 58resizemouse(Client *c) {
59{
60 int ocx, ocy; 59 int ocx, ocy;
61 int nw, nh; 60 int nw, nh;
62 Corner sticky; 61 Corner sticky;
@@ -71,7 +70,8 @@ resizemouse(Client *c)
71 for(;;) { 70 for(;;) {
72 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev); 71 XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
73 switch(ev.type) { 72 switch(ev.type) {
74 default: break; 73 default:
74 break;
75 case Expose: 75 case Expose:
76 handler[Expose](&ev); 76 handler[Expose](&ev);
77 break; 77 break;
@@ -97,8 +97,7 @@ resizemouse(Client *c)
97} 97}
98 98
99static void 99static void
100buttonpress(XEvent *e) 100buttonpress(XEvent *e) {
101{
102 int x; 101 int x;
103 Arg a; 102 Arg a;
104 Client *c; 103 Client *c;
@@ -147,8 +146,7 @@ buttonpress(XEvent *e)
147} 146}
148 147
149static void 148static void
150synconfig(Client *c, int x, int y, int w, int h, unsigned int border) 149synconfig(Client *c, int x, int y, int w, int h, unsigned int border) {
151{
152 XEvent synev; 150 XEvent synev;
153 151
154 synev.type = ConfigureNotify; 152 synev.type = ConfigureNotify;
@@ -165,8 +163,7 @@ synconfig(Client *c, int x, int y, int w, int h, unsigned int border)
165} 163}
166 164
167static void 165static void
168configurerequest(XEvent *e) 166configurerequest(XEvent *e) {
169{
170 unsigned long newmask; 167 unsigned long newmask;
171 Client *c; 168 Client *c;
172 XConfigureRequestEvent *ev = &e->xconfigurerequest; 169 XConfigureRequestEvent *ev = &e->xconfigurerequest;
@@ -219,8 +216,7 @@ configurerequest(XEvent *e)
219} 216}
220 217
221static void 218static void
222destroynotify(XEvent *e) 219destroynotify(XEvent *e) {
223{
224 Client *c; 220 Client *c;
225 XDestroyWindowEvent *ev = &e->xdestroywindow; 221 XDestroyWindowEvent *ev = &e->xdestroywindow;
226 222
@@ -229,8 +225,7 @@ destroynotify(XEvent *e)
229} 225}
230 226
231static void 227static void
232enternotify(XEvent *e) 228enternotify(XEvent *e) {
233{
234 Client *c; 229 Client *c;
235 XCrossingEvent *ev = &e->xcrossing; 230 XCrossingEvent *ev = &e->xcrossing;
236 231
@@ -247,8 +242,7 @@ enternotify(XEvent *e)
247} 242}
248 243
249static void 244static void
250expose(XEvent *e) 245expose(XEvent *e) {
251{
252 Client *c; 246 Client *c;
253 XExposeEvent *ev = &e->xexpose; 247 XExposeEvent *ev = &e->xexpose;
254 248
@@ -261,8 +255,7 @@ expose(XEvent *e)
261} 255}
262 256
263static void 257static void
264keypress(XEvent *e) 258keypress(XEvent *e) {
265{
266 static unsigned int len = sizeof(key) / sizeof(key[0]); 259 static unsigned int len = sizeof(key) / sizeof(key[0]);
267 unsigned int i; 260 unsigned int i;
268 KeySym keysym; 261 KeySym keysym;
@@ -270,8 +263,8 @@ keypress(XEvent *e)
270 263
271 keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); 264 keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
272 for(i = 0; i < len; i++) { 265 for(i = 0; i < len; i++) {
273 if(keysym == key[i].keysym && 266 if(keysym == key[i].keysym
274 CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) 267 && CLEANMASK(key[i].mod) == CLEANMASK(ev->state))
275 { 268 {
276 if(key[i].func) 269 if(key[i].func)
277 key[i].func(&key[i].arg); 270 key[i].func(&key[i].arg);
@@ -281,8 +274,7 @@ keypress(XEvent *e)
281} 274}
282 275
283static void 276static void
284leavenotify(XEvent *e) 277leavenotify(XEvent *e) {
285{
286 XCrossingEvent *ev = &e->xcrossing; 278 XCrossingEvent *ev = &e->xcrossing;
287 279
288 if((ev->window == root) && !ev->same_screen) { 280 if((ev->window == root) && !ev->same_screen) {
@@ -292,8 +284,7 @@ leavenotify(XEvent *e)
292} 284}
293 285
294static void 286static void
295mappingnotify(XEvent *e) 287mappingnotify(XEvent *e) {
296{
297 XMappingEvent *ev = &e->xmapping; 288 XMappingEvent *ev = &e->xmapping;
298 289
299 XRefreshKeyboardMapping(ev); 290 XRefreshKeyboardMapping(ev);
@@ -302,8 +293,7 @@ mappingnotify(XEvent *e)
302} 293}
303 294
304static void 295static void
305maprequest(XEvent *e) 296maprequest(XEvent *e) {
306{
307 static XWindowAttributes wa; 297 static XWindowAttributes wa;
308 XMapRequestEvent *ev = &e->xmaprequest; 298 XMapRequestEvent *ev = &e->xmaprequest;
309 299
@@ -321,8 +311,7 @@ maprequest(XEvent *e)
321} 311}
322 312
323static void 313static void
324propertynotify(XEvent *e) 314propertynotify(XEvent *e) {
325{
326 Client *c; 315 Client *c;
327 Window trans; 316 Window trans;
328 XPropertyEvent *ev = &e->xproperty; 317 XPropertyEvent *ev = &e->xproperty;
@@ -354,8 +343,7 @@ propertynotify(XEvent *e)
354} 343}
355 344
356static void 345static void
357unmapnotify(XEvent *e) 346unmapnotify(XEvent *e) {
358{
359 Client *c; 347 Client *c;
360 XUnmapEvent *ev = &e->xunmap; 348 XUnmapEvent *ev = &e->xunmap;
361 349
@@ -380,8 +368,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
380}; 368};
381 369
382void 370void
383grabkeys() 371grabkeys() {
384{
385 static unsigned int len = sizeof(key) / sizeof(key[0]); 372 static unsigned int len = sizeof(key) / sizeof(key[0]);
386 unsigned int i; 373 unsigned int i;
387 KeyCode code; 374 KeyCode code;
@@ -401,8 +388,7 @@ grabkeys()
401} 388}
402 389
403void 390void
404procevent() 391procevent() {
405{
406 XEvent ev; 392 XEvent ev;
407 393
408 while(XPending(dpy)) { 394 while(XPending(dpy)) {
@@ -411,4 +397,3 @@ procevent()
411 (handler[ev.type])(&ev); /* call handler */ 397 (handler[ev.type])(&ev); /* call handler */
412 } 398 }
413} 399}
414
diff --git a/main.c b/main.c
index f63a697..c6e67e9 100644
--- a/main.c
+++ b/main.c
@@ -39,8 +39,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *);
39static Bool otherwm, readin; 39static Bool otherwm, readin;
40 40
41static void 41static void
42cleanup() 42cleanup() {
43{
44 close(STDIN_FILENO); 43 close(STDIN_FILENO);
45 while(sel) { 44 while(sel) {
46 resize(sel, True, TopLeft); 45 resize(sel, True, TopLeft);
@@ -60,8 +59,7 @@ cleanup()
60} 59}
61 60
62static void 61static void
63scan() 62scan() {
64{
65 unsigned int i, num; 63 unsigned int i, num;
66 Window *wins, d1, d2; 64 Window *wins, d1, d2;
67 XWindowAttributes wa; 65 XWindowAttributes wa;
@@ -82,8 +80,7 @@ scan()
82} 80}
83 81
84static void 82static void
85setup() 83setup() {
86{
87 int i, j; 84 int i, j;
88 unsigned int mask; 85 unsigned int mask;
89 Window w; 86 Window w;
@@ -112,7 +109,8 @@ setup()
112 } 109 }
113 XFree(modmap); 110 XFree(modmap);
114 111
115 wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | EnterWindowMask | LeaveWindowMask; 112 wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
113 | EnterWindowMask | LeaveWindowMask;
116 wa.cursor = cursor[CurNormal]; 114 wa.cursor = cursor[CurNormal];
117 XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); 115 XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
118 116
@@ -163,8 +161,7 @@ setup()
163 * is already running. 161 * is already running.
164 */ 162 */
165static int 163static int
166xerrorstart(Display *dsply, XErrorEvent *ee) 164xerrorstart(Display *dsply, XErrorEvent *ee) {
167{
168 otherwm = True; 165 otherwm = True;
169 return -1; 166 return -1;
170} 167}
@@ -172,8 +169,7 @@ xerrorstart(Display *dsply, XErrorEvent *ee)
172/* extern */ 169/* extern */
173 170
174int 171int
175getproto(Window w) 172getproto(Window w) {
176{
177 int i, format, protos, status; 173 int i, format, protos, status;
178 unsigned long extra, res; 174 unsigned long extra, res;
179 Atom *protocols, real; 175 Atom *protocols, real;
@@ -191,8 +187,7 @@ getproto(Window w)
191} 187}
192 188
193void 189void
194sendevent(Window w, Atom a, long value) 190sendevent(Window w, Atom a, long value) {
195{
196 XEvent e; 191 XEvent e;
197 192
198 e.type = ClientMessage; 193 e.type = ClientMessage;
@@ -206,8 +201,7 @@ sendevent(Window w, Atom a, long value)
206} 201}
207 202
208void 203void
209quit(Arg *arg) 204quit(Arg *arg) {
210{
211 readin = running = False; 205 readin = running = False;
212} 206}
213 207
@@ -217,8 +211,7 @@ quit(Arg *arg)
217 * default error handler, which may call exit. 211 * default error handler, which may call exit.
218 */ 212 */
219int 213int
220xerror(Display *dpy, XErrorEvent *ee) 214xerror(Display *dpy, XErrorEvent *ee) {
221{
222 if(ee->error_code == BadWindow 215 if(ee->error_code == BadWindow
223 || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) 216 || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
224 || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) 217 || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable)
@@ -234,8 +227,7 @@ xerror(Display *dpy, XErrorEvent *ee)
234} 227}
235 228
236int 229int
237main(int argc, char *argv[]) 230main(int argc, char *argv[]) {
238{
239 int r, xfd; 231 int r, xfd;
240 fd_set rd; 232 fd_set rd;
241 233
diff --git a/tag.c b/tag.c
index fafc2c5..962b484 100644
--- a/tag.c
+++ b/tag.c
@@ -33,22 +33,19 @@ static unsigned int len = 0;
33/* extern */ 33/* extern */
34 34
35Client * 35Client *
36getnext(Client *c) 36getnext(Client *c) {
37{
38 for(; c && !isvisible(c); c = c->next); 37 for(; c && !isvisible(c); c = c->next);
39 return c; 38 return c;
40} 39}
41 40
42Client * 41Client *
43getprev(Client *c) 42getprev(Client *c) {
44{
45 for(; c && !isvisible(c); c = c->prev); 43 for(; c && !isvisible(c); c = c->prev);
46 return c; 44 return c;
47} 45}
48 46
49void 47void
50initrregs() 48initrregs() {
51{
52 unsigned int i; 49 unsigned int i;
53 regex_t *reg; 50 regex_t *reg;
54 51
@@ -76,8 +73,7 @@ initrregs()
76} 73}
77 74
78void 75void
79settags(Client *c, Client *trans) 76settags(Client *c, Client *trans) {
80{
81 char prop[512]; 77 char prop[512];
82 unsigned int i, j; 78 unsigned int i, j;
83 regmatch_t tmp; 79 regmatch_t tmp;
@@ -114,8 +110,7 @@ settags(Client *c, Client *trans)
114} 110}
115 111
116void 112void
117tag(Arg *arg) 113tag(Arg *arg) {
118{
119 unsigned int i; 114 unsigned int i;
120 115
121 if(!sel) 116 if(!sel)
@@ -129,8 +124,7 @@ tag(Arg *arg)
129} 124}
130 125
131void 126void
132toggletag(Arg *arg) 127toggletag(Arg *arg) {
133{
134 unsigned int i; 128 unsigned int i;
135 129
136 if(!sel) 130 if(!sel)
diff --git a/util.c b/util.c
index 91df00b..1147133 100644
--- a/util.c
+++ b/util.c
@@ -12,8 +12,7 @@
12/* extern */ 12/* extern */
13 13
14void * 14void *
15emallocz(unsigned int size) 15emallocz(unsigned int size) {
16{
17 void *res = calloc(1, size); 16 void *res = calloc(1, size);
18 17
19 if(!res) 18 if(!res)
@@ -22,8 +21,7 @@ emallocz(unsigned int size)
22} 21}
23 22
24void 23void
25eprint(const char *errstr, ...) 24eprint(const char *errstr, ...) {
26{
27 va_list ap; 25 va_list ap;
28 26
29 va_start(ap, errstr); 27 va_start(ap, errstr);
@@ -33,8 +31,7 @@ eprint(const char *errstr, ...)
33} 31}
34 32
35void * 33void *
36erealloc(void *ptr, unsigned int size) 34erealloc(void *ptr, unsigned int size) {
37{
38 void *res = realloc(ptr, size); 35 void *res = realloc(ptr, size);
39 if(!res) 36 if(!res)
40 eprint("fatal: could not malloc() %u bytes\n", size); 37 eprint("fatal: could not malloc() %u bytes\n", size);
@@ -42,8 +39,7 @@ erealloc(void *ptr, unsigned int size)
42} 39}
43 40
44void 41void
45spawn(Arg *arg) 42spawn(Arg *arg) {
46{
47 static char *shell = NULL; 43 static char *shell = NULL;
48 44
49 if(!shell && !(shell = getenv("SHELL"))) 45 if(!shell && !(shell = getenv("SHELL")))
diff --git a/view.c b/view.c
index 3e78661..1226f0d 100644
--- a/view.c
+++ b/view.c
@@ -8,8 +8,7 @@
8/* static */ 8/* static */
9 9
10static Client * 10static Client *
11minclient() 11minclient() {
12{
13 Client *c, *min; 12 Client *c, *min;
14 13
15 if((clients && clients->isfloat) || arrange == dofloat) 14 if((clients && clients->isfloat) || arrange == dofloat)
@@ -21,8 +20,7 @@ minclient()
21} 20}
22 21
23static void 22static void
24reorder() 23reorder() {
25{
26 Client *c, *newclients, *tail; 24 Client *c, *newclients, *tail;
27 25
28 newclients = tail = NULL; 26 newclients = tail = NULL;
@@ -40,8 +38,7 @@ reorder()
40} 38}
41 39
42static Client * 40static Client *
43nexttiled(Client *c) 41nexttiled(Client *c) {
44{
45 for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); 42 for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
46 return c; 43 return c;
47} 44}
@@ -51,8 +48,7 @@ nexttiled(Client *c)
51void (*arrange)(Arg *) = DEFMODE; 48void (*arrange)(Arg *) = DEFMODE;
52 49
53void 50void
54detach(Client *c) 51detach(Client *c) {
55{
56 if(c->prev) 52 if(c->prev)
57 c->prev->next = c->next; 53 c->prev->next = c->next;
58 if(c->next) 54 if(c->next)
@@ -63,8 +59,7 @@ detach(Client *c)
63} 59}
64 60
65void 61void
66dofloat(Arg *arg) 62dofloat(Arg *arg) {
67{
68 Client *c; 63 Client *c;
69 64
70 maximized = False; 65 maximized = False;
@@ -84,8 +79,7 @@ dofloat(Arg *arg)
84} 79}
85 80
86void 81void
87dotile(Arg *arg) 82dotile(Arg *arg) {
88{
89 int h, i, n, w; 83 int h, i, n, w;
90 Client *c; 84 Client *c;
91 85
@@ -148,8 +142,7 @@ dotile(Arg *arg)
148} 142}
149 143
150void 144void
151focusnext(Arg *arg) 145focusnext(Arg *arg) {
152{
153 Client *c; 146 Client *c;
154 147
155 if(!sel) 148 if(!sel)
@@ -164,8 +157,7 @@ focusnext(Arg *arg)
164} 157}
165 158
166void 159void
167focusprev(Arg *arg) 160focusprev(Arg *arg) {
168{
169 Client *c; 161 Client *c;
170 162
171 if(!sel) 163 if(!sel)
@@ -182,8 +174,7 @@ focusprev(Arg *arg)
182} 174}
183 175
184Bool 176Bool
185isvisible(Client *c) 177isvisible(Client *c) {
186{
187 unsigned int i; 178 unsigned int i;
188 179
189 for(i = 0; i < ntags; i++) 180 for(i = 0; i < ntags; i++)
@@ -193,8 +184,7 @@ isvisible(Client *c)
193} 184}
194 185
195void 186void
196resizecol(Arg *arg) 187resizecol(Arg *arg) {
197{
198 unsigned int n; 188 unsigned int n;
199 Client *c; 189 Client *c;
200 190
@@ -218,8 +208,7 @@ resizecol(Arg *arg)
218} 208}
219 209
220void 210void
221restack() 211restack() {
222{
223 Client *c; 212 Client *c;
224 XEvent ev; 213 XEvent ev;
225 214
@@ -242,8 +231,7 @@ restack()
242} 231}
243 232
244void 233void
245togglemode(Arg *arg) 234togglemode(Arg *arg) {
246{
247 arrange = (arrange == dofloat) ? dotile : dofloat; 235 arrange = (arrange == dofloat) ? dotile : dofloat;
248 if(sel) 236 if(sel)
249 arrange(NULL); 237 arrange(NULL);
@@ -252,8 +240,7 @@ togglemode(Arg *arg)
252} 240}
253 241
254void 242void
255toggleview(Arg *arg) 243toggleview(Arg *arg) {
256{
257 unsigned int i; 244 unsigned int i;
258 245
259 seltag[arg->i] = !seltag[arg->i]; 246 seltag[arg->i] = !seltag[arg->i];
@@ -265,8 +252,7 @@ toggleview(Arg *arg)
265} 252}
266 253
267void 254void
268view(Arg *arg) 255view(Arg *arg) {
269{
270 unsigned int i; 256 unsigned int i;
271 257
272 for(i = 0; i < ntags; i++) 258 for(i = 0; i < ntags; i++)
@@ -277,8 +263,7 @@ view(Arg *arg)
277} 263}
278 264
279void 265void
280viewall(Arg *arg) 266viewall(Arg *arg) {
281{
282 unsigned int i; 267 unsigned int i;
283 268
284 for(i = 0; i < ntags; i++) 269 for(i = 0; i < ntags; i++)
@@ -288,8 +273,7 @@ viewall(Arg *arg)
288} 273}
289 274
290void 275void
291zoom(Arg *arg) 276zoom(Arg *arg) {
292{
293 unsigned int n; 277 unsigned int n;
294 Client *c; 278 Client *c;
295 279