]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make GCC 4.8 happy with libip code
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Jul 2013 12:43:39 +0000 (06:43 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 26 Jul 2013 12:43:39 +0000 (06:43 -0600)
Invalid casting seems to confuse the ABI generator and results in
illegal instruction faults when the unit tests is run.
The class API is already const-correct so there is no need for the cast
to occur, and it should not be done on a non-pointer type anyway.

Also, fixes a missing "struct" type identifier found along the way.

src/ip/Address.cc
src/ip/testAddress.cc

index cda6a6e1f3de26a5e0563f4d0e0534bffb9f414d..ea7500c97e581dea0275ff7a23fc4201719d63c1 100644 (file)
@@ -1021,7 +1021,7 @@ Ip::Address::Map6to4(const struct in6_addr &in, struct in_addr &out) const
 }
 
 void
-Ip::Address::GetInAddr(in6_addr &buf) const
+Ip::Address::GetInAddr(struct in6_addr &buf) const
 {
     memcpy(&buf, &m_SocketAddr.sin6_addr, sizeof(struct in6_addr));
 }
@@ -1030,7 +1030,7 @@ bool
 Ip::Address::GetInAddr(struct in_addr &buf) const
 {
     if ( IsIPv4() ) {
-        Map6to4((const in6_addr)m_SocketAddr.sin6_addr, buf);
+        Map6to4(m_SocketAddr.sin6_addr, buf);
         return true;
     }
 
index 34426eaedcee192bbed8119a3520cf2a49044917..af0ebbd27e90fa7defaafc8e9d9b3ae90d803c36 100644 (file)
@@ -108,7 +108,7 @@ testIpAddress::testSockAddrConstructor()
     insock.sin_len = sizeof(struct sockaddr_in);
 #endif
 
-    Ip::Address anIPA((const struct sockaddr_in)insock);
+    Ip::Address anIPA(insock);
 
     /* test stored values */
     CPPUNIT_ASSERT( !anIPA.IsAnyAddr() );