summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-27 11:00:58 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-27 11:01:01 -0800
commitb71eb0361cf556909d88b59ccdb810a137c1efeb (patch)
tree8f4b6e11487910e07eeaee623e291e04ee41cc6a
parent6ad0af956bbc328c91fdb2327b43614c7ebbb000 (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.c6
-rw-r--r--printev.c6
-rw-r--r--xkbevd.c8
-rw-r--r--xkbevd.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/cfgscan.c b/cfgscan.c
index 29df118..ac369ae 100644
--- a/cfgscan.c
+++ b/cfgscan.c
@@ -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 },
diff --git a/printev.c b/printev.c
index 99d3c72..a66237f 100644
--- a/printev.c
+++ b/printev.c
@@ -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;
diff --git a/xkbevd.c b/xkbevd.c
index b711195..4776570 100644
--- a/xkbevd.c
+++ b/xkbevd.c
@@ -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;
}
diff --git a/xkbevd.h b/xkbevd.h
index c938800..ac206a0 100644
--- a/xkbevd.h
+++ b/xkbevd.h
@@ -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);