diff options
| -rw-r--r-- | dwm.c | 64 |
1 files changed, 32 insertions, 32 deletions
| @@ -94,8 +94,8 @@ typedef struct { | |||
| 94 | typedef struct { | 94 | typedef struct { |
| 95 | unsigned long mod; | 95 | unsigned long mod; |
| 96 | KeySym keysym; | 96 | KeySym keysym; |
| 97 | void (*func)(void *arg); | 97 | void (*func)(const void *arg); |
| 98 | void *arg; | 98 | const void *arg; |
| 99 | } Key; | 99 | } Key; |
| 100 | 100 | ||
| 101 | typedef struct { | 101 | typedef struct { |
| @@ -136,8 +136,8 @@ void eprint(const char *errstr, ...); | |||
| 136 | void expose(XEvent *e); | 136 | void expose(XEvent *e); |
| 137 | void focus(Client *c); | 137 | void focus(Client *c); |
| 138 | void focusin(XEvent *e); | 138 | void focusin(XEvent *e); |
| 139 | void focusnext(void *arg); | 139 | void focusnext(const void *arg); |
| 140 | void focusprev(void *arg); | 140 | void focusprev(const void *arg); |
| 141 | Client *getclient(Window w); | 141 | Client *getclient(Window w); |
| 142 | unsigned long getcolor(const char *colstr); | 142 | unsigned long getcolor(const char *colstr); |
| 143 | long getstate(Window w); | 143 | long getstate(Window w); |
| @@ -150,33 +150,33 @@ Bool isprotodel(Client *c); | |||
| 150 | Bool isurgent(unsigned int t); | 150 | Bool isurgent(unsigned int t); |
| 151 | Bool isvisible(Client *c); | 151 | Bool isvisible(Client *c); |
| 152 | void keypress(XEvent *e); | 152 | void keypress(XEvent *e); |
| 153 | void killclient(void *arg); | 153 | void killclient(const void *arg); |
| 154 | void manage(Window w, XWindowAttributes *wa); | 154 | void manage(Window w, XWindowAttributes *wa); |
| 155 | void mappingnotify(XEvent *e); | 155 | void mappingnotify(XEvent *e); |
| 156 | void maprequest(XEvent *e); | 156 | void maprequest(XEvent *e); |
| 157 | void movemouse(Client *c); | 157 | void movemouse(Client *c); |
| 158 | Client *nextunfloating(Client *c); | 158 | Client *nextunfloating(Client *c); |
| 159 | void propertynotify(XEvent *e); | 159 | void propertynotify(XEvent *e); |
| 160 | void quit(void *arg); | 160 | void quit(const void *arg); |
| 161 | void resize(Client *c, int x, int y, int w, int h, Bool sizehints); | 161 | void resize(Client *c, int x, int y, int w, int h, Bool sizehints); |
| 162 | void resizemouse(Client *c); | 162 | void resizemouse(Client *c); |
| 163 | void restack(void); | 163 | void restack(void); |
| 164 | void run(void); | 164 | void run(void); |
| 165 | void scan(void); | 165 | void scan(void); |
| 166 | void setclientstate(Client *c, long state); | 166 | void setclientstate(Client *c, long state); |
| 167 | void setmfact(void *arg); | 167 | void setmfact(const void *arg); |
| 168 | void setup(void); | 168 | void setup(void); |
| 169 | void spawn(void *arg); | 169 | void spawn(const void *arg); |
| 170 | void tag(void *arg); | 170 | void tag(const void *arg); |
| 171 | unsigned int textnw(const char *text, unsigned int len); | 171 | unsigned int textnw(const char *text, unsigned int len); |
| 172 | unsigned int textw(const char *text); | 172 | unsigned int textw(const char *text); |
| 173 | void tile(void); | 173 | void tile(void); |
| 174 | void tileresize(Client *c, int x, int y, int w, int h); | 174 | void tileresize(Client *c, int x, int y, int w, int h); |
| 175 | void togglebar(void *arg); | 175 | void togglebar(const void *arg); |
| 176 | void togglefloating(void *arg); | 176 | void togglefloating(const void *arg); |
| 177 | void togglelayout(void *arg); | 177 | void togglelayout(const void *arg); |
| 178 | void toggletag(void *arg); | 178 | void toggletag(const void *arg); |
| 179 | void toggleview(void *arg); | 179 | void toggleview(const void *arg); |
| 180 | void unban(Client *c); | 180 | void unban(Client *c); |
| 181 | void unmanage(Client *c); | 181 | void unmanage(Client *c); |
| 182 | void unmapnotify(XEvent *e); | 182 | void unmapnotify(XEvent *e); |
| @@ -186,12 +186,12 @@ void updatesizehints(Client *c); | |||
| 186 | void updatetilegeom(void); | 186 | void updatetilegeom(void); |
| 187 | void updatetitle(Client *c); | 187 | void updatetitle(Client *c); |
| 188 | void updatewmhints(Client *c); | 188 | void updatewmhints(Client *c); |
| 189 | void view(void *arg); | 189 | void view(const void *arg); |
| 190 | void viewprevtag(void *arg); | 190 | void viewprevtag(const void *arg); |
| 191 | int xerror(Display *dpy, XErrorEvent *ee); | 191 | int xerror(Display *dpy, XErrorEvent *ee); |
| 192 | int xerrordummy(Display *dpy, XErrorEvent *ee); | 192 | int xerrordummy(Display *dpy, XErrorEvent *ee); |
| 193 | int xerrorstart(Display *dpy, XErrorEvent *ee); | 193 | int xerrorstart(Display *dpy, XErrorEvent *ee); |
| 194 | void zoom(void *arg); | 194 | void zoom(const void *arg); |
| 195 | 195 | ||
| 196 | /* variables */ | 196 | /* variables */ |
| 197 | char stext[256]; | 197 | char stext[256]; |
| @@ -667,7 +667,7 @@ focusin(XEvent *e) { /* there are some broken focus acquiring clients */ | |||
| 667 | } | 667 | } |
| 668 | 668 | ||
| 669 | void | 669 | void |
| 670 | focusnext(void *arg) { | 670 | focusnext(const void *arg) { |
| 671 | Client *c; | 671 | Client *c; |
| 672 | 672 | ||
| 673 | if(!sel) | 673 | if(!sel) |
| @@ -682,7 +682,7 @@ focusnext(void *arg) { | |||
| 682 | } | 682 | } |
| 683 | 683 | ||
| 684 | void | 684 | void |
| 685 | focusprev(void *arg) { | 685 | focusprev(const void *arg) { |
| 686 | Client *c; | 686 | Client *c; |
| 687 | 687 | ||
| 688 | if(!sel) | 688 | if(!sel) |
| @@ -905,7 +905,7 @@ keypress(XEvent *e) { | |||
| 905 | } | 905 | } |
| 906 | 906 | ||
| 907 | void | 907 | void |
| 908 | killclient(void *arg) { | 908 | killclient(const void *arg) { |
| 909 | XEvent ev; | 909 | XEvent ev; |
| 910 | 910 | ||
| 911 | if(!sel) | 911 | if(!sel) |
| @@ -1088,7 +1088,7 @@ propertynotify(XEvent *e) { | |||
| 1088 | } | 1088 | } |
| 1089 | 1089 | ||
| 1090 | void | 1090 | void |
| 1091 | quit(void *arg) { | 1091 | quit(const void *arg) { |
| 1092 | readin = running = False; | 1092 | readin = running = False; |
| 1093 | } | 1093 | } |
| 1094 | 1094 | ||
| @@ -1321,7 +1321,7 @@ setclientstate(Client *c, long state) { | |||
| 1321 | 1321 | ||
| 1322 | /* arg > 1.0 will set mfact absolutly */ | 1322 | /* arg > 1.0 will set mfact absolutly */ |
| 1323 | void | 1323 | void |
| 1324 | setmfact(void *arg) { | 1324 | setmfact(const void *arg) { |
| 1325 | double d = *((double*) arg); | 1325 | double d = *((double*) arg); |
| 1326 | 1326 | ||
| 1327 | if(!d || lt->arrange != tile) | 1327 | if(!d || lt->arrange != tile) |
| @@ -1412,7 +1412,7 @@ setup(void) { | |||
| 1412 | } | 1412 | } |
| 1413 | 1413 | ||
| 1414 | void | 1414 | void |
| 1415 | spawn(void *arg) { | 1415 | spawn(const void *arg) { |
| 1416 | static char *shell = NULL; | 1416 | static char *shell = NULL; |
| 1417 | 1417 | ||
| 1418 | if(!shell && !(shell = getenv("SHELL"))) | 1418 | if(!shell && !(shell = getenv("SHELL"))) |
| @@ -1434,7 +1434,7 @@ spawn(void *arg) { | |||
| 1434 | } | 1434 | } |
| 1435 | 1435 | ||
| 1436 | void | 1436 | void |
| 1437 | tag(void *arg) { | 1437 | tag(const void *arg) { |
| 1438 | if(sel && *(int *)arg & TAGMASK) { | 1438 | if(sel && *(int *)arg & TAGMASK) { |
| 1439 | sel->tags = *(int *)arg & TAGMASK; | 1439 | sel->tags = *(int *)arg & TAGMASK; |
| 1440 | arrange(); | 1440 | arrange(); |
| @@ -1505,7 +1505,7 @@ tileresize(Client *c, int x, int y, int w, int h) { | |||
| 1505 | } | 1505 | } |
| 1506 | 1506 | ||
| 1507 | void | 1507 | void |
| 1508 | togglebar(void *arg) { | 1508 | togglebar(const void *arg) { |
| 1509 | showbar = !showbar; | 1509 | showbar = !showbar; |
| 1510 | updategeom(); | 1510 | updategeom(); |
| 1511 | updatebar(); | 1511 | updatebar(); |
| @@ -1513,7 +1513,7 @@ togglebar(void *arg) { | |||
| 1513 | } | 1513 | } |
| 1514 | 1514 | ||
| 1515 | void | 1515 | void |
| 1516 | togglefloating(void *arg) { | 1516 | togglefloating(const void *arg) { |
| 1517 | if(!sel) | 1517 | if(!sel) |
| 1518 | return; | 1518 | return; |
| 1519 | sel->isfloating = !sel->isfloating; | 1519 | sel->isfloating = !sel->isfloating; |
| @@ -1523,7 +1523,7 @@ togglefloating(void *arg) { | |||
| 1523 | } | 1523 | } |
| 1524 | 1524 | ||
| 1525 | void | 1525 | void |
| 1526 | togglelayout(void *arg) { | 1526 | togglelayout(const void *arg) { |
| 1527 | unsigned int i; | 1527 | unsigned int i; |
| 1528 | 1528 | ||
| 1529 | if(!arg) { | 1529 | if(!arg) { |
| @@ -1545,7 +1545,7 @@ togglelayout(void *arg) { | |||
| 1545 | } | 1545 | } |
| 1546 | 1546 | ||
| 1547 | void | 1547 | void |
| 1548 | toggletag(void *arg) { | 1548 | toggletag(const void *arg) { |
| 1549 | int i, m = *(int *)arg; | 1549 | int i, m = *(int *)arg; |
| 1550 | for(i = 0; i < sizeof(int) * 8; i++) | 1550 | for(i = 0; i < sizeof(int) * 8; i++) |
| 1551 | fputc(m & 1 << i ? '1' : '0', stdout); | 1551 | fputc(m & 1 << i ? '1' : '0', stdout); |
| @@ -1561,7 +1561,7 @@ toggletag(void *arg) { | |||
| 1561 | } | 1561 | } |
| 1562 | 1562 | ||
| 1563 | void | 1563 | void |
| 1564 | toggleview(void *arg) { | 1564 | toggleview(const void *arg) { |
| 1565 | if((tagset[seltags] ^ ((*(int *)arg) & TAGMASK))) { | 1565 | if((tagset[seltags] ^ ((*(int *)arg) & TAGMASK))) { |
| 1566 | tagset[seltags] ^= (*(int *)arg) & TAGMASK; | 1566 | tagset[seltags] ^= (*(int *)arg) & TAGMASK; |
| 1567 | arrange(); | 1567 | arrange(); |
| @@ -1737,7 +1737,7 @@ updatewmhints(Client *c) { | |||
| 1737 | } | 1737 | } |
| 1738 | 1738 | ||
| 1739 | void | 1739 | void |
| 1740 | view(void *arg) { | 1740 | view(const void *arg) { |
| 1741 | if(*(int *)arg & TAGMASK) { | 1741 | if(*(int *)arg & TAGMASK) { |
| 1742 | seltags ^= 1; /* toggle sel tagset */ | 1742 | seltags ^= 1; /* toggle sel tagset */ |
| 1743 | tagset[seltags] = *(int *)arg & TAGMASK; | 1743 | tagset[seltags] = *(int *)arg & TAGMASK; |
| @@ -1746,7 +1746,7 @@ view(void *arg) { | |||
| 1746 | } | 1746 | } |
| 1747 | 1747 | ||
| 1748 | void | 1748 | void |
| 1749 | viewprevtag(void *arg) { | 1749 | viewprevtag(const void *arg) { |
| 1750 | seltags ^= 1; /* toggle sel tagset */ | 1750 | seltags ^= 1; /* toggle sel tagset */ |
| 1751 | arrange(); | 1751 | arrange(); |
| 1752 | } | 1752 | } |
| @@ -1785,7 +1785,7 @@ xerrorstart(Display *dpy, XErrorEvent *ee) { | |||
| 1785 | } | 1785 | } |
| 1786 | 1786 | ||
| 1787 | void | 1787 | void |
| 1788 | zoom(void *arg) { | 1788 | zoom(const void *arg) { |
| 1789 | Client *c = sel; | 1789 | Client *c = sel; |
| 1790 | 1790 | ||
| 1791 | if(c == nextunfloating(clients)) | 1791 | if(c == nextunfloating(clients)) |
