reverted uint/ulong introduction b89a9501
Anselm R Garbe · 2008-07-16 18:18 2 file(s) · +20 −22
config.h +2 −2
7 7
static const char *selbgcolor  = "#0066ff";
8 8
static const char *selfgcolor  = "#ffffff";
9 9
10 -
static uint spaceitem          = 30; /* px between menu items */
10 +
static unsigned int spaceitem  = 30; /* px between menu items */
11 11
12 12
#ifdef XINERAMA
13 -
static uint xidx               = 0;  /* Xinerama screen index to use */
13 +
static unsigned int xidx       = 0;  /* Xinerama screen index to use */
14 14
#endif
dmenu.c +18 −20
22 22
enum { ColFG, ColBG, ColLast };
23 23
24 24
/* typedefs */
25 -
typedef unsigned int uint;
26 -
typedef unsigned long ulong;
27 25
typedef struct {
28 26
	int x, y, w, h;
29 -
	ulong norm[ColLast];
30 -
	ulong sel[ColLast];
27 +
	unsigned long norm[ColLast];
28 +
	unsigned long sel[ColLast];
31 29
	Drawable drawable;
32 30
	GC gc;
33 31
	struct {
52 50
static char *cistrstr(const char *s, const char *sub);
53 51
static void cleanup(void);
54 52
static void drawmenu(void);
55 -
static void drawtext(const char *text, ulong col[ColLast]);
53 +
static void drawtext(const char *text, unsigned long col[ColLast]);
56 54
static void eprint(const char *errstr, ...);
57 -
static ulong getcolor(const char *colstr);
55 +
static unsigned long getcolor(const char *colstr);
58 56
static Bool grabkeyboard(void);
59 57
static void initfont(const char *fontstr);
60 58
static void kpress(XKeyEvent * e);
62 60
static void readstdin(void);
63 61
static void run(void);
64 62
static void setup(Bool topbar);
65 -
static int textnw(const char *text, uint len);
63 +
static int textnw(const char *text, unsigned int len);
66 64
static int textw(const char *text);
67 65
68 66
#include "config.h"
75 73
static int promptw = 0;
76 74
static int ret = 0;
77 75
static int screen;
78 -
static uint mw, mh;
79 -
static uint numlockmask = 0;
76 +
static unsigned int mw, mh;
77 +
static unsigned int numlockmask = 0;
80 78
static Bool running = True;
81 79
static Display *dpy;
82 80
static DC dc = {0};
104 102
void
105 103
calcoffsets(void) {
106 104
	int tw;
107 -
	uint w;
105 +
	unsigned int w;
108 106
109 107
	if(!curr)
110 108
		return;
131 129
char *
132 130
cistrstr(const char *s, const char *sub) {
133 131
	int c, csub;
134 -
	uint len;
132 +
	unsigned int len;
135 133
136 134
	if(!sub)
137 135
		return (char *)s;
213 211
}
214 212
215 213
void
216 -
drawtext(const char *text, ulong col[ColLast]) {
214 +
drawtext(const char *text, unsigned long col[ColLast]) {
217 215
	int x, y, w, h;
218 216
	static char buf[256];
219 -
	uint len, olen;
217 +
	unsigned int len, olen;
220 218
	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
221 219
222 220
	XSetForeground(dpy, dc.gc, col[ColBG]);
262 260
	exit(EXIT_FAILURE);
263 261
}
264 262
265 -
ulong
263 +
unsigned long
266 264
getcolor(const char *colstr) {
267 265
	Colormap cmap = DefaultColormap(dpy, screen);
268 266
	XColor color;
274 272
275 273
Bool
276 274
grabkeyboard(void) {
277 -
	uint len;
275 +
	unsigned int len;
278 276
279 277
	for(len = 1000; len; len--) {
280 278
		if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime)
330 328
kpress(XKeyEvent * e) {
331 329
	char buf[32];
332 330
	int i, num;
333 -
	uint len;
331 +
	unsigned int len;
334 332
	KeySym ksym;
335 333
336 334
	len = strlen(text);
498 496
499 497
void
500 498
match(char *pattern) {
501 -
	uint plen;
499 +
	unsigned int plen;
502 500
	Item *i, *itemend, *lexact, *lprefix, *lsubstr, *exactend, *prefixend, *substrend;
503 501
504 502
	if(!pattern)
540 538
void
541 539
readstdin(void) {
542 540
	char *p, buf[1024];
543 -
	uint len = 0, max = 0;
541 +
	unsigned int len = 0, max = 0;
544 542
	Item *i, *new;
545 543
546 544
	i = 0;
659 657
}
660 658
661 659
int
662 -
textnw(const char *text, uint len) {
660 +
textnw(const char *text, unsigned int len) {
663 661
	XRectangle r;
664 662
665 663
	if(dc.font.set) {
676 674
677 675
int
678 676
main(int argc, char *argv[]) {
679 -
	uint i;
677 +
	unsigned int i;
680 678
	Bool topbar = True;
681 679
682 680
	/* command line args */