Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8e05f6c
)
s/unsigned int/uint/
author
Anselm R Garbe <
[email protected]
>
Thu, 22 May 2008 10:10:08 +0000
(11:10 +0100)
committer
Anselm R Garbe <
[email protected]
>
Thu, 22 May 2008 10:10:08 +0000
(11:10 +0100)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index
1f4b881
..
5138752
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-60,6
+60,7
@@
enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
/* typedefs */
enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
/* typedefs */
+typedef unsigned int uint;
typedef struct Client Client;
struct Client {
char name[256];
typedef struct Client Client;
struct Client {
char name[256];
@@
-67,9
+68,9
@@
struct Client {
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay;
long flags;
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay;
long flags;
- u
nsigned
int bw, oldbw;
+ uint bw, oldbw;
Bool isbanned, isfixed, isfloating, isurgent;
Bool isbanned, isfixed, isfloating, isurgent;
- u
nsigned
int tags;
+ uint tags;
Client *next;
Client *prev;
Client *snext;
Client *next;
Client *prev;
Client *snext;
@@
-108,7
+109,7
@@
typedef struct {
const char *class;
const char *instance;
const char *title;
const char *class;
const char *instance;
const char *title;
- u
nsigned
int tags;
+ uint tags;
Bool isfloating;
} Rule;
Bool isfloating;
} Rule;
@@
-130,7
+131,7
@@
void detachstack(Client *c);
void drawbar(void);
void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
void drawbar(void);
void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
-void *emallocz(u
nsigned
int size);
+void *emallocz(uint size);
void enternotify(XEvent *e);
void eprint(const char *errstr, ...);
void expose(XEvent *e);
void enternotify(XEvent *e);
void eprint(const char *errstr, ...);
void expose(XEvent *e);
@@
-141,13
+142,13
@@
void focusprev(const void *arg);
Client *getclient(Window w);
unsigned long getcolor(const char *colstr);
long getstate(Window w);
Client *getclient(Window w);
unsigned long getcolor(const char *colstr);
long getstate(Window w);
-Bool gettextprop(Window w, Atom atom, char *text, u
nsigned
int size);
+Bool gettextprop(Window w, Atom atom, char *text, uint size);
void grabbuttons(Client *c, Bool focused);
void grabkeys(void);
void initfont(const char *fontstr);
void grabbuttons(Client *c, Bool focused);
void grabkeys(void);
void initfont(const char *fontstr);
-Bool isoccupied(u
nsigned
int t);
+Bool isoccupied(uint t);
Bool isprotodel(Client *c);
Bool isprotodel(Client *c);
-Bool isurgent(u
nsigned
int t);
+Bool isurgent(uint t);
Bool isvisible(Client *c);
void keypress(XEvent *e);
void killclient(const void *arg);
Bool isvisible(Client *c);
void keypress(XEvent *e);
void killclient(const void *arg);
@@
-168,8
+169,8
@@
void setmfact(const void *arg);
void setup(void);
void spawn(const void *arg);
void tag(const void *arg);
void setup(void);
void spawn(const void *arg);
void tag(const void *arg);
-u
nsigned int textnw(const char *text, unsigned
int len);
-u
nsigned
int textw(const char *text);
+u
int textnw(const char *text, u
int len);
+uint textw(const char *text);
void tile(void);
void tileresize(Client *c, int x, int y, int w, int h);
void togglebar(const void *arg);
void tile(void);
void tileresize(Client *c, int x, int y, int w, int h);
void togglebar(const void *arg);
@@
-198,9
+199,9
@@
char stext[256];
int screen, sx, sy, sw, sh;
int bx, by, bw, bh, blw, wx, wy, ww, wh;
int mx, my, mw, mh, tx, ty, tw, th;
int screen, sx, sy, sw, sh;
int bx, by, bw, bh, blw, wx, wy, ww, wh;
int mx, my, mw, mh, tx, ty, tw, th;
-u
nsigned
int seltags = 0;
+uint seltags = 0;
int (*xerrorxlib)(Display *, XErrorEvent *);
int (*xerrorxlib)(Display *, XErrorEvent *);
-u
nsigned
int numlockmask = 0;
+uint numlockmask = 0;
void (*handler[LASTEvent]) (XEvent *) = {
[ButtonPress] = buttonpress,
[ConfigureRequest] = configurerequest,
void (*handler[LASTEvent]) (XEvent *) = {
[ButtonPress] = buttonpress,
[ConfigureRequest] = configurerequest,
@@
-218,7
+219,7
@@
void (*handler[LASTEvent]) (XEvent *) = {
Atom wmatom[WMLast], netatom[NetLast];
Bool otherwm, readin;
Bool running = True;
Atom wmatom[WMLast], netatom[NetLast];
Bool otherwm, readin;
Bool running = True;
-u
nsigned
int tagset[] = {1, 1}; /* after start, first tag is selected */
+uint tagset[] = {1, 1}; /* after start, first tag is selected */
Client *clients = NULL;
Client *sel = NULL;
Client *stack = NULL;
Client *clients = NULL;
Client *sel = NULL;
Client *stack = NULL;
@@
-232,14
+233,14
@@
Window root, barwin;
/* configuration, allows nested code to access above variables */
#include "config.h"
/* configuration, allows nested code to access above variables */
#include "config.h"
-/* check if all tags will fit into a u
nsigned
int bitarray. */
+/* check if all tags will fit into a uint bitarray. */
static char tags_is_a_sign_that_your_IQ[sizeof(int) * 8 < LENGTH(tags) ? -1 : 1];
/* function implementations */
void
applyrules(Client *c) {
static char tags_is_a_sign_that_your_IQ[sizeof(int) * 8 < LENGTH(tags) ? -1 : 1];
/* function implementations */
void
applyrules(Client *c) {
- u
nsigned
int i;
+ uint i;
Rule *r;
XClassHint ch = { 0 };
Rule *r;
XClassHint ch = { 0 };
@@
-305,7
+306,7
@@
ban(Client *c) {
void
buttonpress(XEvent *e) {
void
buttonpress(XEvent *e) {
- u
nsigned
int i, x, mask;
+ uint i, x, mask;
Client *c;
XButtonPressedEvent *ev = &e->xbutton;
Client *c;
XButtonPressedEvent *ev = &e->xbutton;
@@
-561,7
+562,7
@@
drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
void
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
int x, y, w, h;
void
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
int x, y, w, h;
- u
nsigned
int len, olen;
+ uint len, olen;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
char buf[256];
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
char buf[256];
@@
-596,7
+597,7
@@
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
}
void *
}
void *
-emallocz(u
nsigned
int size) {
+emallocz(uint size) {
void *res = calloc(1, size);
if(!res)
void *res = calloc(1, size);
if(!res)
@@
-735,7
+736,7
@@
getstate(Window w) {
}
Bool
}
Bool
-gettextprop(Window w, Atom atom, char *text, u
nsigned
int size) {
+gettextprop(Window w, Atom atom, char *text, uint size) {
char **list = NULL;
int n;
XTextProperty name;
char **list = NULL;
int n;
XTextProperty name;
@@
-763,8
+764,8
@@
gettextprop(Window w, Atom atom, char *text, unsigned int size) {
void
grabbuttons(Client *c, Bool focused) {
int i, j;
void
grabbuttons(Client *c, Bool focused) {
int i, j;
- u
nsigned
int buttons[] = { Button1, Button2, Button3 };
- u
nsigned
int modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask,
+ uint buttons[] = { Button1, Button2, Button3 };
+ uint modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask,
MODKEY|numlockmask|LockMask} ;
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
MODKEY|numlockmask|LockMask} ;
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
@@
-780,7
+781,7
@@
grabbuttons(Client *c, Bool focused) {
void
grabkeys(void) {
void
grabkeys(void) {
- u
nsigned
int i, j;
+ uint i, j;
KeyCode code;
XModifierKeymap *modmap;
KeyCode code;
XModifierKeymap *modmap;
@@
-848,7
+849,7
@@
initfont(const char *fontstr) {
}
Bool
}
Bool
-isoccupied(u
nsigned
int t) {
+isoccupied(uint t) {
Client *c;
for(c = clients; c; c = c->next)
Client *c;
for(c = clients; c; c = c->next)
@@
-873,7
+874,7
@@
isprotodel(Client *c) {
}
Bool
}
Bool
-isurgent(u
nsigned
int t) {
+isurgent(uint t) {
Client *c;
for(c = clients; c; c = c->next)
Client *c;
for(c = clients; c; c = c->next)
@@
-889,7
+890,7
@@
isvisible(Client *c) {
void
keypress(XEvent *e) {
void
keypress(XEvent *e) {
- u
nsigned
int i;
+ uint i;
KeySym keysym;
XKeyEvent *ev;
KeySym keysym;
XKeyEvent *ev;
@@
-1004,7
+1005,7
@@
maprequest(XEvent *e) {
void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
- u
nsigned
int dui;
+ uint dui;
Window dummy;
XEvent ev;
Window dummy;
XEvent ev;
@@
-1230,7
+1231,7
@@
run(void) {
char sbuf[sizeof stext];
fd_set rd;
int r, xfd;
char sbuf[sizeof stext];
fd_set rd;
int r, xfd;
- u
nsigned
int len, offset;
+ uint len, offset;
XEvent ev;
/* main event loop, also reads status text from stdin */
XEvent ev;
/* main event loop, also reads status text from stdin */
@@
-1286,7
+1287,7
@@
run(void) {
void
scan(void) {
void
scan(void) {
- u
nsigned
int i, num;
+ uint i, num;
Window *wins, d1, d2;
XWindowAttributes wa;
Window *wins, d1, d2;
XWindowAttributes wa;
@@
-1336,7
+1337,7
@@
setmfact(const void *arg) {
void
setup(void) {
void
setup(void) {
- u
nsigned
int i, w;
+ uint i, w;
XSetWindowAttributes wa;
/* init screen */
XSetWindowAttributes wa;
/* init screen */
@@
-1441,8
+1442,8
@@
tag(const void *arg) {
}
}
}
}
-u
nsigned
int
-textnw(const char *text, u
nsigned
int len) {
+uint
+textnw(const char *text, uint len) {
XRectangle r;
if(dc.font.set) {
XRectangle r;
if(dc.font.set) {
@@
-1452,7
+1453,7
@@
textnw(const char *text, unsigned int len) {
return XTextWidth(dc.font.xfont, text, len);
}
return XTextWidth(dc.font.xfont, text, len);
}
-u
nsigned
int
+uint
textw(const char *text) {
return textnw(text, strlen(text)) + dc.font.height;
}
textw(const char *text) {
return textnw(text, strlen(text)) + dc.font.height;
}
@@
-1460,7
+1461,7
@@
textw(const char *text) {
void
tile(void) {
int x, y, h, w;
void
tile(void) {
int x, y, h, w;
- u
nsigned
int i, n;
+ uint i, n;
Client *c;
for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++);
Client *c;
for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++);
@@
-1524,7
+1525,7
@@
togglefloating(const void *arg) {
void
togglelayout(const void *arg) {
void
togglelayout(const void *arg) {
- u
nsigned
int i;
+ uint i;
if(!arg) {
if(++lt == &layouts[LENGTH(layouts)])
if(!arg) {
if(++lt == &layouts[LENGTH(layouts)])