using malloc() instead of calloc() and sticking to static initializer and struct assignment, not using *c = (Client){}; right now to avoid some ugly gcc warning, possibly a gcc bug since we are using -std=c99
This commit is contained in:
parent
83abfc05eb
commit
53cac17692
6
dwm.c
6
dwm.c
|
@ -846,12 +846,14 @@ killclient(const Arg *arg) {
|
||||||
|
|
||||||
void
|
void
|
||||||
manage(Window w, XWindowAttributes *wa) {
|
manage(Window w, XWindowAttributes *wa) {
|
||||||
|
static Client cz;
|
||||||
Client *c, *t = NULL;
|
Client *c, *t = NULL;
|
||||||
Window trans = None;
|
Window trans = None;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
if(!(c = calloc(1, sizeof(Client))))
|
if(!(c = malloc(sizeof(Client))))
|
||||||
die("fatal: could not calloc() %u bytes\n", sizeof(Client));
|
die("fatal: could not malloc() %u bytes\n", sizeof(Client));
|
||||||
|
*c = cz;
|
||||||
c->win = w;
|
c->win = w;
|
||||||
|
|
||||||
/* geometry */
|
/* geometry */
|
||||||
|
|
Loading…
Reference in a new issue