[hackers] [wmii] Added more -Wfoo-bar-baz flags.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Jun 01 03:10:38 2007

changeset: 2139:0fab0d43fd8f
user: Kris Maglione <jg_AT_suckless.org>
date: Thu May 24 17:42:33 2007 -0400
summary: Added more -Wfoo-bar-baz flags.

diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/util.c
--- a/cmd/util.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/util.c Thu May 24 17:42:33 2007 -0400
@@ -29,7 +29,7 @@ fatal(const char *fmt, ...) {
 }
 
 /* Can't malloc */
-void
+static void
 mfatal(char *name, uint size) {
         const char
                 couldnot[] = ": fatal: Could not ",
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/client.c
--- a/cmd/wmii/client.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/client.c Thu May 24 17:42:33 2007 -0400
@@ -275,7 +275,7 @@ frame_hints(Frame *f, Rectangle r, Align
         return rectaddpt(r, p);
 }
 
-void
+static void
 set_client_state(Client * c, int state) {
         long data[] = { state, None };
         changeprop(&c->w, "WM_STATE", "WM_STATE", data, nelem(data));
@@ -734,6 +734,7 @@ static Handlers handlers = {
 };
 
 /* Other */
+#if 0 /* Not used at the moment */
 void
 newcol_client(Client *c, char *arg) {
         Frame *f;
@@ -763,6 +764,7 @@ newcol_client(Client *c, char *arg) {
                 return;
         flushevents(EnterWindowMask, False);
 }
+#endif
 
 void
 update_client_views(Client *c, char **tags) {
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/column.c
--- a/cmd/wmii/column.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/column.c Thu May 24 17:42:33 2007 -0400
@@ -97,13 +97,13 @@ drawimg(Image *img, ulong cbg, ulong cbo
         drawpoly(img, pt, nelem(pt), CapNotLast, 1, cborder);
 }
 
-void
+static void
 drawdiv(Divide *d) {
         copyimage(d->w, divimg->r, divimg, ZP);
         setshapemask(d->w, divmask, ZP);
 }
 
-void
+static void
 update_imgs(void) {
         Divide *d;
         int w, h;
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/fns.h Thu May 24 17:42:33 2007 -0400
@@ -168,6 +168,7 @@ int eqpt(Point, Point);
 int eqpt(Point, Point);
 Point addpt(Point, Point);
 Point subpt(Point, Point);
+Point mulpt(Point p, Point q);
 Point divpt(Point, Point);
 Rectangle insetrect(Rectangle, int);
 Rectangle rectaddpt(Rectangle, Point);
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/fs.c Thu May 24 17:42:33 2007 -0400
@@ -183,7 +183,7 @@ write_buf(Ixp9Req *r, char *buf, uint le
 }
 
 /* This should be moved to libixp */
-void
+static void
 write_to_buf(Ixp9Req *r, void *buf, uint *len, uint max) {
         uint offset, count;
 
@@ -210,7 +210,7 @@ write_to_buf(Ixp9Req *r, void *buf, uint
 }
 
 /* This should be moved to libixp */
-void
+static void
 data_to_cstring(Ixp9Req *r) {
         char *p;
         uint i;
@@ -227,7 +227,7 @@ data_to_cstring(Ixp9Req *r) {
 
 typedef char* (*MsgFunc)(void*, Message*);
 
-char *
+static char *
 message(Ixp9Req *r, MsgFunc fn) {
         char *err, *s, *p, c;
         FileId *f;
@@ -258,7 +258,7 @@ message(Ixp9Req *r, MsgFunc fn) {
         return err;
 }
 
-void
+static void
 respond_event(Ixp9Req *r) {
         FileId *f = r->fid->aux;
         if(f->p.buf) {
@@ -445,7 +445,7 @@ LastItem:
         return ret;
 }
 
-Bool
+static Bool
 verify_file(FileId *f) {
         FileId *nf;
 
@@ -525,7 +525,7 @@ fs_walk(Ixp9Req *r) {
         respond(r, nil);
 }
 
-uint
+static uint
 fs_size(FileId *f) {
         switch(f->tab.type) {
         default:
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/map.c
--- a/cmd/wmii/map.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/map.c Thu May 24 17:42:33 2007 -0400
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <util.h>
 #include "dat.h"
+#include "fns.h"
 
 /* Edit s/^([a-zA-Z].*)\n([a-z].*) {/\1 \2;/g x/^([^a-zA-Z]|static|$)/-+d s/ (\*map|val|*str)//g */
 
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/mouse.c Thu May 24 17:42:33 2007 -0400
@@ -374,7 +374,7 @@ gethsep(Rectangle r) {
         return w;
 }
 
-void
+static void
 mouse_resizecolframe(Frame *f, Align align) {
         WinAttr wa;
         XEvent ev;
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii/printevent.c
--- a/cmd/wmii/printevent.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii/printevent.c Thu May 24 17:42:33 2007 -0400
@@ -60,7 +60,7 @@ struct Pair {
 
 static char* sep = " ";
 
-char *
+static char *
 search(Pair *lst, int key, char *(*def)(int)) {
         for(; lst->val; lst++)
                 if(lst->key == key)
@@ -70,7 +70,7 @@ search(Pair *lst, int key, char *(*def)(
 
 static char buffer[512];
 
-char *
+static char*
 unmask(Pair * list, uint val)
 {
         Pair *p;
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmii9menu.c
--- a/cmd/wmii9menu.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmii9menu.c Thu May 24 17:42:33 2007 -0400
@@ -86,13 +86,13 @@ char **commands;
 char **commands;
 int numitems;
 
-void usage();
-void run_menu();
-void create_window();
-void redraw();
-void warpmouse();
-void memory();
-int args();
+void usage(void);
+void run_menu(void);
+void create_window(int, int);
+void redraw(int, int);
+void warpmouse(int, int);
+void memory(void);
+int args(void);
 
 /* args --- go through the argument list, set options */
 
@@ -110,7 +110,7 @@ struct {
         {0, },
 }, *ap;
 
-ulong
+static ulong
 getcolor(char *name, ulong def) {
         if((name != nil)
          && (XParseColor(dpy, defcmap, name, &color) != 0)
@@ -238,7 +238,7 @@ main(int argc, char **argv)
 /* usage --- print a usage message and die */
 
 void
-usage()
+usage(void)
 {
         fprintf(stderr, "usage: %s [-display <displayname>] [-font <fontname>] ", progname);
         fprintf(stderr, "[-{n,s}{f,b} <color>] [-br <color>] ");
@@ -249,7 +249,7 @@ usage()
 /* run_menu --- put up the window, execute selected commands */
 
 void
-run_menu()
+run_menu(void)
 {
         XEvent ev;
         int i, old, wide, high, dx, dy;
diff -r 9addd4c171b4 -r 0fab0d43fd8f cmd/wmiir.c
--- a/cmd/wmiir.c Thu May 24 17:23:36 2007 -0400
+++ b/cmd/wmiir.c Thu May 24 17:42:33 2007 -0400
@@ -12,7 +12,7 @@ static IxpClient *client;
 static IxpClient *client;
 
 static void
-usage() {
+usage(void) {
         fprintf(stderr,
                    "usage: %1$s [-a <address>] {create | read | ls [-ld] | remove | rm | write} <file>\n"
                    " %1$s [-a <address>] xwrite <file> <data>\n"
diff -r 9addd4c171b4 -r 0fab0d43fd8f mk/gcc.mk
--- a/mk/gcc.mk Thu May 24 17:23:36 2007 -0400
+++ b/mk/gcc.mk Thu May 24 17:42:33 2007 -0400
@@ -9,3 +9,9 @@ CFLAGS += \
         -Wno-sign-compare \
         -Wno-uninitialized \
         -Wno-unused-parameter \
+ -Wimplicit \
+ -Wreturn-type \
+ -Wtrigraphs \
+ -Wstrict-prototypes \
+ -Wmissing-prototypes \
+ -Wpointer-arith \
Received on Fri Jun 01 2007 - 03:10:38 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:09 UTC