[libxml2] Fix unused variable warnings in nanohttp.c



commit ecbdfa9eb3ee478193deaf6d0bb2400a80ef172d
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Mon Oct 9 02:01:00 2017 +0200

    Fix unused variable warnings in nanohttp.c
    
    Some variables are only used if certain macros are set. Move the
    declarations around.

 nanohttp.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/nanohttp.c b/nanohttp.c
index 3441eca..d7bc013 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1045,16 +1045,13 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
 static SOCKET
 xmlNanoHTTPConnectHost(const char *host, int port)
 {
-    struct hostent *h;
     struct sockaddr *addr = NULL;
-    struct in_addr ia;
     struct sockaddr_in sockin;
 
 #ifdef SUPPORT_IP6
     struct in6_addr ia6;
     struct sockaddr_in6 sockin6;
 #endif
-    int i;
     SOCKET s;
 
     memset (&sockin, 0, sizeof(sockin));
@@ -1129,6 +1126,10 @@ xmlNanoHTTPConnectHost(const char *host, int port)
 #endif
 #if !defined(HAVE_GETADDRINFO) || !defined(_WIN32)
     {
+        struct hostent *h;
+        struct in_addr ia;
+        int i;
+
        h = gethostbyname (GETHOSTBYNAME_ARG_CAST host);
        if (h == NULL) {
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]