diff --git a/include/X11/Xlib.h b/include/X11/Xlib.h index a26789b..2bf5e54 100644 --- a/include/X11/Xlib.h +++ b/include/X11/Xlib.h @@ -1383,7 +1383,7 @@ typedef unsigned long XIMHotKeyState; typedef struct { unsigned short count_values; - char **supported_values; + _Xconst char **supported_values; } XIMValuesList; _XFUNCPROTOBEGIN @@ -1515,7 +1515,7 @@ extern char *XGetDefault( _Xconst char* /* program */, _Xconst char* /* option */ ); -extern char *XDisplayName( +extern _Xconst char *XDisplayName( _Xconst char* /* string */ ); extern char *XKeysymToString( diff --git a/modules/im/ximcp/imDefIm.c b/modules/im/ximcp/imDefIm.c index a1c83a9..4ce03ba 100644 --- a/modules/im/ximcp/imDefIm.c +++ b/modules/im/ximcp/imDefIm.c @@ -169,7 +169,7 @@ Private Bool _XimCheckTransport( char *address, int address_len, - char *transport, + const char *transport, int len, char **trans_addr) { diff --git a/modules/im/ximcp/imExten.c b/modules/im/ximcp/imExten.c index 782d1c3..1556915 100644 --- a/modules/im/ximcp/imExten.c +++ b/modules/im/ximcp/imExten.c @@ -51,7 +51,7 @@ PERFORMANCE OF THIS SOFTWARE. typedef struct _XIM_QueryExtRec { Bool is_support; - char *name; + const char *name; int name_len; CARD16 major_opcode; CARD16 minor_opcode; diff --git a/modules/im/ximcp/imInt.c b/modules/im/ximcp/imInt.c index 5a047e4..c759cf3 100644 --- a/modules/im/ximcp/imInt.c +++ b/modules/im/ximcp/imInt.c @@ -151,10 +151,10 @@ _XimServerReconectableDestroy() } #endif /* XIM_CONNECTABLE */ -Private char * +Private const char * _XimStrstr( - register char *src, - register char *dest) + register const char *src, + register const char *dest) { int len; @@ -171,10 +171,10 @@ Private char * _XimMakeImName( XLCd lcd) { - char* begin = NULL; - char* end = NULL; + const char* begin = NULL; + const char* end = NULL; char* ret = NULL; - char* ximmodifier = XIMMODIFIER; + const char* ximmodifier = XIMMODIFIER; if(lcd->core->modifiers != NULL && *lcd->core->modifiers != '\0') { begin = _XimStrstr(lcd->core->modifiers, ximmodifier); diff --git a/modules/im/ximcp/imLcPrs.c b/modules/im/ximcp/imLcPrs.c index d24a984..ac53324 100644 --- a/modules/im/ximcp/imLcPrs.c +++ b/modules/im/ximcp/imLcPrs.c @@ -281,7 +281,7 @@ modmask( long mask; struct _modtbl { - char *name; + const char *name; long mask; }; struct _modtbl *p; diff --git a/modules/im/ximcp/imRm.c b/modules/im/ximcp/imRm.c index 0ea4d11..65c10b5 100644 --- a/modules/im/ximcp/imRm.c +++ b/modules/im/ximcp/imRm.c @@ -43,7 +43,7 @@ PERFORMANCE OF THIS SOFTWARE. #include "Xresource.h" typedef struct _XimValueOffsetInfo { - char *name; + const char *name; XrmQuark quark; unsigned int offset; Bool (*defaults)( @@ -206,7 +206,7 @@ _XimSetProtoResource(im) } #endif /* XIM_CONNECTABLE */ -static char *supported_local_im_values_list[] = { +static const char *supported_local_im_values_list[] = { XNQueryInputStyle, XNResourceName, XNResourceClass, @@ -214,10 +214,10 @@ static char *supported_local_im_values_list[] = { XNQueryIMValuesList, XNQueryICValuesList, XNVisiblePosition, - (char *)NULL + NULL }; -static char *supported_local_ic_values_list[] = { +static const char *supported_local_ic_values_list[] = { XNInputStyle, XNClientWindow, XNFocusWindow, @@ -253,7 +253,7 @@ static char *supported_local_ic_values_list[] = { XNStatusDrawCallback, XNPreeditState, XNPreeditStateNotifyCallback, - (char *)NULL + NULL }; static XIMStyle const supported_local_styles[] = { @@ -323,7 +323,7 @@ _XimDefaultIMValues( if (n > 0) { values_list->count_values = (unsigned short)n; values_list->supported_values - = (char **)((char *)tmp + sizeof(XIMValuesList)); + = (const char **)((char *)tmp + sizeof(XIMValuesList)); for(i = 0; i < n; i++) { values_list->supported_values[i] = supported_local_im_values_list[i]; @@ -360,7 +360,7 @@ _XimDefaultICValues( if (n > 0) { values_list->count_values = (unsigned short)n; values_list->supported_values - = (char **)((char *)tmp + sizeof(XIMValuesList)); + = (const char **)((char *)tmp + sizeof(XIMValuesList)); for(i = 0; i < n; i++) { values_list->supported_values[i] = supported_local_ic_values_list[i]; @@ -1050,7 +1050,7 @@ _XimDecodeValues( out = (XIMValuesList *)tmp; if(num) { out->count_values = (unsigned short)num; - out->supported_values = (char **)((char *)tmp + sizeof(XIMValuesList)); + out->supported_values = (const char **)((char *)tmp + sizeof(XIMValuesList)); for(i = 0; i < num; i++) { out->supported_values[i] = values_list->supported_values[i]; @@ -1655,7 +1655,7 @@ static XimValueOffsetInfoRec ic_sts_attr_info[] = { }; typedef struct _XimIMMode { - char *name; + const char *name; XrmQuark quark; unsigned short mode; } XimIMMode; @@ -1678,7 +1678,7 @@ static XimIMMode im_mode[] = { }; typedef struct _XimICMode { - char *name; + const char *name; XrmQuark quark; unsigned short preedit_callback_mode; unsigned short preedit_position_mode; @@ -2156,7 +2156,7 @@ Public XIMResourceList _XimGetResourceListRec( XIMResourceList res_list, unsigned int list_num, - char *name) + const char *name) { XrmQuark quark = XrmStringToQuark(name); diff --git a/modules/im/ximcp/imRmAttr.c b/modules/im/ximcp/imRmAttr.c index af4db3d..db3b8bd 100644 --- a/modules/im/ximcp/imRmAttr.c +++ b/modules/im/ximcp/imRmAttr.c @@ -1412,7 +1412,7 @@ _XimGetAttributeID( int names_len; XPointer tmp; XIMValuesList *values_list; - char **values; + const char **values; int values_len; register int i; INT16 len; @@ -1437,7 +1437,7 @@ _XimGetAttributeID( bzero(tmp, values_len); values_list = (XIMValuesList *)tmp; - values = (char **)((char *)tmp + sizeof(XIMValuesList)); + values = (const char **)((char *)tmp + sizeof(XIMValuesList)); names = (char *)((char *)values + (sizeof(char **) * n)); values_list->count_values = n; @@ -1484,7 +1484,7 @@ _XimGetAttributeID( bzero(tmp, values_len); values_list = (XIMValuesList *)tmp; - values = (char **)((char *)tmp + sizeof(XIMValuesList)); + values = (const char **)((char *)tmp + sizeof(XIMValuesList)); names = (char *)((char *)values + (sizeof(char **) * n)); values_list->count_values = n; diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c index 76e7d0f..96b17b8 100644 --- a/modules/lc/gen/lcGenConv.c +++ b/modules/lc/gen/lcGenConv.c @@ -60,8 +60,8 @@ #endif typedef struct _CTDataRec { - char *name; - char *encoding; /* Compound Text encoding */ + const char *name; + const char *encoding; /* Compound Text encoding */ } CTDataRec, *CTData; static CTDataRec directionality_data[] = diff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c index e6c23f4..3a813b3 100644 --- a/modules/om/generic/omGeneric.c +++ b/modules/om/generic/omGeneric.c @@ -1616,7 +1616,7 @@ static XOCMethodsRec oc_generic_methods = { }; typedef struct _XOCMethodsListRec { - char *name; + const char *name; XOCMethods methods; } XOCMethodsListRec, *XOCMethodsList; diff --git a/modules/om/generic/omXChar.c b/modules/om/generic/omXChar.c index 4afafd4..c910cfe 100644 --- a/modules/om/generic/omXChar.c +++ b/modules/om/generic/omXChar.c @@ -438,7 +438,7 @@ _XomInitConverter( { XOCGenericPart *gen = XOC_GENERIC(oc); XlcConv *convp; - char *conv_type; + const char *conv_type; XlcConv conv; XLCd lcd; diff --git a/src/CrGlCur.c b/src/CrGlCur.c index 32dee8c..423de75 100644 --- a/src/CrGlCur.c +++ b/src/CrGlCur.c @@ -82,10 +82,10 @@ open_library (void) } static void * -fetch_symbol (XModuleType module, char *under_symbol) +fetch_symbol (XModuleType module, const char *under_symbol) { void *result = NULL; - char *symbol = under_symbol + 1; + const char *symbol = under_symbol + 1; #if defined(hpux) int getsyms_cnt, i; struct shl_symbol *symbols; diff --git a/src/DisName.c b/src/DisName.c index 59b5b3e..88b6634 100644 --- a/src/DisName.c +++ b/src/DisName.c @@ -53,13 +53,13 @@ from The Open Group. #include #include "Xlib.h" -char * +_Xconst char * XDisplayName( _Xconst char *display) { char *d; if ( display != (char *)NULL && *display != '\0' ) - return( (char *)display ); + return display; if ( (d = getenv( "DISPLAY" )) != (char *)NULL ) return( d ); return( "" ); diff --git a/src/Font.c b/src/Font.c index 5dc5773..9e5d0a6 100644 --- a/src/Font.c +++ b/src/Font.c @@ -678,7 +678,7 @@ int _XF86LoadQueryLocaleFont( Font *fidp) { int l; - char *charset, *p; + const char *charset, *p; char buf[256]; XFontStruct *fs; XLCd lcd; diff --git a/src/GetDflt.c b/src/GetDflt.c index 8a85633..2098e81 100644 --- a/src/GetDflt.c +++ b/src/GetDflt.c @@ -164,7 +164,7 @@ InitDefaults( */ if (dpy->xdefaults == NULL) { - char *slashDotXdefaults = "/.Xdefaults"; + const char *slashDotXdefaults = "/.Xdefaults"; (void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaults) - 1); (void) strcat (fname, slashDotXdefaults); @@ -174,7 +174,7 @@ InitDefaults( } if (!(xenv = getenv ("XENVIRONMENT"))) { - char *slashDotXdefaultsDash = "/.Xdefaults-"; + const char *slashDotXdefaultsDash = "/.Xdefaults-"; int len; (void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaultsDash) - 1); diff --git a/src/ParseCmd.c b/src/ParseCmd.c index ddcbf78..fb79668 100644 --- a/src/ParseCmd.c +++ b/src/ParseCmd.c @@ -65,7 +65,7 @@ SOFTWARE. #include -static void _XReportParseError(XrmOptionDescRec *arg, char *msg) +static void _XReportParseError(XrmOptionDescRec *arg, const char *msg) { (void) fprintf(stderr, "Error parsing argument \"%s\" (%s); %s\n", arg->option, arg->specifier, msg); diff --git a/src/StrKeysym.c b/src/StrKeysym.c index 74ccecb..a6d7b2d 100644 --- a/src/StrKeysym.c +++ b/src/StrKeysym.c @@ -55,7 +55,7 @@ _XInitKeysymDB(void) { if (!initialized) { - char *dbname; + const char *dbname; XrmInitialize(); /* use and name of this env var is not part of the standard */ diff --git a/src/XlibInt.c b/src/XlibInt.c index a6166f2..1d025c7 100644 --- a/src/XlibInt.c +++ b/src/XlibInt.c @@ -2742,7 +2742,7 @@ static int _XPrintDefaultError( char buffer[BUFSIZ]; char mesg[BUFSIZ]; char number[32]; - char *mtype = "XlibMessage"; + const char *mtype = "XlibMessage"; register _XExtension *ext = (_XExtension *)NULL; _XExtension *bext = (_XExtension *)NULL; XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); diff --git a/src/imConv.c b/src/imConv.c index f519401..06042b9 100644 --- a/src/imConv.c +++ b/src/imConv.c @@ -67,8 +67,8 @@ typedef int (*ucstocsConvProc)( ); struct SubstRec { - char* encoding_name; - char* charset_name; + const char* encoding_name; + const char* charset_name; }; static struct SubstRec SubstTable[] = { diff --git a/src/xcms/cmsColNm.c b/src/xcms/cmsColNm.c index 87f2652..c48b85a 100644 --- a/src/xcms/cmsColNm.c +++ b/src/xcms/cmsColNm.c @@ -709,7 +709,7 @@ LoadColornameDB(void) { int size; FILE *stream; - char *pathname; + const char *pathname; struct stat txt; int length; diff --git a/src/xkb/XKBCvt.c b/src/xkb/XKBCvt.c index 1bdf81c..9ac438e 100644 --- a/src/xkb/XKBCvt.c +++ b/src/xkb/XKBCvt.c @@ -189,7 +189,7 @@ Strcmp(char *str1, char *str2) #endif int -_XkbGetConverters(char *encoding_name, XkbConverters *cvt_rtrn) +_XkbGetConverters(const char *encoding_name, XkbConverters *cvt_rtrn) { if ( !cvt_rtrn ) return 0; diff --git a/src/xkb/XKBlibint.h b/src/xkb/XKBlibint.h index a154d1b..ededdaa 100644 --- a/src/xkb/XKBlibint.h +++ b/src/xkb/XKBlibint.h @@ -297,8 +297,8 @@ extern char *_XkbGetCharset( ); extern int _XkbGetConverters( - char * /* encoding_name */, - XkbConverters * /* cvt_rtrn */ + const char * /* encoding_name */, + XkbConverters * /* cvt_rtrn */ ); #ifdef NEED_MAP_READERS diff --git a/src/xlibi18n/XimTrInt.h b/src/xlibi18n/XimTrInt.h index cc1cabf..cab201d 100644 --- a/src/xlibi18n/XimTrInt.h +++ b/src/xlibi18n/XimTrInt.h @@ -36,7 +36,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include "Ximint.h" typedef struct { - char *transportname; + const char *transportname; Bool (*config)( Xim, char * diff --git a/src/xlibi18n/Ximint.h b/src/xlibi18n/Ximint.h index 4aca3c8..3cbcfc4 100644 --- a/src/xlibi18n/Ximint.h +++ b/src/xlibi18n/Ximint.h @@ -229,7 +229,7 @@ extern Bool _XimCheckCreateICValues( extern XIMResourceList _XimGetResourceListRec( XIMResourceList res_list, unsigned int list_num, - char *name + const char *name ); extern void _XimSetIMMode( diff --git a/src/xlibi18n/Xlcint.h b/src/xlibi18n/Xlcint.h index fcc3a65..53704c5 100644 --- a/src/xlibi18n/Xlcint.h +++ b/src/xlibi18n/Xlcint.h @@ -112,7 +112,7 @@ typedef struct { * and Input Context */ typedef struct { - char *resource_name; /* Resource string */ + const char *resource_name; /* Resource string */ XrmQuark xrm_name; /* Resource name quark */ int resource_size; /* Size in bytes of data */ long resource_offset; /* Offset from base */ @@ -354,7 +354,7 @@ typedef struct { } XlcArg, *XlcArgList; typedef struct _XlcResource { - char *name; + const char *name; XrmQuark xrm_name; int size; int offset;