1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-26 00:37:43 +03:00

Fix unused variable warnings in nanohttp.c

Some variables are only used if certain macros are set. Move the
declarations around.
This commit is contained in:
Nick Wellnhofer
2017-10-09 02:01:00 +02:00
parent e3890546d7
commit ecbdfa9eb3

View File

@@ -1045,16 +1045,13 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
static SOCKET static SOCKET
xmlNanoHTTPConnectHost(const char *host, int port) xmlNanoHTTPConnectHost(const char *host, int port)
{ {
struct hostent *h;
struct sockaddr *addr = NULL; struct sockaddr *addr = NULL;
struct in_addr ia;
struct sockaddr_in sockin; struct sockaddr_in sockin;
#ifdef SUPPORT_IP6 #ifdef SUPPORT_IP6
struct in6_addr ia6; struct in6_addr ia6;
struct sockaddr_in6 sockin6; struct sockaddr_in6 sockin6;
#endif #endif
int i;
SOCKET s; SOCKET s;
memset (&sockin, 0, sizeof(sockin)); memset (&sockin, 0, sizeof(sockin));
@@ -1129,6 +1126,10 @@ xmlNanoHTTPConnectHost(const char *host, int port)
#endif #endif
#if !defined(HAVE_GETADDRINFO) || !defined(_WIN32) #if !defined(HAVE_GETADDRINFO) || !defined(_WIN32)
{ {
struct hostent *h;
struct in_addr ia;
int i;
h = gethostbyname (GETHOSTBYNAME_ARG_CAST host); h = gethostbyname (GETHOSTBYNAME_ARG_CAST host);
if (h == NULL) { if (h == NULL) {