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