diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-08-23 11:33:57 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-08-24 09:27:04 -0700 |
commit | ba70d48951fb925fb3082d81afb08c330333aa51 (patch) | |
tree | 4a5898a86da5fb7e6002c66fb7ab9118a6939417 | |
parent | 63b65a20706def951dd25e531949b7bc556419eb (diff) |
Add const qualifiers to TRANS(Connect) args
Also required constifying UnixHostReallyLocal, since SocketUNIXConnect
passes the host arg through to it.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | Xtrans.c | 2 | ||||
-rw-r--r-- | Xtrans.h | 2 | ||||
-rw-r--r-- | Xtransint.h | 4 | ||||
-rw-r--r-- | Xtranslcl.c | 3 | ||||
-rw-r--r-- | Xtranssock.c | 8 | ||||
-rw-r--r-- | doc/xtrans.xml | 10 |
6 files changed, 16 insertions, 13 deletions
@@ -852,7 +852,7 @@ TRANS(Accept) (XtransConnInfo ciptr, int *status) #ifdef TRANS_CLIENT int -TRANS(Connect) (XtransConnInfo ciptr, char *address) +TRANS(Connect) (XtransConnInfo ciptr, const char *address) { char *protocol; @@ -330,7 +330,7 @@ XtransConnInfo TRANS(Accept)( int TRANS(Connect)( XtransConnInfo, /* ciptr */ - char * /* address */ + const char * /* address */ ); #endif /* TRANS_CLIENT */ diff --git a/Xtransint.h b/Xtransint.h index 285cf5b..f674e5b 100644 --- a/Xtransint.h +++ b/Xtransint.h @@ -252,8 +252,8 @@ typedef struct _Xtransport { int (*Connect)( XtransConnInfo, /* connection */ - char *, /* host */ - char * /* port */ + const char *, /* host */ + const char * /* port */ ); #endif /* TRANS_CLIENT */ diff --git a/Xtranslcl.c b/Xtranslcl.c index dec8124..4f04927 100644 --- a/Xtranslcl.c +++ b/Xtranslcl.c @@ -2217,7 +2217,8 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status) #ifdef TRANS_CLIENT static int -TRANS(LocalConnect)(XtransConnInfo ciptr, char *host _X_UNUSED, char *port) +TRANS(LocalConnect)(XtransConnInfo ciptr, + const char *host _X_UNUSED, const char *port) { prmsg(2,"LocalConnect(%p->%d,%s)\n", ciptr, ciptr->fd, port); diff --git a/Xtranssock.c b/Xtranssock.c index 87efd1b..65ffa6f 100644 --- a/Xtranssock.c +++ b/Xtranssock.c @@ -1432,7 +1432,8 @@ static struct addrlist *addrlist = NULL; static int -TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) +TRANS(SocketINETConnect) (XtransConnInfo ciptr, + const char *host, const char *port) { struct sockaddr * socketaddr = NULL; @@ -1814,7 +1815,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) */ static int -UnixHostReallyLocal (char *host) +UnixHostReallyLocal (const char *host) { char hostnamebuf[256]; @@ -1945,7 +1946,8 @@ UnixHostReallyLocal (char *host) } static int -TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, char *host, char *port) +TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, + const char *host, const char *port) { struct sockaddr_un sockname; diff --git a/doc/xtrans.xml b/doc/xtrans.xml index 2e16e79..5c99629 100644 --- a/doc/xtrans.xml +++ b/doc/xtrans.xml @@ -240,8 +240,8 @@ typedef struct _Xtransport { int (*Connect)( XtransConnInfo, /* connection */ - char *, /* host */ - char * /* port */ + const char *, /* host */ + const char * /* port */ ); int (*BytesReadable)( @@ -542,7 +542,7 @@ new opaque transport connection object upon success, <funcprototype> <funcdef>int <function>TRANS(Connect)</function></funcdef> <paramdef>XtransConnInfo <parameter>connection</parameter></paramdef> - <paramdef>char *<parameter>address</parameter></paramdef> + <paramdef>const char *<parameter>address</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -987,8 +987,8 @@ structure describing the new endpoint is returned from this function <funcprototype> <funcdef>int <function>Connect</function></funcdef> <paramdef>struct _Xtransport *<parameter>thistrans</parameter></paramdef> - <paramdef>char *<parameter>host</parameter></paramdef> - <paramdef>char *<parameter>port</parameter></paramdef> + <paramdef>const char *<parameter>host</parameter></paramdef> + <paramdef>const char *<parameter>port</parameter></paramdef> </funcprototype> </funcsynopsis> <para> |