introducing const where it might make some sense
1724f7fa
2 file(s) · +13 −14
| 1 | 1 | /* See LICENSE file for copyright and license details. */ |
|
| 2 | 2 | ||
| 3 | 3 | /* appearance */ |
|
| 4 | - | #define SHOWBAR True /* False means no bar */ |
|
| 5 | - | #define TOPBAR True /* False means bottom bar */ |
|
| 6 | 4 | static const char font[] = "-*-*-medium-*-*-*-14-*-*-*-*-*-*-*"; |
|
| 7 | 5 | static const char normbordercolor[] = "#cccccc"; |
|
| 8 | 6 | static const char normbgcolor[] = "#cccccc"; |
|
| 10 | 8 | static const char selbordercolor[] = "#0066ff"; |
|
| 11 | 9 | static const char selbgcolor[] = "#0066ff"; |
|
| 12 | 10 | static const char selfgcolor[] = "#ffffff"; |
|
| 13 | - | static unsigned int borderpx = 1; /* border pixel of windows */ |
|
| 14 | - | static unsigned int snap = 32; /* snap pixel */ |
|
| 11 | + | static const unsigned int borderpx = 1; /* border pixel of windows */ |
|
| 12 | + | static const unsigned int snap = 32; /* snap pixel */ |
|
| 13 | + | static const Bool showbar = True; /* False means no bar */ |
|
| 14 | + | static const Bool topbar = True; /* False means bottom bar */ |
|
| 15 | 15 | ||
| 16 | 16 | /* monitor(s) symbols */ |
|
| 17 | 17 | static const char *monsyms[] = { "<1>", "<2>", "<3>", "<4>", "<5>" }; |
|
| 19 | 19 | /* tagging */ |
|
| 20 | 20 | static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; |
|
| 21 | 21 | ||
| 22 | - | static Rule rules[] = { |
|
| 22 | + | static const Rule rules[] = { |
|
| 23 | 23 | /* class instance title tags mask isfloating */ |
|
| 24 | 24 | { "Gimp", NULL, NULL, 0, True }, |
|
| 25 | 25 | { "Firefox", NULL, NULL, 1 << 8, False }, |
|
| 26 | - | ||
| 27 | 26 | }; |
|
| 28 | 27 | ||
| 29 | 28 | /* layout(s) */ |
|
| 30 | - | static float mfact = 0.55; /* factor of master area size [0.05..0.95] */ |
|
| 31 | - | static Bool resizehints = True; /* False means respect size hints in tiled resizals */ |
|
| 29 | + | static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ |
|
| 30 | + | static const Bool resizehints = True; /* False means respect size hints in tiled resizals */ |
|
| 32 | 31 | ||
| 33 | - | static Layout layouts[] = { |
|
| 32 | + | static const Layout layouts[] = { |
|
| 34 | 33 | /* symbol arrange function */ |
|
| 35 | 34 | { "[]=", tile }, /* first entry is default */ |
|
| 36 | 35 | { "><>", NULL }, /* no layout function means floating behavior */ |
|
| 66 | 66 | int i; |
|
| 67 | 67 | unsigned int ui; |
|
| 68 | 68 | float f; |
|
| 69 | - | void *v; |
|
| 69 | + | const void *v; |
|
| 70 | 70 | } Arg; |
|
| 71 | 71 | ||
| 72 | 72 | typedef struct { |
|
| 136 | 136 | Client *stack; |
|
| 137 | 137 | Monitor *next; |
|
| 138 | 138 | Window barwin; |
|
| 139 | - | Layout *lt[2]; |
|
| 139 | + | const Layout *lt[2]; |
|
| 140 | 140 | }; |
|
| 141 | 141 | ||
| 142 | 142 | typedef struct { |
|
| 275 | 275 | void |
|
| 276 | 276 | applyrules(Client *c) { |
|
| 277 | 277 | unsigned int i; |
|
| 278 | - | Rule *r; |
|
| 278 | + | const Rule *r; |
|
| 279 | 279 | XClassHint ch = { 0 }; |
|
| 280 | 280 | ||
| 281 | 281 | /* rule matching */ |
|
| 1726 | 1726 | m->sellt = 0; |
|
| 1727 | 1727 | m->tagset[0] = m->tagset[1] = 1; |
|
| 1728 | 1728 | m->mfact = mfact; |
|
| 1729 | - | m->showbar = SHOWBAR; |
|
| 1730 | - | m->topbar = TOPBAR; |
|
| 1729 | + | m->showbar = showbar; |
|
| 1730 | + | m->topbar = topbar; |
|
| 1731 | 1731 | m->lt[0] = &layouts[0]; |
|
| 1732 | 1732 | m->lt[1] = &layouts[1 % LENGTH(layouts)]; |
|
| 1733 | 1733 | updatebarpos(m); |
|