From 9a8916cff1f7d20f646d9a80931a5a40ac1592a6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 26 Sep 2011 16:07:58 -0700 Subject: Add const attributes to fix gcc -Wwrite-strings warnings Fixes many, but not all, of the warnings raised by this option Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer --- setxkbmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setxkbmap.c b/setxkbmap.c index 9bfe0df..cde779c 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -81,7 +81,7 @@ static Display *dpy; * human-readable versions of FROM_CONFIG, FROM_SERVER, etc. Used for error * reporting. */ -static char *srcName[NUM_SOURCES] = { +static const char *srcName[NUM_SOURCES] = { "undefined", "X server", "rules file", "config file", "command line" }; @@ -174,7 +174,7 @@ static int deviceSpec = XkbUseCoreKbd; /***====================================================================***/ -Bool addToList(list_t *list, char *newVal); +Bool addToList(list_t *list, const char *newVal); void usage(int argc, char **argv); void dumpNames(Bool wantRules, Bool wantCNames); void trySetString(setting_t * setting, char *newVal, enum source src); @@ -199,7 +199,7 @@ void printKeymap(void); */ Bool -addToList(list_t *list, char *newVal) +addToList(list_t *list, const char *newVal) { register int i; @@ -925,7 +925,7 @@ applyRules(void) /* Primitive sanity check - filter out 'map names' (inside parenthesis) */ /* that can confuse xkbcomp parser */ static Bool -checkName(char *name, char *string) +checkName(char *name, const char *string) { char *i = name, *opar = NULL; Bool ret = True; -- cgit v1.2.3