commit ed397a40d10023747bb4f7a553c886cfb0ce3374
parent 4ebbc14e246a1ab6a2f783b43e8285e311abf189
Author: Kris Maglione <jg@suckless.org>
Date: Sun, 20 Jan 2008 19:10:40 -0500
Fixed warnings/errors on linux.
Diffstat:
10 files changed, 18 insertions(+), 13 deletions(-)
diff --git 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
@@ -4,7 +4,7 @@
#include "dat.h"
#include <assert.h>
#include <math.h>
-#include <sys/limits.h>
+#include <limits.h>
#include "fns.h"
Client*
diff --git 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
@@ -3,7 +3,7 @@
*/
#include "dat.h"
#include <assert.h>
-#include <sys/limits.h>
+#include <limits.h>
#include "fns.h"
Window *ewmhwin;
diff --git a/cmd/wmii/float.c b/cmd/wmii/float.c
@@ -2,7 +2,7 @@
* See LICENSE file for license details.
*/
#include "dat.h"
-#include <sys/limits.h>
+#include <limits.h>
#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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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