]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make GCC 4.8 happy with libip code
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 25 Jul 2013 13:06:58 +0000 (07:06 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 25 Jul 2013 13:06:58 +0000 (07:06 -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 2338a3cab71c7d943f4dc8df71683f2eb908d76a..693319f045607ff5383aa92e5f8f9a0076f35681 100644 (file)
@@ -969,7 +969,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, &mSocketAddr_.sin6_addr, sizeof(struct in6_addr));
 }
@@ -978,7 +978,7 @@ bool
 Ip::Address::getInAddr(struct in_addr &buf) const
 {
     if ( isIPv4() ) {
-        map6to4((const in6_addr)mSocketAddr_.sin6_addr, buf);
+        map6to4(mSocketAddr_.sin6_addr, buf);
         return true;
     }
 
index 84a6ec084e0d11bdc87055a99a9c23c387d6446e..4280b0b410afc863a06a9eb02c10be4bbc36f8ad 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() );