From 73c9e094f3307f1f29e05e4534a530335e5bd61f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 23 May 2012 22:05:51 -0700 Subject: Add const qualifiers to silence gcc -Wwrite-strings warnings Signed-off-by: Alan Coopersmith --- src/XpExtUtil.c | 4 ++-- src/XpExtUtil.h | 2 +- src/XpNotifyPdm.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/XpExtUtil.c b/src/XpExtUtil.c index 30540d0..89f66c0 100644 --- a/src/XpExtUtil.c +++ b/src/XpExtUtil.c @@ -50,7 +50,7 @@ static XExtensionInfo xp_info_data; static XExtensionInfo *xp_info = &xp_info_data; -static /* const */ char *xp_extension_name = XP_PRINTNAME; +static const char *xp_extension_name = XP_PRINTNAME; static int XpClose(Display *, XExtCodes *); static char *XpError(Display *, int, XExtCodes *, char *, int); @@ -85,7 +85,7 @@ typedef struct _xpPrintData { XPrintLocalExtensionVersion *vers; } xpPrintData; -static char *XpErrorList[ /* XP_ERRORS */ ] = { +static const char *XpErrorList[ /* XP_ERRORS */ ] = { "XPBadContext", "XPBadSequence", "XPBadResourceID" diff --git a/src/XpExtUtil.h b/src/XpExtUtil.h index 4b880ae..d479a95 100644 --- a/src/XpExtUtil.h +++ b/src/XpExtUtil.h @@ -45,7 +45,7 @@ extern int XpCheckExtInitUnlocked( ); extern char *_xpstrdup( - char * /* str */ + const char * /* str */ ); _XFUNCPROTOEND diff --git a/src/XpNotifyPdm.c b/src/XpNotifyPdm.c index 579923c..9fccfdd 100644 --- a/src/XpNotifyPdm.c +++ b/src/XpNotifyPdm.c @@ -68,7 +68,7 @@ /* * str_dup using Xmalloc */ -char *_xpstrdup(char * str) +char *_xpstrdup(const char * str) { int len; char *newstr; @@ -104,7 +104,7 @@ _XpGetSelectionServer ( char *tstr1, *tstr2, *tstr3, *tstrptr; char *sel_displaystr; Display *sel_display; - char *selectionstr; + const char *selectionstr; /* @@ -727,7 +727,7 @@ XpNotifyPdm ( enum { XA_PDM_CLIENT_PROP, XA_PDM_START, XA_PDM_START_OK, XA_PDM_START_VXAUTH, XA_PDM_START_PXAUTH, XA_PDM_START_ERROR, NUM_ATOMS }; - static char *atom_names[] = { + static const char *atom_names[] = { "PDM_CLIENT_PROP", "PDM_START", "PDM_START_OK", "PDM_START_VXAUTH", "PDM_START_PXAUTH", "PDM_START_ERROR" }; @@ -791,7 +791,7 @@ XpNotifyPdm ( /* * Create property and transfer data to. */ - XInternAtoms( sel_display, atom_names, NUM_ATOMS, False, atoms ); + XInternAtoms( sel_display, (char **) atom_names, NUM_ATOMS, False, atoms ); XChangeProperty( sel_display, sel_window, atoms[XA_PDM_CLIENT_PROP], -- cgit v1.2.1