]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix more Gcc 4.x warnings.
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 26 Apr 2008 12:29:34 +0000 (00:29 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 26 Apr 2008 12:29:34 +0000 (00:29 +1200)
lib/IPAddress.cc

index 62c893c31b3fa2d814a5130014bd8e77b01c4b82..36a26d431e303cf88bd5619c2024cc30784d2994 100644 (file)
@@ -820,7 +820,7 @@ void IPAddress::GetAddrInfo(struct addrinfo *&dst, int force) const
         dst->ai_protocol = IPPROTO_UDP;
 
 #if USE_IPV6
-    if( force == AF_INET6 || force == AF_UNSPEC && IsIPv6() )
+    if( force == AF_INET6 || (force == AF_UNSPEC && IsIPv6()) )
     {
         dst->ai_addr = (struct sockaddr*)new sockaddr_in6;
 
@@ -834,7 +834,7 @@ void IPAddress::GetAddrInfo(struct addrinfo *&dst, int force) const
         dst->ai_protocol = IPPROTO_IPV6;
     } else
 #endif
-        if( force == AF_INET || force == AF_UNSPEC && IsIPv4() )
+        if( force == AF_INET || (force == AF_UNSPEC && IsIPv4()) )
         {
 
             dst->ai_addr = (struct sockaddr*)new sockaddr_in;
@@ -1048,7 +1048,7 @@ unsigned int IPAddress::ToHostname(char *buf, const unsigned int blen) const
     while(*p != '\0' && p < buf+blen)
         p++;
 
-    if(IsIPv6() && p < buf+blen-1) {
+    if(IsIPv6() && p < (buf+blen-1) ) {
         *p = ']';
         p++;
     }
@@ -1072,7 +1072,7 @@ char* IPAddress::ToURL(char* buf, unsigned int blen) const
 
     p += ToHostname(p, blen);
 
-    if(m_SocketAddr.sin6_port > 0 && p < buf+blen-6) {
+    if(m_SocketAddr.sin6_port > 0 && p < (buf+blen-6) ) {
         /* 6 is max length of expected ':port' (short int) */
         snprintf(p, 6,":%d", GetPort() );
     }
@@ -1094,7 +1094,7 @@ void IPAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) con
     }
 
 #if USE_IPV6
-    if( family == AF_INET6 || family == AF_UNSPEC && IsIPv6() )
+    if( family == AF_INET6 || (family == AF_UNSPEC && IsIPv6()) )
     {
         memcpy(&addr, &m_SocketAddr, sizeof(struct sockaddr_in6));
         if(addr.ss_family == 0) {
@@ -1106,7 +1106,7 @@ void IPAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) con
 #elif HAVE_SIN6_LEN_IN_SAI
         sin->sin6_len = htons(sizeof(struct sockaddr_in6));
 #endif
-    } else if( family == AF_INET || family == AF_UNSPEC && IsIPv4() ) {
+    } else if( family == AF_INET || (family == AF_UNSPEC && IsIPv4()) ) {
         sin = (struct sockaddr_in*)&addr;
         addr.ss_family = AF_INET;
         sin->sin_port = m_SocketAddr.sin6_port;