diff --git a/Makefile b/Makefile index d973413a..80f4c89f 100644 --- a/Makefile +++ b/Makefile @@ -18,11 +18,12 @@ config: ROOT="${ROOT}" ${ROOT}/util/genconfig deb-dep: - apt-get -qq install build-essential debhelper libxext-dev x11proto-xext-dev libx11-dev + apt-get -qq install build-essential debhelper libxext-dev x11proto-xext-dev libx11-dev libxrandr-dev deb: dpkg-buildpackage -rfakeroot include ${ROOT}/mk/dir.mk INSTDIRS = ${PDIRS} +.PHONY: config diff --git a/cmd/wmii/area.c b/cmd/wmii/area.c index 62aee514..9437e82e 100644 --- a/cmd/wmii/area.c +++ b/cmd/wmii/area.c @@ -4,7 +4,7 @@ #include "dat.h" #include #include -#include +#include #include "fns.h" Client* diff --git a/cmd/wmii/bar.c b/cmd/wmii/bar.c index 25a56d4e..254b4981 100644 --- a/cmd/wmii/bar.c +++ b/cmd/wmii/bar.c @@ -120,6 +120,7 @@ bar_draw(WMScreen *s) { b->smaller = *pb; *pb = b; } + SET(shrink); for(tb = largest; tb; tb = tb->smaller) { width -= Dx(tb->r); tw += Dx(tb->r); @@ -128,7 +129,6 @@ bar_draw(WMScreen *s) { if(Dx(tb->r) * shrink >= Dx(tb->smaller->r)) break; } - SET(shrink); if(tb) for(b = largest; b != tb->smaller; b = b->smaller) b->r.max.x *= shrink; diff --git a/cmd/wmii/ewmh.c b/cmd/wmii/ewmh.c index e67f9e4f..5ec54a83 100644 --- a/cmd/wmii/ewmh.c +++ b/cmd/wmii/ewmh.c @@ -3,7 +3,7 @@ */ #include "dat.h" #include -#include +#include #include "fns.h" Window *ewmhwin; diff --git a/cmd/wmii/float.c b/cmd/wmii/float.c index fa44466b..c7d22910 100644 --- a/cmd/wmii/float.c +++ b/cmd/wmii/float.c @@ -2,7 +2,7 @@ * See LICENSE file for license details. */ #include "dat.h" -#include +#include #include "fns.h" static void float_placeframe(Frame*); @@ -123,6 +123,7 @@ float_placeframe(Frame *f) { vp2 = vptemp; } + p = ZP; /* SET(p) */ if(vp->n == 0) { p.x = random() % max(0, Dx(a->r) - dim.x); p.y = random() % max(0, Dy(a->r) - dim.y); diff --git a/cmd/wmii/key.c b/cmd/wmii/key.c index 04d5e970..dbf9f9b9 100644 --- a/cmd/wmii/key.c +++ b/cmd/wmii/key.c @@ -169,7 +169,8 @@ static Key * match_keys(Key *k, ulong mod, KeyCode keycode, bool seq) { Key *ret = nil, *next; - for(next = k->tnext; k; (k=next) && (next=k->tnext)) { + /* I *hate* GCC 4. */ + for(next = k->tnext; k; (void)((k=next) && (next=k->tnext))) { if(seq) k = k->next; if(k && (k->mod == mod) && (k->key == keycode)) { diff --git a/cmd/wmii/mouse.c b/cmd/wmii/mouse.c index b9aaef59..ad145b48 100644 --- a/cmd/wmii/mouse.c +++ b/cmd/wmii/mouse.c @@ -719,6 +719,9 @@ mouse_resize(Client *c, bool grabbox, Align align) { hr = subpt(frect.max, frect.min); hr = divpt(hr, Pt(2, 2)); + SET(hrx); + SET(hry); + if(align != Center) { d = hr; if(align&North) d.y -= hr.y; @@ -757,8 +760,6 @@ mouse_resize(Client *c, bool grabbox, Align align) { d.y = ev.xmotion.y_root; if(align == Center && !grabbox) { - SET(hrx); - SET(hry); d.x = (d.x * hrx) - pt.x; d.y = (d.y * hry) - pt.y; }else diff --git a/include/util.h b/include/util.h index 94793276..0e1e7af3 100644 --- a/include/util.h +++ b/include/util.h @@ -76,5 +76,6 @@ _used(long a, ...) { # undef USED # undef SET # define USED(...) _used((long)__VA_ARGS__) -# define SET(x) USED(&x) +# define SET(x) (x = 0) +/* # define SET(x) USED(&x) GCC 4 is 'too smart' for this. */ #endif diff --git a/mk/hdr.mk b/mk/hdr.mk index 9394a9ad..4600119d 100644 --- a/mk/hdr.mk +++ b/mk/hdr.mk @@ -77,8 +77,9 @@ install: printinstall mkdirs depend: cleandep FILTER = cat -COMPILE= CC="$(CC)" CFLAGS="$(CFLAGS)" $(ROOT)/util/compile -COMPILEPIC= CC="$(CC)" CFLAGS="$(CFLAGS) $(SOCFLAGS)" $(ROOT)/util/compile +EXCFLAGS = -I$$(echo $(INCPATH)|sed 's/:/ -I/g') -D_XOPEN_SOURCE=600 +COMPILE= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS)" $(ROOT)/util/compile +COMPILEPIC= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS) $(SOCFLAGS)" $(ROOT)/util/compile LINK= LD="$(LD)" LDFLAGS="$(LDFLAGS)" $(ROOT)/util/link LINKSO= LD="$(LD)" LDFLAGS="$(SOLDFLAGS)" $(ROOT)/util/link CLEANNAME=$(ROOT)/util/cleanname @@ -91,6 +92,5 @@ MKCFG:=${shell $(MKCFGSH)} MKCFG!=${MKCFGSH} include $(MKCFG) -CFLAGS += -I$$(echo $(INCPATH)|sed 's/:/ -I/g') include $(ROOT)/mk/common.mk diff --git a/util/link b/util/link index 5ad0c0e7..a3ab6f94 100755 --- a/util/link +++ b/util/link @@ -26,7 +26,7 @@ $LD -o $outfile $ofiles $LDFLAGS $args >$xtmp 2>&1 status=$? sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . | -egrep -v 'is almost always misused|is dangerous, better use' +egrep -v 'is almost always misused|is dangerous, better use|in statically linked applications requires at runtime' rm -f $xtmp exit $status