[PATCH:libxtrans 6/7] Add const qualifiers to TRANS(MakeAll*ServerListeners) port args

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


Required also changing receive_listening_fds to specify port as const,
which we can do now that TRANS(ReopenCOTSServer) takes it as const.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 Xtrans.c       |   11 ++++++-----
 Xtrans.h       |    4 ++--
 doc/xtrans.xml |    4 ++--
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Xtrans.c b/Xtrans.c
index 81c8d2d..2880803 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -1074,7 +1074,8 @@ complete_network_count (void)
 
 
 static int
-receive_listening_fds(char* port, XtransConnInfo* temp_ciptrs, int* count_ret)
+receive_listening_fds(const char* port, XtransConnInfo* temp_ciptrs,
+                      int* count_ret)
 
 {
 #ifdef HAVE_SYSTEMD_DAEMON
@@ -1151,8 +1152,8 @@ extern int xquartz_launchd_fd;
 #endif
 
 int
-TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
-				   XtransConnInfo **ciptrs_ret)
+TRANS(MakeAllCOTSServerListeners) (const char *port, int *partial,
+                                   int *count_ret, XtransConnInfo **ciptrs_ret)
 
 {
     char		buffer[256]; /* ??? What size ?? */
@@ -1282,8 +1283,8 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret,
 }
 
 int
-TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret,
-				   XtransConnInfo **ciptrs_ret)
+TRANS(MakeAllCLTSServerListeners) (const char *port, int *partial,
+                                   int *count_ret, XtransConnInfo **ciptrs_ret)
 
 {
     char		buffer[256]; /* ??? What size ?? */
diff --git a/Xtrans.h b/Xtrans.h
index a1fb923..6decc6b 100644
--- a/Xtrans.h
+++ b/Xtrans.h
@@ -405,14 +405,14 @@ int TRANS(GetConnectionNumber)(
 #ifdef TRANS_SERVER
 
 int TRANS(MakeAllCOTSServerListeners)(
-    char *,		/* port */
+    const char *,	/* port */
     int *,		/* partial */
     int *,		/* count_ret */
     XtransConnInfo **	/* ciptrs_ret */
 );
 
 int TRANS(MakeAllCLTSServerListeners)(
-    char *,		/* port */
+    const char *,	/* port */
     int *,		/* partial */
     int *,		/* count_ret */
     XtransConnInfo **	/* ciptrs_ret */
diff --git a/doc/xtrans.xml b/doc/xtrans.xml
index 5c99629..10e5489 100644
--- a/doc/xtrans.xml
+++ b/doc/xtrans.xml
@@ -712,7 +712,7 @@ Returns the file descriptor associated with this transport.
     <funcsynopsis id='TRANSMakeAllCOTSServerListeners'>
       <funcprototype>
         <funcdef>int <function>TRANS(MakeAllCOTSServerListeners)</function></funcdef>
-        <paramdef>char *<parameter>port</parameter></paramdef>
+        <paramdef>const char *<parameter>port</parameter></paramdef>
         <paramdef>int *<parameter>partial_ret</parameter></paramdef>
         <paramdef>int *<parameter>count_ret</parameter></paramdef>
         <paramdef>XtransConnInfo **<parameter>connections_ret</parameter></paramdef>
@@ -731,7 +731,7 @@ is the list of transports.
     <funcsynopsis id='TRANSMakeAllCLTSServerListeners'>
       <funcprototype>
         <funcdef>int <function>TRANS(MakeAllCLTSServerListeners)</function></funcdef>
-        <paramdef>char *<parameter>port</parameter></paramdef>
+        <paramdef>const char *<parameter>port</parameter></paramdef>
         <paramdef>int *<parameter>partial_ret</parameter></paramdef>
         <paramdef>int *<parameter>count_ret</parameter></paramdef>
         <paramdef>XtransConnInfo **<parameter>connections_ret</parameter></paramdef>
-- 
1.7.9.2



More information about the xorg-devel mailing list