summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-05-22 11:10:08 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-05-22 11:10:08 +0100
commitc3fa9e879f5beb5d3c37f4bbcae2306942929f13 (patch)
treeb17225b109236794be7e065ec13c3a72b361e9a8 /dwm.c
parents/void */const void */ (diff)
downloaddwm-c3fa9e879f5beb5d3c37f4bbcae2306942929f13.tar.gz
dwm-c3fa9e879f5beb5d3c37f4bbcae2306942929f13.zip
s/unsigned int/uint/
Diffstat (limited to '')
-rw-r--r--dwm.c67
1 files changed, 34 insertions, 33 deletions
diff --git a/dwm.c b/dwm.c
index 1f4b881..5138752 100644
--- a/dwm.c
+++ b/dwm.c
@@ -60,6 +60,7 @@ enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
60enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */ 60enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
61 61
62/* typedefs */ 62/* typedefs */
63typedef unsigned int uint;
63typedef struct Client Client; 64typedef struct Client Client;
64struct Client { 65struct Client {
65 char name[256]; 66 char name[256];
@@ -67,9 +68,9 @@ struct Client {
67 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 68 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
68 int minax, maxax, minay, maxay; 69 int minax, maxax, minay, maxay;
69 long flags; 70 long flags;
70 unsigned int bw, oldbw; 71 uint bw, oldbw;
71 Bool isbanned, isfixed, isfloating, isurgent; 72 Bool isbanned, isfixed, isfloating, isurgent;
72 unsigned int tags; 73 uint tags;
73 Client *next; 74 Client *next;
74 Client *prev; 75 Client *prev;
75 Client *snext; 76 Client *snext;
@@ -108,7 +109,7 @@ typedef struct {
108 const char *class; 109 const char *class;
109 const char *instance; 110 const char *instance;
110 const char *title; 111 const char *title;
111 unsigned int tags; 112 uint tags;
112 Bool isfloating; 113 Bool isfloating;
113} Rule; 114} Rule;
114 115
@@ -130,7 +131,7 @@ void detachstack(Client *c);
130void drawbar(void); 131void drawbar(void);
131void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]); 132void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
132void drawtext(const char *text, unsigned long col[ColLast], Bool invert); 133void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
133void *emallocz(unsigned int size); 134void *emallocz(uint size);
134void enternotify(XEvent *e); 135void enternotify(XEvent *e);
135void eprint(const char *errstr, ...); 136void eprint(const char *errstr, ...);
136void expose(XEvent *e); 137void expose(XEvent *e);
@@ -141,13 +142,13 @@ void focusprev(const void *arg);
141Client *getclient(Window w); 142Client *getclient(Window w);
142unsigned long getcolor(const char *colstr); 143unsigned long getcolor(const char *colstr);
143long getstate(Window w); 144long getstate(Window w);
144Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); 145Bool gettextprop(Window w, Atom atom, char *text, uint size);
145void grabbuttons(Client *c, Bool focused); 146void grabbuttons(Client *c, Bool focused);
146void grabkeys(void); 147void grabkeys(void);
147void initfont(const char *fontstr); 148void initfont(const char *fontstr);
148Bool isoccupied(unsigned int t); 149Bool isoccupied(uint t);
149Bool isprotodel(Client *c); 150Bool isprotodel(Client *c);
150Bool isurgent(unsigned int t); 151Bool isurgent(uint t);
151Bool isvisible(Client *c); 152Bool isvisible(Client *c);
152void keypress(XEvent *e); 153void keypress(XEvent *e);
153void killclient(const void *arg); 154void killclient(const void *arg);
@@ -168,8 +169,8 @@ void setmfact(const void *arg);
168void setup(void); 169void setup(void);
169void spawn(const void *arg); 170void spawn(const void *arg);
170void tag(const void *arg); 171void tag(const void *arg);
171unsigned int textnw(const char *text, unsigned int len); 172uint textnw(const char *text, uint len);
172unsigned int textw(const char *text); 173uint textw(const char *text);
173void tile(void); 174void tile(void);
174void tileresize(Client *c, int x, int y, int w, int h); 175void tileresize(Client *c, int x, int y, int w, int h);
175void togglebar(const void *arg); 176void togglebar(const void *arg);
@@ -198,9 +199,9 @@ char stext[256];
198int screen, sx, sy, sw, sh; 199int screen, sx, sy, sw, sh;
199int bx, by, bw, bh, blw, wx, wy, ww, wh; 200int bx, by, bw, bh, blw, wx, wy, ww, wh;
200int mx, my, mw, mh, tx, ty, tw, th; 201int mx, my, mw, mh, tx, ty, tw, th;
201unsigned int seltags = 0; 202uint seltags = 0;
202int (*xerrorxlib)(Display *, XErrorEvent *); 203int (*xerrorxlib)(Display *, XErrorEvent *);
203unsigned int numlockmask = 0; 204uint numlockmask = 0;
204void (*handler[LASTEvent]) (XEvent *) = { 205void (*handler[LASTEvent]) (XEvent *) = {
205 [ButtonPress] = buttonpress, 206 [ButtonPress] = buttonpress,
206 [ConfigureRequest] = configurerequest, 207 [ConfigureRequest] = configurerequest,
@@ -218,7 +219,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
218Atom wmatom[WMLast], netatom[NetLast]; 219Atom wmatom[WMLast], netatom[NetLast];
219Bool otherwm, readin; 220Bool otherwm, readin;
220Bool running = True; 221Bool running = True;
221unsigned int tagset[] = {1, 1}; /* after start, first tag is selected */ 222uint tagset[] = {1, 1}; /* after start, first tag is selected */
222Client *clients = NULL; 223Client *clients = NULL;
223Client *sel = NULL; 224Client *sel = NULL;
224Client *stack = NULL; 225Client *stack = NULL;
@@ -232,14 +233,14 @@ Window root, barwin;
232/* configuration, allows nested code to access above variables */ 233/* configuration, allows nested code to access above variables */
233#include "config.h" 234#include "config.h"
234 235
235/* check if all tags will fit into a unsigned int bitarray. */ 236/* check if all tags will fit into a uint bitarray. */
236static char tags_is_a_sign_that_your_IQ[sizeof(int) * 8 < LENGTH(tags) ? -1 : 1]; 237static char tags_is_a_sign_that_your_IQ[sizeof(int) * 8 < LENGTH(tags) ? -1 : 1];
237 238
238/* function implementations */ 239/* function implementations */
239 240
240void 241void
241applyrules(Client *c) { 242applyrules(Client *c) {
242 unsigned int i; 243 uint i;
243 Rule *r; 244 Rule *r;
244 XClassHint ch = { 0 }; 245 XClassHint ch = { 0 };
245 246
@@ -305,7 +306,7 @@ ban(Client *c) {
305 306
306void 307void
307buttonpress(XEvent *e) { 308buttonpress(XEvent *e) {
308 unsigned int i, x, mask; 309 uint i, x, mask;
309 Client *c; 310 Client *c;
310 XButtonPressedEvent *ev = &e->xbutton; 311 XButtonPressedEvent *ev = &e->xbutton;
311 312
@@ -561,7 +562,7 @@ drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
561void 562void
562drawtext(const char *text, unsigned long col[ColLast], Bool invert) { 563drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
563 int x, y, w, h; 564 int x, y, w, h;
564 unsigned int len, olen; 565 uint len, olen;
565 XRectangle r = { dc.x, dc.y, dc.w, dc.h }; 566 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
566 char buf[256]; 567 char buf[256];
567 568
@@ -596,7 +597,7 @@ drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
596} 597}
597 598
598void * 599void *
599emallocz(unsigned int size) { 600emallocz(uint size) {
600 void *res = calloc(1, size); 601 void *res = calloc(1, size);
601 602
602 if(!res) 603 if(!res)
@@ -735,7 +736,7 @@ getstate(Window w) {
735} 736}
736 737
737Bool 738Bool
738gettextprop(Window w, Atom atom, char *text, unsigned int size) { 739gettextprop(Window w, Atom atom, char *text, uint size) {
739 char **list = NULL; 740 char **list = NULL;
740 int n; 741 int n;
741 XTextProperty name; 742 XTextProperty name;
@@ -763,8 +764,8 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) {
763void 764void
764grabbuttons(Client *c, Bool focused) { 765grabbuttons(Client *c, Bool focused) {
765 int i, j; 766 int i, j;
766 unsigned int buttons[] = { Button1, Button2, Button3 }; 767 uint buttons[] = { Button1, Button2, Button3 };
767 unsigned int modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask, 768 uint modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask,
768 MODKEY|numlockmask|LockMask} ; 769 MODKEY|numlockmask|LockMask} ;
769 770
770 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 771 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
@@ -780,7 +781,7 @@ grabbuttons(Client *c, Bool focused) {
780 781
781void 782void
782grabkeys(void) { 783grabkeys(void) {
783 unsigned int i, j; 784 uint i, j;
784 KeyCode code; 785 KeyCode code;
785 XModifierKeymap *modmap; 786 XModifierKeymap *modmap;
786 787
@@ -848,7 +849,7 @@ initfont(const char *fontstr) {
848} 849}
849 850
850Bool 851Bool
851isoccupied(unsigned int t) { 852isoccupied(uint t) {
852 Client *c; 853 Client *c;
853 854
854 for(c = clients; c; c = c->next) 855 for(c = clients; c; c = c->next)
@@ -873,7 +874,7 @@ isprotodel(Client *c) {
873} 874}
874 875
875Bool 876Bool
876isurgent(unsigned int t) { 877isurgent(uint t) {
877 Client *c; 878 Client *c;
878 879
879 for(c = clients; c; c = c->next) 880 for(c = clients; c; c = c->next)
@@ -889,7 +890,7 @@ isvisible(Client *c) {
889 890
890void 891void
891keypress(XEvent *e) { 892keypress(XEvent *e) {
892 unsigned int i; 893 uint i;
893 KeySym keysym; 894 KeySym keysym;
894 XKeyEvent *ev; 895 XKeyEvent *ev;
895 896
@@ -1004,7 +1005,7 @@ maprequest(XEvent *e) {
1004void 1005void
1005movemouse(Client *c) { 1006movemouse(Client *c) {
1006 int x1, y1, ocx, ocy, di, nx, ny; 1007 int x1, y1, ocx, ocy, di, nx, ny;
1007 unsigned int dui; 1008 uint dui;
1008 Window dummy; 1009 Window dummy;
1009 XEvent ev; 1010 XEvent ev;
1010 1011
@@ -1230,7 +1231,7 @@ run(void) {
1230 char sbuf[sizeof stext]; 1231 char sbuf[sizeof stext];
1231 fd_set rd; 1232 fd_set rd;
1232 int r, xfd; 1233 int r, xfd;
1233 unsigned int len, offset; 1234 uint len, offset;
1234 XEvent ev; 1235 XEvent ev;
1235 1236
1236 /* main event loop, also reads status text from stdin */ 1237 /* main event loop, also reads status text from stdin */
@@ -1286,7 +1287,7 @@ run(void) {
1286 1287
1287void 1288void
1288scan(void) { 1289scan(void) {
1289 unsigned int i, num; 1290 uint i, num;
1290 Window *wins, d1, d2; 1291 Window *wins, d1, d2;
1291 XWindowAttributes wa; 1292 XWindowAttributes wa;
1292 1293
@@ -1336,7 +1337,7 @@ setmfact(const void *arg) {
1336 1337
1337void 1338void
1338setup(void) { 1339setup(void) {
1339 unsigned int i, w; 1340 uint i, w;
1340 XSetWindowAttributes wa; 1341 XSetWindowAttributes wa;
1341 1342
1342 /* init screen */ 1343 /* init screen */
@@ -1441,8 +1442,8 @@ tag(const void *arg) {
1441 } 1442 }
1442} 1443}
1443 1444
1444unsigned int 1445uint
1445textnw(const char *text, unsigned int len) { 1446textnw(const char *text, uint len) {
1446 XRectangle r; 1447 XRectangle r;
1447 1448
1448 if(dc.font.set) { 1449 if(dc.font.set) {
@@ -1452,7 +1453,7 @@ textnw(const char *text, unsigned int len) {
1452 return XTextWidth(dc.font.xfont, text, len); 1453 return XTextWidth(dc.font.xfont, text, len);
1453} 1454}
1454 1455
1455unsigned int 1456uint
1456textw(const char *text) { 1457textw(const char *text) {
1457 return textnw(text, strlen(text)) + dc.font.height; 1458 return textnw(text, strlen(text)) + dc.font.height;
1458} 1459}
@@ -1460,7 +1461,7 @@ textw(const char *text) {
1460void 1461void
1461tile(void) { 1462tile(void) {
1462 int x, y, h, w; 1463 int x, y, h, w;
1463 unsigned int i, n; 1464 uint i, n;
1464 Client *c; 1465 Client *c;
1465 1466
1466 for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++); 1467 for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++);
@@ -1524,7 +1525,7 @@ togglefloating(const void *arg) {
1524 1525
1525void 1526void
1526togglelayout(const void *arg) { 1527togglelayout(const void *arg) {
1527 unsigned int i; 1528 uint i;
1528 1529
1529 if(!arg) { 1530 if(!arg) {
1530 if(++lt == &layouts[LENGTH(layouts)]) 1531 if(++lt == &layouts[LENGTH(layouts)])