summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2009-06-26 12:21:58 +0000
committerokan <okan>2009-06-26 12:21:58 +0000
commitf44862be9c4d3332d3f9ee9760e7014814eaeeb3 (patch)
treee4f8b3c240f5bfe6b496f10fd61cec1cc6b98954
parentb13d592c572bde4a2b2039e7ef30e501ac97a21a (diff)
downloadcwm-f44862be9c4d3332d3f9ee9760e7014814eaeeb3.tar.gz
cwm-f44862be9c4d3332d3f9ee9760e7014814eaeeb3.tar.xz
cwm-f44862be9c4d3332d3f9ee9760e7014814eaeeb3.zip
static local functions and data; almost identical diff from Thomas Pfaff
ok oga@
-rw-r--r--calmwm.c13
-rw-r--r--calmwm.h9
-rw-r--r--client.c20
-rw-r--r--conf.c11
-rw-r--r--menu.c6
-rw-r--r--screen.c1
-rw-r--r--xutil.c2
7 files changed, 30 insertions, 32 deletions
diff --git a/calmwm.c b/calmwm.c
index b87b1a6..b9d29d0 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -40,6 +40,7 @@ struct conf			 Conf;
 
 static void	sigchld_cb(int);
 static void	dpy_init(const char *);
+static int	x_errorhandler(Display *, XErrorEvent *);
 static void	x_setup(void);
 static void	x_setupscreen(struct screen_ctx *, u_int);
 static void	x_teardown(void);
@@ -89,7 +90,7 @@ main(int argc, char **argv)
 	return (0);
 }
 
-void
+static void
 dpy_init(const char *dpyname)
 {
 	int	i;
@@ -103,7 +104,7 @@ dpy_init(const char *dpyname)
 	HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
 }
 
-void
+static void
 x_setup(void)
 {
 	struct screen_ctx	*sc;
@@ -130,7 +131,7 @@ x_setup(void)
 	Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
 }
 
-void
+static void
 x_teardown(void)
 {
 	struct screen_ctx	*sc;
@@ -141,7 +142,7 @@ x_teardown(void)
 	XCloseDisplay(X_Dpy);
 }
 
-void
+static void
 x_setupscreen(struct screen_ctx *sc, u_int which)
 {
 	Window			*wins, w0, w1;
@@ -200,11 +201,9 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
 	screen_init_xinerama(sc);
 
 	XSync(X_Dpy, False);
-
-	return;
 }
 
-int
+static int
 x_errorhandler(Display *dpy, XErrorEvent *e)
 {
 #ifdef DEBUG
diff --git a/calmwm.h b/calmwm.h
index 11fdee0..eb4c0f2 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -324,7 +324,6 @@ struct mwm_hints {
 int			 input_keycodetrans(KeyCode, u_int, enum ctltype *,
 			     char *);
 
-int			 x_errorhandler(Display *, XErrorEvent *);
 __dead void		 usage(void);
 
 struct client_ctx	*client_find(Window);
@@ -346,17 +345,11 @@ void			 client_warp(struct client_ctx *);
 void			 client_ptrwarp(struct client_ctx *);
 void			 client_ptrsave(struct client_ctx *);
 void			 client_draw_border(struct client_ctx *);
-void			 client_update(struct client_ctx *);
-void			 client_placecalc(struct client_ctx *);
 void			 client_maximize(struct client_ctx *);
 void			 client_vertmaximize(struct client_ctx *);
 void			 client_map(struct client_ctx *);
 void			 client_mtf(struct client_ctx *);
 struct client_ctx	*client_cycle(int);
-struct client_ctx	*client_mrunext(struct client_ctx *);
-struct client_ctx	*client_mruprev(struct client_ctx *);
-void			 client_gethints(struct client_ctx *);
-void			 client_freehints(struct client_ctx *);
 
 struct menu  		*menu_filter(struct menu_q *, char *, char *, int,
 			     void (*)(struct menu_q *, struct menu_q *, char *),
@@ -407,9 +400,7 @@ void			 conf_client(struct client_ctx *);
 void			 conf_grab(struct conf *, struct keybinding *);
 void			 conf_ungrab(struct conf *, struct keybinding *);
 void			 conf_bindname(struct conf *, char *, char *);
-void			 conf_unbind(struct conf *, struct keybinding *);
 void			 conf_mousebind(struct conf *, char *, char *);
-void			 conf_mouseunbind(struct conf *, struct mousebinding *);
 void			 conf_grab_mouse(struct client_ctx *);
 void			 conf_reload(struct conf *);
 void			 conf_font(struct conf *);
diff --git a/client.c b/client.c
index 6de3758..087a991 100644
--- a/client.c
+++ b/client.c
@@ -21,7 +21,13 @@
 #include "headers.h"
 #include "calmwm.h"
 
-static int		 client_inbound(struct client_ctx *, int, int);
+static struct client_ctx	*client_mrunext(struct client_ctx *);
+static struct client_ctx	*client_mruprev(struct client_ctx *);
+static void			 client_placecalc(struct client_ctx *);
+static void			 client_update(struct client_ctx *);
+static void			 client_gethints(struct client_ctx *);
+static void			 client_freehints(struct client_ctx *);
+static int			 client_inbound(struct client_ctx *, int, int);
 
 static char		 emptystring[] = "";
 struct client_ctx	*_curcc = NULL;
@@ -407,7 +413,7 @@ client_draw_border(struct client_ctx *cc)
 	XSetWindowBorder(X_Dpy, cc->win, pixel);
 }
 
-void
+static void
 client_update(struct client_ctx *cc)
 {
 	Atom	*p; 
@@ -522,7 +528,7 @@ client_cycle(int reverse)
 	return (newcc);
 }
 
-struct client_ctx *
+static struct client_ctx *
 client_mrunext(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = CCTOSC(cc);
@@ -532,7 +538,7 @@ client_mrunext(struct client_ctx *cc)
 	    ccc : TAILQ_FIRST(&sc->mruq));
 }
 
-struct client_ctx *
+static struct client_ctx *
 client_mruprev(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = CCTOSC(cc);
@@ -542,7 +548,7 @@ client_mruprev(struct client_ctx *cc)
 	    ccc : TAILQ_LAST(&sc->mruq, cycle_entry_q));
 }
 
