From: Amos Jeffries Date: Fri, 26 Jul 2013 12:43:39 +0000 (-0600) Subject: Make GCC 4.8 happy with libip code X-Git-Tag: SQUID_3_3_10~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86ba1e22cd711f091b2403399993f903a5790812;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 cda6a6e1f3..ea7500c97e 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -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; } diff --git a/src/ip/testAddress.cc b/src/ip/testAddress.cc index 34426eaedc..af0ebbd27e 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() );