[PATCH:libSM 7/8] SmsInitialize: Mark vendor & release args as const char *

Alan Coopersmith alan.coopersmith at oracle.com
Mon Dec 5 20:06:20 PST 2011


Needed to fix gcc -Wwrite-strings arguments in callers such as xsm.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 doc/SMlib.xml          |    4 ++--
 include/X11/SM/SMlib.h |    4 ++--
 src/sm_manager.c       |    3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/SMlib.xml b/doc/SMlib.xml
index 7577492..6d2a234 100644
--- a/doc/SMlib.xml
+++ b/doc/SMlib.xml
@@ -1500,8 +1500,8 @@ time a new client connects to the session manager.
 <funcsynopsis id='SmsInitialize'>
    <funcprototype>
       <funcdef>Status <function>SmsInitialize</function></funcdef>
-      <paramdef>char *<parameter>vendor</parameter></paramdef>
-      <paramdef>char *<parameter>release</parameter></paramdef>
+      <paramdef>const char *<parameter>vendor</parameter></paramdef>
+      <paramdef>const char *<parameter>release</parameter></paramdef>
       <paramdef>SmsNewClientProc <parameter>new_client_proc</parameter></paramdef>
       <paramdef>SmPointer <parameter>manager_data</parameter></paramdef>
       <paramdef>IceHostBasedAuthProc <parameter>host_based_auth_proc</parameter></paramdef>
diff --git a/include/X11/SM/SMlib.h b/include/X11/SM/SMlib.h
index fb1166b..9645295 100644
--- a/include/X11/SM/SMlib.h
+++ b/include/X11/SM/SMlib.h
@@ -445,8 +445,8 @@ extern IceConn SmcGetIceConnection (
 );
 
 extern Status SmsInitialize (
-    char *			/* vendor */,
-    char *			/* release */,
+    const char *		/* vendor */,
+    const char *		/* release */,
     SmsNewClientProc		/* newClientProc */,
     SmPointer			/* managerData */,
     IceHostBasedAuthProc	/* hostBasedAuthProc */,
diff --git a/src/sm_manager.c b/src/sm_manager.c
index d28c0c5..7a11a33 100644
--- a/src/sm_manager.c
+++ b/src/sm_manager.c
@@ -110,7 +110,8 @@ _SmsProtocolSetupProc (IceConn    iceConn,
 
 
 Status
-SmsInitialize(char *vendor, char *release, SmsNewClientProc newClientProc,
+SmsInitialize(const char *vendor, const char *release,
+	      SmsNewClientProc newClientProc,
 	      SmPointer managerData, IceHostBasedAuthProc hostBasedAuthProc,
 	      int errorLength, char *errorStringRet)
 {
-- 
1.7.3.2



More information about the xorg-devel mailing list