-void
+static void
 client_placecalc(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = CCTOSC(cc);
@@ -629,7 +635,7 @@ client_mtf(struct client_ctx *cc)
 	TAILQ_INSERT_HEAD(&sc->mruq, cc, mru_entry);
 }
 
-void
+static void
 client_gethints(struct client_ctx *cc)
 {
 	XClassHint		 xch;
@@ -675,7 +681,7 @@ client_gethints(struct client_ctx *cc)
 	}
 }
 
-void
+static void
 client_freehints(struct client_ctx *cc)
 {
 	if (cc->app_name != NULL)
diff --git a/conf.c b/conf.c
index 3161f8a..f07f382 100644
--- a/conf.c
+++ b/conf.c
@@ -28,6 +28,9 @@
 	    ((tsp)->tv_sec cmp (usp)->tv_sec))
 #endif
 
+static void	 conf_mouseunbind(struct conf *, struct mousebinding *);
+static void	 conf_unbind(struct conf *, struct keybinding *);
+
 extern struct screen_ctx	*Curscreen;
 
 /* Add an command menu entry to the end of the menu */
@@ -278,7 +281,7 @@ conf_client(struct client_ctx *cc)
 	cc->flags |= ignore ? CLIENT_IGNORE : 0;
 }
 
-struct {
+static struct {
 	char		*tag;
 	void		 (*handler)(struct client_ctx *, union arg *);
 	int		 flags;
@@ -493,7 +496,7 @@ conf_bindname(struct conf *c, char *name, char *binding)
 	return;
 }
 
-void
+static void
 conf_unbind(struct conf *c, struct keybinding *unbind)
 {
 	struct keybinding	*key = NULL, *keynxt;
@@ -515,7 +518,7 @@ conf_unbind(struct conf *c, struct keybinding *unbind)
 	}
 }
 
-struct {
+static struct {
 	char *tag;
 	void (*handler)(struct client_ctx *, void *);
 	int context;
@@ -583,7 +586,7 @@ conf_mousebind(struct conf *c, char *name, char *binding)
 	}
 }
 
-void
+static void
 conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
 {
 	struct mousebinding	*mb = NULL, *mbnxt;
diff --git a/menu.c b/menu.c
index ea4a24f..477016e 100644
--- a/menu.c
+++ b/menu.c
@@ -43,7 +43,7 @@ static struct menu	*menu_handle_key(XEvent *, struct menu_ctx *,
 			     struct menu_q *, struct menu_q *);
 static void		 menu_handle_move(XEvent *, struct menu_ctx *,
 			     struct screen_ctx *);
-struct menu		*menu_handle_release(XEvent *, struct menu_ctx *,
+static struct menu	*menu_handle_release(XEvent *, struct menu_ctx *,
 			     struct screen_ctx *, struct menu_q *);
 static void		 menu_draw(struct screen_ctx *, struct menu_ctx *,
 			     struct menu_q *, struct menu_q *);
@@ -349,7 +349,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
 		    0, 0, mc->width, font_height());
 }
 
-void
+static void
 menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
 {
 	mc->prev = mc->entry;
@@ -366,7 +366,7 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
 		xu_ptr_regrab(MenuGrabMask, Cursor_default);
 }
 
-struct menu *
+static struct menu *
 menu_handle_release(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc,
     struct menu_q *resultq)
 {
diff --git a/screen.c b/screen.c
index fe9a61e..e538cd8 100644
--- a/screen.c
+++ b/screen.c
@@ -21,7 +21,6 @@
 #include "headers.h"
 #include "calmwm.h"
 
-extern struct screen_ctx_q	 Screenq;
 extern struct screen_ctx	*Curscreen;
 
 void
diff --git a/xutil.c b/xutil.c
index 90b90d5..a6caed4 100644
--- a/xutil.c
+++ b/xutil.c
@@ -21,7 +21,7 @@
 #include "headers.h"
 #include "calmwm.h"
 
-unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
+static unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
 
 int
 xu_ptr_grab(Window win, int mask, Cursor curs)