tcleaned sources for pendatic conformance and warnings - wmutils - X windows manipulation utilities
 (HTM) git clone git://z3bra.org/wmutils
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit b7fa22b01b124c64c099f4c2e6315da0393ceb66
 (DIR) parent 5b3c19ed7506ec1a6ac8637314d34840d111d8f5
 (HTM) Author: z3bra <willy@mailoo.org>
       Date:   Fri, 28 Nov 2014 12:47:34 +0100
       
       cleaned sources for pendatic conformance and warnings
       
       Diffstat:
         M Makefile                            |       2 +-
         M killw.c                             |       1 -
         M lsw.c                               |       1 -
         M wattr.c                             |       5 ++---
         M wmv.c                               |       3 ++-
         M wtf.c                               |       4 ++--
         M wtp.c                               |       5 +++--
       
       7 files changed, 10 insertions(+), 11 deletions(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       t@@ -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
 (DIR) diff --git a/killw.c b/killw.c
       t@@ -5,7 +5,6 @@
        
        static xcb_connection_t *conn;
        
       -static void usage(void);
        static void xcbinit(void);
        static void cleanup(void);
        
 (DIR) diff --git a/lsw.c b/lsw.c
       t@@ -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
 (DIR) diff --git a/wattr.c b/wattr.c
       t@@ -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;
        
       t@@ -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;
       t@@ -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;
 (DIR) diff --git a/wmv.c b/wmv.c
       t@@ -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]);
        
 (DIR) diff --git a/wtf.c b/wtf.c
       t@@ -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]);
        
 (DIR) diff --git a/wtp.c b/wtp.c
       t@@ -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);
       t@@ -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]);