[PATCH:libxtrans 08/10] Fix warning: unused variable 'tmpport' with various configurations

Alan Coopersmith alan.coopersmith at oracle.com
Tue Sep 27 14:28:28 PDT 2011


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 Xtranssock.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Xtranssock.c b/Xtranssock.c
index 268c599..775a7f9 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -1433,7 +1433,6 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
     char	portbuf[PORTBUFSIZE];
 #endif
 
-    long		tmpport;
     char 		hostnamebuf[256];		/* tmp space */
 
     prmsg (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
@@ -1457,7 +1456,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
 
     if (is_numeric (port))
     {
-	tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
+	long tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10);
 	sprintf (portbuf, "%lu", tmpport);
 	port = portbuf;
     }
@@ -1667,7 +1666,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
 	    }
 	    sockname.sin_port = htons (servp->s_port);
 	} else {
-	    tmpport = strtol (port, (char**)NULL, 10);
+	    long tmpport = strtol (port, (char**)NULL, 10);
 	    if (tmpport < 1024 || tmpport > USHRT_MAX)
 		return TRANS_CONNECT_FAILED;
 	    sockname.sin_port = htons (((unsigned short) tmpport));
-- 
1.7.3.2



More information about the xorg-devel mailing list