From: Amos Jeffries Date: Thu, 25 Jul 2013 13:06:58 +0000 (-0600) Subject: Make GCC 4.8 happy with libip code X-Git-Tag: SQUID_3_5_0_1~686 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68fb74b04edd0a7b41099db8029aeb166b793ec1;p=thirdparty%2Fsquid.git Make GCC 4.8 happy with libip code 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. --- diff --git a/src/ip/Address.cc b/src/ip/Address.cc index 2338a3cab7..693319f045 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -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; } diff --git a/src/ip/testAddress.cc b/src/ip/testAddress.cc index 84a6ec084e..4280b0b410 100644 --- a/src/ip/testAddress.cc +++ b/src/ip/testAddress.cc @@ -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() );