Skip to content

Commit

Permalink
cleaned sources for pendatic conformance and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
z3bra committed Nov 28, 2014
1 parent 5b3c19e commit b7fa22b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion killw.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

static xcb_connection_t *conn;

static void usage(void);
static void xcbinit(void);
static void cleanup(void);

Expand Down
1 change: 0 additions & 1 deletion lsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions wattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion wmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
4 changes: 2 additions & 2 deletions wtf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
5 changes: 3 additions & 2 deletions wtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]);

Expand Down

0 comments on commit b7fa22b

Please sign in to comment.