wmutils

X windows manipulation utilities
git clone git://z3bra.org/wmutils
Log | Files | Refs | LICENSE

commit b7fa22b01b124c64c099f4c2e6315da0393ceb66
parent 5b3c19ed7506ec1a6ac8637314d34840d111d8f5
Author: z3bra <willy@mailoo.org>
Date:   Fri Nov 28 12:47:34 2014

cleaned sources for pendatic conformance and warnings

Diffstat:
 Makefile | 2 +-
 killw.c  | 1 -
 lsw.c    | 1 -
 wattr.c  | 5 ++---
 wmv.c    | 3 ++-
 wtf.c    | 4 ++--
 wtp.c    | 5 +++--
 7 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,7 +3,7 @@ MANPREFIX:=$(PREFIX)/share/man CC ?= cc LD = $(CC) -CFLAGS += -std=c99 -pedantic -Wall -Os +CFLAGS += -std=c99 -pedantic -ansi -Wall -Os LDFLAGS += -lxcb HDR = arg.h diff --git a/killw.c b/killw.c @@ -5,7 +5,6 @@ static xcb_connection_t *conn; -static void usage(void); static void xcbinit(void); static void cleanup(void); diff --git a/lsw.c b/lsw.c @@ -12,7 +12,6 @@ static xcb_screen_t *scrn; static void usage(void); static void xcbinit(void); static void cleanup(void); -static xcb_window_t getroot(void); static int ismapped(xcb_window_t w); static void diff --git a/wattr.c b/wattr.c @@ -45,7 +45,6 @@ cleanup(void) static int exists(xcb_window_t w) { - int ms; xcb_get_window_attributes_cookie_t c; xcb_get_window_attributes_reply_t *r; @@ -98,7 +97,7 @@ main(int argc, char **argv) w = strtoul(argv[argc-1], NULL, 16); - for (i=0; i<strnlen(argv[1], ATTR_MAX); i++) { + for (i=0; i<strlen(argv[1]); i++) { switch (argv[1][i]) { case 'w': printf("%d", getattribute(w, ATTR_W)); break; case 'h': printf("%d", getattribute(w, ATTR_H)); break; @@ -108,7 +107,7 @@ main(int argc, char **argv) } /* add a space if more attribute come after */ - putc(i+1 < strnlen(argv[1], ATTR_MAX) ? ' ' : '\n',stdout); + putc(i+1 < strlen(argv[1]) ? ' ' : '\n',stdout); } return 0; diff --git a/wmv.c b/wmv.c @@ -93,9 +93,10 @@ cleanup (void) { int main (int argc, char **argv) { - atexit(cleanup); xcb_window_t win; + atexit(cleanup); + if (argc != 4) errx(1, "usage: %s <x> <y> <win>", argv[0]); diff --git a/wtf.c b/wtf.c @@ -56,13 +56,13 @@ center_pointer (xcb_window_t win) XCB_CURRENT_TIME); } - int main (int argc, char **argv) { - atexit(cleanup); xcb_window_t win; + atexit(cleanup); + if (argc != 2) usage(argv[0]); diff --git a/wtp.c b/wtp.c @@ -19,7 +19,7 @@ #include <stdio.h> #include <err.h> -static xcb_connection_t *conn; +static xcb_connection_t *conn; static void cleanup (void); static void usage (char *name); @@ -77,9 +77,10 @@ teleport (xcb_window_t win, int x, int y, int w, int h) int main (int argc, char **argv) { - atexit(cleanup); xcb_window_t win; + atexit(cleanup); + if (argc != 6) usage(argv[0]);