[PATCH libxtrans] Clean up some 'unused variable' warnings

Jeff Smith whydoubt at yahoo.com
Fri Mar 19 13:37:36 PDT 2010


Signed-off-by: Jeff Smith <whydoubt at yahoo.com>
---
 Xtranssock.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Xtranssock.c b/Xtranssock.c
index 7106f5d..80659b3 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -1431,19 +1431,14 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
     char		ntopbuf[INET6_ADDRSTRLEN];
     int			resetonce = 0;
 #endif
-    struct sockaddr_in	sockname;
 #ifdef XTHREADS_NEEDS_BYNAMEPARAMS
     _Xgethostbynameparams hparams;
     _Xgetservbynameparams sparams;
 #endif
-    struct hostent	*hostp;
-    struct servent	*servp;
-    unsigned long 	tmpaddr;
 #ifdef X11_t
     char	portbuf[PORTBUFSIZE];
 #endif
 
-    long		tmpport;
     char 		hostnamebuf[256];		/* tmp space */
 
     PRMSG (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port);
@@ -1467,7 +1462,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;
     }
@@ -1619,6 +1614,11 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port)
     }
 #else
     {
+	struct sockaddr_in	sockname;
+	struct hostent	*hostp;
+	struct servent	*servp;
+	unsigned long 	tmpaddr;
+
 	/*
 	 * Build the socket name.
 	 */
@@ -1680,7 +1680,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.6.0.6

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the xorg-devel mailing list