summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2014-01-21 15:42:44 +0000
committerokan <okan>2014-01-21 15:42:44 +0000
commitac3162439ad826026b499363b445e8c533313ff2 (patch)
tree8d607c4a188c441527ab65ca03094cad709a5b38
parent83f9ef884a07fc5b408aae2e7ccefbac33cb379f (diff)
downloadcwm-ac3162439ad826026b499363b445e8c533313ff2.tar.gz
cwm-ac3162439ad826026b499363b445e8c533313ff2.tar.xz
cwm-ac3162439ad826026b499363b445e8c533313ff2.zip
Sprinkle a few more const; from Tiago Cunha.
-rw-r--r--calmwm.c2
-rw-r--r--calmwm.h4
-rw-r--r--conf.c22
-rw-r--r--kbfunc.c3
-rw-r--r--menu.c4
5 files changed, 18 insertions, 17 deletions
diff --git a/calmwm.c b/calmwm.c
index 8e810bd..75bb675 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -46,7 +46,7 @@ struct client_ctx_q		 Clientq = TAILQ_HEAD_INITIALIZER(Clientq);
 
 int				 HasRandr, Randr_ev;
 struct conf			 Conf;
-char				*homedir;
+const char			*homedir;
 
 static void	sigchld_cb(int);
 static int	x_errorhandler(Display *, XErrorEvent *);
diff --git a/calmwm.h b/calmwm.h
index 54c6d17..408e098 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -325,7 +325,7 @@ extern Time				 Last_Event_Time;
 extern struct screen_ctx_q		 Screenq;
 extern struct client_ctx_q		 Clientq;
 extern struct conf			 Conf;
-extern char				*homedir;
+extern const char			*homedir;
 extern int				 HasRandr, Randr_ev;
 
 enum {
@@ -502,7 +502,7 @@ void			 mousefunc_menu_unhide(struct client_ctx *,
     			    union arg *);
 
 struct menu  		*menu_filter(struct screen_ctx *, struct menu_q *,
-			     char *, char *, int,
+			     const char *, const char *, int,
 			     void (*)(struct menu_q *, struct menu_q *, char *),
 			     void (*)(struct menu *, int));
 void			 menuq_add(struct menu_q *, void *, const char *, ...);
diff --git a/conf.c b/conf.c
index 4f90a45..8f0258f 100644
--- a/conf.c
+++ b/conf.c
@@ -85,7 +85,7 @@ conf_ignore(struct conf *c, const char *val)
 	TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry);
 }
 
-static char *color_binds[] = {
+static const char *color_binds[] = {
 	"#CCCCCC",	/* CWM_COLOR_BORDER_ACTIVE */
 	"#666666",	/* CWM_COLOR_BORDER_INACTIVE */
 	"#FC8814",	/* CWM_COLOR_BORDER_URGENCY */
@@ -147,9 +147,9 @@ conf_screen(struct screen_ctx *sc)
 	conf_grab_kbd(sc->rootwin);
 }
 
-static struct {
-	char	*key;
-	char	*func;
+static const struct {
+	const char	*key;
+	const char	*func;
 } kbd_binds[] = {
 	{ "CM-Return",	"terminal" },
 	{ "CM-Delete",	"lock" },
@@ -318,8 +318,8 @@ conf_client(struct client_ctx *cc)
 	cc->flags |= ignore ? CLIENT_IGNORE : 0;
 }
 
-static struct {
-	char		*tag;
+static const struct {
+	const char	*tag;
 	void		 (*handler)(struct client_ctx *, union arg *);
 	int		 flags;
 	union arg	 argument;
@@ -432,9 +432,9 @@ static struct {
 	{ "vtile", kbfunc_tile, CWM_WIN, {.i = CWM_TILE_VERT} },
 };
 
-static struct {
-	char	ch;
-	int	mask;
+static const struct {
+	const char	ch;
+	int		mask;
 } bind_mods[] = {
 	{ 'C',	ControlMask },
 	{ 'M',	Mod1Mask },
@@ -525,8 +525,8 @@ conf_unbind_kbd(struct conf *c, struct keybinding *unbind)
 	}
 }
 
-static struct {
-	char		*tag;
+static const struct {
+	const char	*tag;
 	void		 (*handler)(struct client_ctx *, union arg *);
 	int		 flags;
 	union arg	 argument;
diff --git a/kbfunc.c b/kbfunc.c
index e8166ad..f93acc4 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -229,8 +229,9 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
 {
 #define NPATHS 256
 	struct screen_ctx	*sc = cc->sc;
-	char			**ap, *paths[NPATHS], *path, *pathcpy, *label;
+	char			**ap, *paths[NPATHS], *path, *pathcpy;
 	char			 tpath[MAXPATHLEN];
+	const char		*label;
 	DIR			*dirp;
 	struct dirent		*dp;
 	struct menu		*mi;
diff --git a/menu.c b/menu.c
index 526b37b..7a35ddd 100644
--- a/menu.c
+++ b/menu.c
@@ -78,8 +78,8 @@ static struct menu 	*menu_complete_path(struct menu_ctx *);
 static int		 menu_keycode(XKeyEvent *, enum ctltype *, char *);
 
 struct menu *
-menu_filter(struct screen_ctx *sc, struct menu_q *menuq, char *prompt,
-    char *initial, int flags,
+menu_filter(struct screen_ctx *sc, struct menu_q *menuq, const char *prompt,
+    const char *initial, int flags,
     void (*match)(struct menu_q *, struct menu_q *, char *),
     void (*print)(struct menu *, int))
 {