portability
Connor Lane Smith cls@lubutu.com
Sun, 15 May 2011 21:54:26 +0100
M
config.mk
→
config.mk
@@ -18,7 +18,7 @@ LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS}
# flags CPPFLAGS = -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} +CFLAGS = -ansi -pedantic -Wall -Os ${INCS} ${CPPFLAGS} LDFLAGS = -s ${LIBS} # compiler and linker
M
draw.c
→
draw.c
@@ -15,12 +15,13 @@ static Bool loadfont(DC *dc, const char *fontstr);
void drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color) { - XRectangle r = { dc->x + x, dc->y + y, w, h }; + XRectangle r; + + r.x = dc->x + x; + r.y = dc->y + y; + r.width = fill ? w : w-1; + r.height = fill ? h : h-1; - if(!fill) { - r.width -= 1; - r.height -= 1; - } XSetForeground(dc->dpy, dc->gc, color); (fill ? XFillRectangles : XDrawRectangles)(dc->dpy, dc->canvas, dc->gc, &r, 1); }