]> granicus.if.org Git - curl/commitdiff
compiler warning fix
authorYang Tse <yangsita@gmail.com>
Tue, 6 Feb 2007 03:31:27 +0000 (03:31 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 6 Feb 2007 03:31:27 +0000 (03:31 +0000)
ares/ares_getnameinfo.c
lib/hostip4.c

index 5499705b8f300a1cb03fd5b99fd9135d3b19440f..a63c9b6adc10908629fa0ff80f01b1f3ac956dd5 100644 (file)
@@ -322,6 +322,9 @@ static char *lookup_service(unsigned short port, int flags,
 static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
                            char *buf, size_t buflen)
 {
+#ifdef HAVE_IF_INDEXTONAME
+  int is_ll, is_mcll;
+#endif
   char fmt_u[] = "%u";
   char fmt_lu[] = "%lu";
   char tmpbuf[IF_NAMESIZE + 2];
@@ -331,9 +334,10 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
   tmpbuf[0] = '%';
 
 #ifdef HAVE_IF_INDEXTONAME
+  is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr);
+  is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr);
   if ((flags & ARES_NI_NUMERICSCOPE) ||
-      (!IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr)
-       && !IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr)))
+      (!is_ll && !is_mcll))
     {
        sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
     }
index 685156bad70a6ef7c1cb204b8947e742626c9c63..49556db66c674e77e3777ce4e76c7661becdd0e4 100644 (file)
@@ -124,7 +124,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
                                 int port,
                                 int *waitp)
 {
-#if defined(HAVE_GETHOSTBYNAME_R_3) || defined(HAVE_GETHOSTBYNAME_R_6)
+#if defined(HAVE_GETHOSTBYNAME_R_3)
   int res;
 #endif
   Curl_addrinfo *ai = NULL;
@@ -181,7 +181,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
 #ifdef HAVE_GETHOSTBYNAME_R_6
     /* Linux */
 
-    res=gethostbyname_r(hostname,
+    (void)gethostbyname_r(hostname,
                         (struct hostent *)buf,
                         (char *)buf + sizeof(struct hostent),
                         CURL_HOSTENT_SIZE - sizeof(struct hostent),