wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit ac54bfc595e8ed046a8459bff2f1fc529e9edf50
parent f8e6a1370ce8bdb6965a2341037339b2ac28de18
Author: garbeam <garbeam@darkstar.home>
Date:   Tue, 10 Jan 2006 16:00:01 +0200

fixed 64bit compile warnings (thx to lavish for the account)


Diffstat:
cmd/wm/page.c | 12++++++------
cmd/wmiiwarp.c | 15+++++++++++++--
config.mk | 2+-
3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/cmd/wm/page.c b/cmd/wm/page.c @@ -26,17 +26,17 @@ alloc_page() Page *p, *new = cext_emallocz(sizeof(Page)); char buf[MAX_BUF], buf2[16]; - snprintf(buf2, sizeof(buf2), "%d", npages); - snprintf(buf, sizeof(buf), "/%d", npages); + snprintf(buf2, sizeof(buf2), "%ld", npages); + snprintf(buf, sizeof(buf), "/%ld", npages); new->file[P_PREFIX] = ixp_create(ixps, buf); - snprintf(buf, sizeof(buf), "/%d/name", npages); + snprintf(buf, sizeof(buf), "/%ld/name", npages); new->file[P_NAME] = wmii_create_ixpfile(ixps, buf, buf2); - snprintf(buf, sizeof(buf), "/%d/layout/", npages); + snprintf(buf, sizeof(buf), "/%ld/layout/", npages); new->file[P_AREA_PREFIX] = ixp_create(ixps, buf); - snprintf(buf, sizeof(buf), "/%d/layout/sel", npages); + snprintf(buf, sizeof(buf), "/%ld/layout/sel", npages); new->file[P_SEL_AREA] = ixp_create(ixps, buf); new->file[P_SEL_AREA]->bind = 1; /* mount point */ - snprintf(buf, sizeof(buf), "/%d/ctl", npages); + snprintf(buf, sizeof(buf), "/%ld/ctl", npages); new->file[P_CTL] = ixp_create(ixps, buf); new->file[P_CTL]->after_write = handle_after_write_page; new->floating = alloc_area(new, "float"); diff --git a/cmd/wmiiwarp.c b/cmd/wmiiwarp.c @@ -10,6 +10,8 @@ #include <X11/Xutil.h> #include <X11/Xatom.h> +#include "cext.h" + static char *version[] = { "wmiiwarp - window manager improved warp - " VERSION "\n" " (C)opyright MMIV-MMV Anselm R. Garbe\n", 0 @@ -29,6 +31,7 @@ main(int argc, char **argv) { Display *dpy; int x, y; + const char *errstr; /* command line args */ if(argc < 2) @@ -46,8 +49,16 @@ main(int argc, char **argv) x = DisplayWidth(dpy, DefaultScreen(dpy)) / 2; y = DisplayHeight(dpy, DefaultScreen(dpy)) / 2; } else if(argc == 3) { - x = cext_strtonum(argv[1], 0, DisplayWidth(dpy, DefaultScreen(dpy))); - y = cext_strtonum(argv[2], 0, DisplayHeight(dpy, DefaultScreen(dpy))); + x = cext_strtonum(argv[1], 0, DisplayWidth(dpy, DefaultScreen(dpy)), &errstr); + if(errstr) { + fprintf(stderr, "wmiiwarp: invalid x value: '%s'\n", errstr); + usage(); + } + y = cext_strtonum(argv[2], 0, DisplayHeight(dpy, DefaultScreen(dpy)), &errstr); + if(errstr) { + fprintf(stderr, "wmiiwarp: invalid y value: '%s'\n", errstr); + usage(); + } } XWarpPointer(dpy, None, RootWindow(dpy, DefaultScreen(dpy)), 0, 0, 0, 0, x, y); diff --git a/config.mk b/config.mk @@ -1,7 +1,7 @@ # Customize to fit your system # paths -PREFIX = /usr/local +PREFIX = ${HOME}/local CONFPREFIX = ${PREFIX}/etc MANPREFIX = ${PREFIX}/share/man 9PREFIX = ${PREFIX}/9