diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-27 11:00:58 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-27 11:01:01 -0800 |
commit | b71eb0361cf556909d88b59ccdb810a137c1efeb (patch) | |
tree | 8f4b6e11487910e07eeaee623e291e04ee41cc6a | |
parent | 6ad0af956bbc328c91fdb2327b43614c7ebbb000 (diff) |
Fix gcc -Wwrite-strings warnings
except for those caused by code generated by bison/yacc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | cfgscan.c | 6 | ||||
-rw-r--r-- | printev.c | 6 | ||||
-rw-r--r-- | xkbevd.c | 8 | ||||
-rw-r--r-- | xkbevd.h | 2 |
4 files changed, 11 insertions, 11 deletions
@@ -106,7 +106,7 @@ static char buf[32]; #endif int -setScanState(char *file, int line) +setScanState(const char *file, int line) { if (file!=NULL) strncpy(scanFile,file,1024); @@ -240,8 +240,8 @@ int ch; } static struct _Keyword { - char *keyword; - int token; + const char *keyword; + int token; } keywords[] = { { "bell", BELL }, { "accessx", ACCESSX }, @@ -46,7 +46,7 @@ static char name[20]; } static void -xkb_prologue (FILE *file, XkbEvent *ev, char *name) +xkb_prologue (FILE *file, XkbEvent *ev, const char *name) { XkbAnyEvent *e = &ev->any; @@ -91,7 +91,7 @@ do_XkbStateNotify(FILE *file, XkbEvent *xkbev) } static void -do_map_message(char *what, int first, int num, int eol) +do_map_message(const char *what, int first, int num, int eol) { if (num>1) printf("%ss %d..%d changed%s",what,first,first+num-1,(eol?"\n":"")); @@ -182,7 +182,7 @@ static void do_XkbAccessXNotify(FILE *file, XkbEvent *xkbev) { XkbAccessXNotifyEvent *sk = &xkbev->accessx; - char *detail; + const char *detail; switch (sk->detail) { case XkbAXN_SKPress: detail= "skpress"; break; case XkbAXN_SKAccept: detail= "skaccept"; break; @@ -58,7 +58,7 @@ static char * dpyName= NULL; Display * dpy= NULL; -static char * cfgFileName= NULL; +static const char * cfgFileName= NULL; int xkbOpcode= 0; int xkbEventCode= 0; Bool detectableRepeat= False; @@ -72,8 +72,8 @@ static Bool synch= False; static int verbose= 0; static Bool background= False; -static char * soundCmd= NULL; -static char * soundDir= NULL; +static const char * soundCmd= NULL; +static const char * soundDir= NULL; XkbDescPtr xkb= NULL; @@ -474,7 +474,7 @@ Bool ok; cfgFileName= buf; } if (uStringEqual(cfgFileName,"-")) { - static char *in= "stdin"; + static const char *in= "stdin"; file= stdin; cfgFileName= in; } @@ -93,7 +93,7 @@ extern void PrintXkbEvent( XkbEvent * /* ev */ ); -extern int setScanState ( char * file, int line ); +extern int setScanState ( const char * file, int line ); extern int CFGParseFile ( FILE *file ); extern int yylex(void); |