[PATCH:libxtrans 4/7] Add const qualifiers to TRANS(CreateListener) port args

Alan Coopersmith alan.coopersmith at oracle.com
Mon Aug 25 18:21:21 PDT 2014


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 Xtrans.c       |    2 +-
 Xtrans.h       |    2 +-
 Xtransint.h    |    2 +-
 Xtranslcl.c    |    3 ++-
 Xtranssock.c   |    5 +++--
 doc/xtrans.xml |    8 ++++----
 6 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/Xtrans.c b/Xtrans.c
index 79b3b31..86ccdd0 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -743,7 +743,7 @@ TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg)
 #ifdef TRANS_SERVER
 
 int
-TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(CreateListener) (XtransConnInfo ciptr, const char *port, unsigned int flags)
 
 {
     return ciptr->transptr->CreateListener (ciptr, port, flags);
diff --git a/Xtrans.h b/Xtrans.h
index b93e587..7706621 100644
--- a/Xtrans.h
+++ b/Xtrans.h
@@ -299,7 +299,7 @@ int TRANS(SetOption)(
 
 int TRANS(CreateListener)(
     XtransConnInfo,	/* ciptr */
-    char *,		/* port */
+    const char *,	/* port */
     unsigned int	/* flags */
 );
 
diff --git a/Xtransint.h b/Xtransint.h
index 5f7718e..285cf5b 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -233,7 +233,7 @@ typedef struct _Xtransport {
 
     int	(*CreateListener)(
 	XtransConnInfo,		/* connection */
-	char *,			/* port */
+	const char *,		/* port */
 	unsigned int		/* flags */
     );
 
diff --git a/Xtranslcl.c b/Xtranslcl.c
index 78572b3..dec8124 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -2151,7 +2151,8 @@ TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg)
 #ifdef TRANS_SERVER
 
 static int
-TRANS(LocalCreateListener)(XtransConnInfo ciptr, char *port, unsigned int flags _X_UNUSED)
+TRANS(LocalCreateListener)(XtransConnInfo ciptr, const char *port,
+                           unsigned int flags _X_UNUSED)
 
 {
     prmsg(2,"LocalCreateListener(%p->%d,%s)\n",ciptr,ciptr->fd,port);
diff --git a/Xtranssock.c b/Xtranssock.c
index 1b1dd7e..87efd1b 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -947,7 +947,8 @@ TRANS(SocketCreateListener) (XtransConnInfo ciptr,
 
 #ifdef TCPCONN
 static int
-TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
+TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, const char *port,
+                                 unsigned int flags)
 
 {
 #if defined(IPv6) && defined(AF_INET6)
@@ -1075,7 +1076,7 @@ TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, char *port, unsigned int
 #ifdef UNIXCONN
 
 static int
-TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port,
+TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, const char *port,
 				 unsigned int flags)
 
 {
diff --git a/doc/xtrans.xml b/doc/xtrans.xml
index 5960dfa..2e16e79 100644
--- a/doc/xtrans.xml
+++ b/doc/xtrans.xml
@@ -226,8 +226,8 @@ typedef struct _Xtransport {
 
     int     (*CreateListener)(
      XtransConnInfo,          /* connection */
-     char *,               /* port */
-     int               /* flags */
+     const char *,            /* port */
+     int                      /* flags */
     );
 
     int     (*ResetListener)(
@@ -480,7 +480,7 @@ Based on current usage, the complimentary function
       <funcprototype>
         <funcdef>int <function>TRANS(CreateListener)</function></funcdef>
         <paramdef>XtransConnInfo <parameter>connection</parameter></paramdef>
-        <paramdef>char *<parameter>port</parameter></paramdef>
+        <paramdef>const char *<parameter>port</parameter></paramdef>
         <paramdef>int <parameter>flags</parameter></paramdef>
       </funcprototype>
     </funcsynopsis>
@@ -935,7 +935,7 @@ different transport type is added, or a transport dependent option is defined.
       <funcprototype>
         <funcdef>int <function>CreateListener</function></funcdef>
         <paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef>
-        <paramdef>char <parameter>*port</parameter></paramdef>
+        <paramdef>const char <parameter>*port</parameter></paramdef>
         <paramdef>int <parameter>flags</parameter></paramdef>
       </funcprototype>
     </funcsynopsis>
-- 
1.7.9.2



More information about the xorg-devel mailing list