summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-03 21:18:56 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-23 12:15:06 -0800
commitf8dd5efb673439e7e9f7d82e6f9cfb97afacc85a (patch)
tree23f05fbd009552ad45b4398dc71d5e89bc4e808d /xkb
parentcccafabd56d0f8e5784ea0ad9fdc03224f952bfe (diff)
Mark XKB char * as const to clean up gcc -Wwrite-strings warnings
Cleans up around 120 warnings from this set Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'xkb')
-rw-r--r--xkb/ddxList.c2
-rw-r--r--xkb/maprules.c2
-rw-r--r--xkb/xkbInit.c4
-rw-r--r--xkb/xkbfmisc.c2
-rw-r--r--xkb/xkbout.c6
-rw-r--r--xkb/xkbtext.c20
6 files changed, 18 insertions, 18 deletions
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index e599f9169..db34c8df5 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -60,7 +60,7 @@ extern int Win32System(const char *cmdline);
/***====================================================================***/
-static char *componentDirs[_XkbListNumComponents] = {
+static const char *componentDirs[_XkbListNumComponents] = {
"keycodes", "types", "compat", "symbols", "geometry"
};
diff --git a/xkb/maprules.c b/xkb/maprules.c
index a14fbbb2a..66800478c 100644
--- a/xkb/maprules.c
+++ b/xkb/maprules.c
@@ -200,7 +200,7 @@ Bool endOfFile,spacePending,slashPending,inComment;
#define PART_MASK 0x000F
#define COMPONENT_MASK 0x03F0
-static char * cname[MAX_WORDS] = {
+static const char * cname[MAX_WORDS] = {
"model", "layout", "variant", "option",
"keycodes", "symbols", "types", "compat", "geometry"
};
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 3d3febb4f..1ec4e55c6 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -88,8 +88,8 @@ typedef struct _SrvXkmInfo {
#define XKB_DFLT_RULES_PROP TRUE
#endif
-char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
-char * XkbBinDirectory= XKB_BIN_DIRECTORY;
+const char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
+const char * XkbBinDirectory= XKB_BIN_DIRECTORY;
static int XkbWantAccessX= 0;
static char * XkbRulesDflt= NULL;
diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c
index d8202b496..782b823bb 100644
--- a/xkb/xkbfmisc.c
+++ b/xkb/xkbfmisc.c
@@ -146,7 +146,7 @@ unsigned set,rtrn;
/***===================================================================***/
static Bool
-XkbWriteSectionFromName(FILE *file,char *sectionName,char *name)
+XkbWriteSectionFromName(FILE *file,const char *sectionName,const char *name)
{
fprintf(file," xkb_%-20s { include \"%s\" };\n",sectionName,name);
return TRUE;
diff --git a/xkb/xkbout.c b/xkb/xkbout.c
index 082c85ee9..889d5cc39 100644
--- a/xkb/xkbout.c
+++ b/xkb/xkbout.c
@@ -108,7 +108,7 @@ XkbWriteXKBKeycodes( FILE * file,
{
Atom kcName;
register unsigned i;
-char * alternate;
+const char * alternate;
if ((!xkb)||(!xkb->names)||(!xkb->names->keys)) {
_XkbLibError(_XkbErrMissingNames,"XkbWriteXKBKeycodes",0);
@@ -133,7 +133,7 @@ char * alternate;
}
if (xkb->indicators!=NULL) {
for (i=0;i<XkbNumIndicators;i++) {
- char *type;
+ const char *type;
if (xkb->indicators->phys_indicators&(1<<i))
type= " ";
else type= " virtual ";
@@ -395,7 +395,7 @@ Bool showActions;
(showImplicit)) {
int typeNdx,g;
Bool multi;
- char * comment=" ";
+ const char * comment=" ";
if ((srv->explicit[i]&XkbExplicitKeyTypesMask)==0)
comment= "//";
diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index f31f53ae3..8ef2b05b0 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -215,7 +215,7 @@ char *str,buf[BUFFER_SIZE];
return rtrn;
}
-static char *modNames[XkbNumModifiers] = {
+static const char *modNames[XkbNumModifiers] = {
"Shift", "Lock", "Control", "Mod1", "Mod2", "Mod3", "Mod4", "Mod5"
};
@@ -367,15 +367,15 @@ char *buf;
/***====================================================================***/
-static char *siMatchText[5] = {
+static const char *siMatchText[5] = {
"NoneOf", "AnyOfOrNone", "AnyOf", "AllOf", "Exactly"
};
-char *
+const char *
XkbSIMatchText(unsigned type,unsigned format)
{
static char buf[40];
-char *rtrn;
+const char *rtrn;
switch (type&XkbSI_OpMask) {
case XkbSI_NoneOf: rtrn= siMatchText[0]; break;
@@ -397,7 +397,7 @@ char *rtrn;
/***====================================================================***/
-static char *imWhichNames[]= {
+static const char *imWhichNames[]= {
"base",
"latched",
"locked",
@@ -448,7 +448,7 @@ char * buf;
return buf;
}
-static char *ctrlNames[] = {
+static const char *ctrlNames[] = {
"repeatKeys",
"slowKeys",
"bounceKeys",
@@ -616,7 +616,7 @@ char * buf;
return buf;
}
-static char *actionTypeNames[XkbSA_NumActions]= {
+static const char *actionTypeNames[XkbSA_NumActions]= {
"NoAction",
"SetMods", "LatchMods", "LockMods",
"SetGroup", "LatchGroup", "LockGroup",
@@ -631,11 +631,11 @@ static char *actionTypeNames[XkbSA_NumActions]= {
"DeviceBtn", "LockDeviceBtn"
};
-char *
+const char *
XkbActionTypeText(unsigned type,unsigned format)
{
static char buf[32];
-char *rtrn;
+const char *rtrn;
if (type<=XkbSA_LastAction) {
rtrn= actionTypeNames[type];
@@ -652,7 +652,7 @@ char *rtrn;
/***====================================================================***/
static int
-TryCopyStr(char *to,char *from,int *pLeft)
+TryCopyStr(char *to,const char *from,int *pLeft)
{
register int len;
if (*pLeft>0) {