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>
This commit is contained in:
Alan Coopersmith 2011-11-03 21:18:56 -07:00
parent cccafabd56
commit f8dd5efb67
8 changed files with 22 additions and 22 deletions

View File

@ -136,7 +136,7 @@ extern _X_EXPORT char * XkbConfigText(
unsigned /* format */
);
extern _X_EXPORT char * XkbSIMatchText(
extern _X_EXPORT const char * XkbSIMatchText(
unsigned /* type */,
unsigned /* format */
);
@ -161,7 +161,7 @@ extern _X_EXPORT char * XkbDoodadTypeText(
unsigned /* format */
);
extern _X_EXPORT char * XkbActionTypeText(
extern _X_EXPORT const char * XkbActionTypeText(
unsigned /* type */,
unsigned /* format */
);

View File

@ -296,8 +296,8 @@ extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer);
extern _X_EXPORT int XkbReqCode;
extern _X_EXPORT int XkbEventBase;
extern _X_EXPORT int XkbKeyboardErrorCode;
extern _X_EXPORT char * XkbBaseDirectory;
extern _X_EXPORT char * XkbBinDirectory;
extern _X_EXPORT const char * XkbBaseDirectory;
extern _X_EXPORT const char * XkbBinDirectory;
extern _X_EXPORT CARD32 xkbDebugFlags;

View File

@ -60,7 +60,7 @@ extern int Win32System(const char *cmdline);
/***====================================================================***/
static char *componentDirs[_XkbListNumComponents] = {
static const char *componentDirs[_XkbListNumComponents] = {
"keycodes", "types", "compat", "symbols", "geometry"
};

View File

@ -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"
};

View File

@ -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;

View File

@ -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;

View File

@ -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= "//";

View File

@ -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) {