From 832bef7c34c46a1eded4bc4ddcf4dc98ebb4060c Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 26 Jul 2013 05:29:14 -0600 Subject: [PATCH] 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. --- src/ip/Address.cc | 4 ++-- src/ip/testAddress.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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() ); -- 2.47.2