Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
s/int/uint/ in config.h
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
8dc88fe
..
f46f069
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-61,6
+61,7
@@
enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
/* typedefs */
typedef unsigned int uint;
/* typedefs */
typedef unsigned int uint;
+typedef unsigned long ulong;
typedef struct Client Client;
struct Client {
char name[256];
typedef struct Client Client;
struct Client {
char name[256];
@@
-68,7
+69,7
@@
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
int bw, oldbw;
+ int bw, oldbw;
Bool isbanned, isfixed, isfloating, isurgent;
uint tags;
Client *next;
Bool isbanned, isfixed, isfloating, isurgent;
uint tags;
Client *next;
@@
-79,8
+80,8
@@
struct Client {
typedef struct {
int x, y, w, h;
typedef struct {
int x, y, w, h;
- u
nsigned
long norm[ColLast];
- u
nsigned
long sel[ColLast];
+ ulong norm[ColLast];
+ ulong sel[ColLast];
Drawable drawable;
GC gc;
struct {
Drawable drawable;
GC gc;
struct {
@@
-93,7
+94,7
@@
typedef struct {
} DC; /* draw context */
typedef struct {
} DC; /* draw context */
typedef struct {
- u
nsigned long
mod;
+ u
int
mod;
KeySym keysym;
void (*func)(const void *arg);
const void *arg;
KeySym keysym;
void (*func)(const void *arg);
const void *arg;
@@
-129,8
+130,8
@@
void destroynotify(XEvent *e);
void detach(Client *c);
void detachstack(Client *c);
void drawbar(void);
void detach(Client *c);
void detachstack(Client *c);
void drawbar(void);
-void drawsquare(Bool filled, Bool empty, Bool invert, u
nsigned
long col[ColLast]);
-void drawtext(const char *text, u
nsigned
long col[ColLast], Bool invert);
+void drawsquare(Bool filled, Bool empty, Bool invert, ulong col[ColLast]);
+void drawtext(const char *text, ulong col[ColLast], Bool invert);
void *emallocz(uint size);
void enternotify(XEvent *e);
void eprint(const char *errstr, ...);
void *emallocz(uint size);
void enternotify(XEvent *e);
void eprint(const char *errstr, ...);
@@
-140,7
+141,7
@@
void focusin(XEvent *e);
void focusnext(const void *arg);
void focusprev(const void *arg);
Client *getclient(Window w);
void focusnext(const void *arg);
void focusprev(const void *arg);
Client *getclient(Window w);
-u
nsigned
long getcolor(const char *colstr);
+ulong getcolor(const char *colstr);
long getstate(Window w);
Bool gettextprop(Window w, Atom atom, char *text, uint size);
void grabbuttons(Client *c, Bool focused);
long getstate(Window w);
Bool gettextprop(Window w, Atom atom, char *text, uint size);
void grabbuttons(Client *c, Bool focused);
@@
-233,11
+234,10
@@
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"
-/* c
heck if all tags will fit into a uint bit
array. */
-st
atic char tags_is_a_sign_that_your_IQ[sizeof(int) * 8 < LENGTH(tags) ? -1 : 1]
;
+/* c
ompile-time check if all tags fit into an uint bit
array. */
+st
ruct NumTags { char limitexceeded[sizeof(uint) * 8 < LENGTH(tags) ? -1 : 1]; }
;
/* function implementations */
/* function implementations */
-
void
applyrules(Client *c) {
uint i;
void
applyrules(Client *c) {
uint i;
@@
-539,7
+539,7
@@
drawbar(void) {
}
void
}
void
-drawsquare(Bool filled, Bool empty, Bool invert, u
nsigned
long col[ColLast]) {
+drawsquare(Bool filled, Bool empty, Bool invert, ulong col[ColLast]) {
int x;
XGCValues gcv;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
int x;
XGCValues gcv;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
@@
-560,7
+560,7
@@
drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
}
void
}
void
-drawtext(const char *text, u
nsigned
long col[ColLast], Bool invert) {
+drawtext(const char *text, ulong col[ColLast], Bool invert) {
int x, y, w, h;
uint len, olen;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
int x, y, w, h;
uint len, olen;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
@@
-707,7
+707,7
@@
getclient(Window w) {
return c;
}
return c;
}
-u
nsigned
long
+ulong
getcolor(const char *colstr) {
Colormap cmap = DefaultColormap(dpy, screen);
XColor color;
getcolor(const char *colstr) {
Colormap cmap = DefaultColormap(dpy, screen);
XColor color;
@@
-722,7
+722,7
@@
getstate(Window w) {
int format, status;
long result = -1;
unsigned char *p = NULL;
int format, status;
long result = -1;
unsigned char *p = NULL;
- u
nsigned
long n, extra;
+ ulong n, extra;
Atom real;
status = XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
Atom real;
status = XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
@@
-1547,14
+1547,6
@@
togglelayout(const void *arg) {
void
toggletag(const void *arg) {
void
toggletag(const void *arg) {
- int i, m = *(int *)arg;
- for(i = 0; i < sizeof(int) * 8; i++)
- fputc(m & 1 << i ? '1' : '0', stdout);
- puts("");
- for(i = 0; i < sizeof(int) * 8; i++)
- fputc(TAGMASK & 1 << i ? '1' : '0', stdout);
- puts("aaa");
-
if(sel && (sel->tags ^ ((*(int *)arg) & TAGMASK))) {
sel->tags ^= (*(int *)arg) & TAGMASK;
arrange();
if(sel && (sel->tags ^ ((*(int *)arg) & TAGMASK))) {
sel->tags ^= (*(int *)arg) & TAGMASK;
arrange();