summary refs log tree commit diff
diff options
context:
space:
mode:
authoroga <oga>2009-01-11 21:46:48 +0000
committeroga <oga>2009-01-11 21:46:48 +0000
commitd1050afb6001ef6134b816b21867466195153ecb (patch)
treec842d242d3dcfb4144c9594ae96926a29d76614a
parentdcfae161a2a0d58ece35336c0749079fcbf77097 (diff)
downloadcwm-d1050afb6001ef6134b816b21867466195153ecb.tar.gz
cwm-d1050afb6001ef6134b816b21867466195153ecb.tar.xz
cwm-d1050afb6001ef6134b816b21867466195153ecb.zip
shortcut_to_name should not be defined as static in a header file. Put
it in group.c where it it used most, and add an extern definition for
the other users of it.

Found by gcc -Wall. ok okan@
-rw-r--r--calmwm.h6
-rw-r--r--group.c5
-rw-r--r--parse.y2
3 files changed, 6 insertions, 7 deletions
diff --git a/calmwm.h b/calmwm.h
index 9726cbc..ab9c72c 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -140,11 +140,7 @@ struct client_ctx {
 
 TAILQ_HEAD(client_ctx_q, client_ctx);
 
-static char *shortcut_to_name[] = {
-	"nogroup", "one", "two", "three",
-	"four", "five", "six", "seven",
-	"eight", "nine"
-};
+extern const char *shortcut_to_name[];
 
 struct group_ctx {
 	TAILQ_ENTRY(group_ctx)	 entry;
diff --git a/group.c b/group.c
index 2b02b66..c9300e4 100644
--- a/group.c
+++ b/group.c
@@ -29,6 +29,11 @@ struct group_ctx	 Groups[CALMWM_NGROUPS];
 int			 Grouphideall = 0;
 struct group_ctx_q	 Groupq;
 
+const char *shortcut_to_name[] = {
+        "nogroup", "one", "two", "three", "four", "five", "six",
+        "seven", "eight", "nine"
+};
+
 static void
 _group_add(struct group_ctx *gc, struct client_ctx *cc)
 {
diff --git a/parse.y b/parse.y
index d0d05d7..9e69b91 100644
--- a/parse.y
+++ b/parse.y
@@ -54,8 +54,6 @@ int			 findeol(void);
 
 static struct conf	*conf;
 
-extern char		*shortcut_to_name[];
-
 typedef struct {
 	union {
 		int64_t			 number;