made function signatures more consistent to my coding style
81bcf078
3 file(s) · +15 −30
| 10 | 10 | /* static */ |
|
| 11 | 11 | ||
| 12 | 12 | static unsigned int |
|
| 13 | - | textnw(const char *text, unsigned int len) |
|
| 14 | - | { |
|
| 13 | + | textnw(const char *text, unsigned int len) { |
|
| 15 | 14 | XRectangle r; |
|
| 16 | 15 | ||
| 17 | 16 | if(dc.font.set) { |
|
| 24 | 23 | /* extern */ |
|
| 25 | 24 | ||
| 26 | 25 | void |
|
| 27 | - | drawtext(const char *text, unsigned long col[ColLast]) |
|
| 28 | - | { |
|
| 26 | + | drawtext(const char *text, unsigned long col[ColLast]) { |
|
| 29 | 27 | int x, y, w, h; |
|
| 30 | 28 | static char buf[256]; |
|
| 31 | 29 | unsigned int len, olen; |
|
| 78 | 76 | } |
|
| 79 | 77 | ||
| 80 | 78 | unsigned long |
|
| 81 | - | getcolor(const char *colstr) |
|
| 82 | - | { |
|
| 79 | + | getcolor(const char *colstr) { |
|
| 83 | 80 | Colormap cmap = DefaultColormap(dpy, screen); |
|
| 84 | 81 | XColor color; |
|
| 85 | 82 | ||
| 88 | 85 | } |
|
| 89 | 86 | ||
| 90 | 87 | void |
|
| 91 | - | setfont(const char *fontstr) |
|
| 92 | - | { |
|
| 88 | + | setfont(const char *fontstr) { |
|
| 93 | 89 | char **missing, *def; |
|
| 94 | 90 | int i, n; |
|
| 95 | 91 | ||
| 137 | 133 | } |
|
| 138 | 134 | ||
| 139 | 135 | unsigned int |
|
| 140 | - | textw(const char *text) |
|
| 141 | - | { |
|
| 136 | + | textw(const char *text) { |
|
| 142 | 137 | return textnw(text, strlen(text)) + dc.font.height; |
|
| 143 | 138 | } |
|
| 42 | 42 | static Window win; |
|
| 43 | 43 | ||
| 44 | 44 | static void |
|
| 45 | - | calcoffsets() |
|
| 46 | - | { |
|
| 45 | + | calcoffsets() { |
|
| 47 | 46 | unsigned int tw, w; |
|
| 48 | 47 | ||
| 49 | 48 | if(!curr) |
|
| 71 | 70 | } |
|
| 72 | 71 | ||
| 73 | 72 | static void |
|
| 74 | - | drawmenu() |
|
| 75 | - | { |
|
| 73 | + | drawmenu() { |
|
| 76 | 74 | Item *i; |
|
| 77 | 75 | ||
| 78 | 76 | dc.x = 0; |
|
| 110 | 108 | } |
|
| 111 | 109 | ||
| 112 | 110 | static void |
|
| 113 | - | match(char *pattern) |
|
| 114 | - | { |
|
| 111 | + | match(char *pattern) { |
|
| 115 | 112 | unsigned int plen; |
|
| 116 | 113 | Item *i, *j; |
|
| 117 | 114 | ||
| 151 | 148 | } |
|
| 152 | 149 | ||
| 153 | 150 | static void |
|
| 154 | - | kpress(XKeyEvent * e) |
|
| 155 | - | { |
|
| 151 | + | kpress(XKeyEvent * e) { |
|
| 156 | 152 | char buf[32]; |
|
| 157 | 153 | int num, prev_nitem; |
|
| 158 | 154 | unsigned int i, len; |
|
| 251 | 247 | } |
|
| 252 | 248 | ||
| 253 | 249 | static char * |
|
| 254 | - | readstdin() |
|
| 255 | - | { |
|
| 250 | + | readstdin() { |
|
| 256 | 251 | static char *maxname = NULL; |
|
| 257 | 252 | char *p, buf[1024]; |
|
| 258 | 253 | unsigned int len = 0, max = 0; |
|
| 289 | 284 | DC dc = {0}; |
|
| 290 | 285 | ||
| 291 | 286 | int |
|
| 292 | - | main(int argc, char *argv[]) |
|
| 293 | - | { |
|
| 287 | + | main(int argc, char *argv[]) { |
|
| 294 | 288 | char *maxname; |
|
| 295 | 289 | fd_set rd; |
|
| 296 | 290 | struct timeval timeout; |
|
| 13 | 13 | /* static */ |
|
| 14 | 14 | ||
| 15 | 15 | static void |
|
| 16 | - | badmalloc(unsigned int size) |
|
| 17 | - | { |
|
| 16 | + | badmalloc(unsigned int size) { |
|
| 18 | 17 | eprint("fatal: could not malloc() %u bytes\n", size); |
|
| 19 | 18 | } |
|
| 20 | 19 | ||
| 21 | 20 | /* extern */ |
|
| 22 | 21 | ||
| 23 | 22 | void * |
|
| 24 | - | emalloc(unsigned int size) |
|
| 25 | - | { |
|
| 23 | + | emalloc(unsigned int size) { |
|
| 26 | 24 | void *res = malloc(size); |
|
| 27 | 25 | if(!res) |
|
| 28 | 26 | badmalloc(size); |
|
| 30 | 28 | } |
|
| 31 | 29 | ||
| 32 | 30 | void |
|
| 33 | - | eprint(const char *errstr, ...) |
|
| 34 | - | { |
|
| 31 | + | eprint(const char *errstr, ...) { |
|
| 35 | 32 | va_list ap; |
|
| 36 | 33 | ||
| 37 | 34 | va_start(ap, errstr); |
|
| 41 | 38 | } |
|
| 42 | 39 | ||
| 43 | 40 | char * |
|
| 44 | - | estrdup(const char *str) |
|
| 45 | - | { |
|
| 41 | + | estrdup(const char *str) { |
|
| 46 | 42 | void *res = strdup(str); |
|
| 47 | 43 | if(!res) |
|
| 48 | 44 | badmalloc(strlen(str)); |
|