diff options
author | Jose <jose@zeroc.com> | 2019-06-24 23:11:34 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-24 23:11:34 +0200 |
commit | 172296d0909887bfb9847462beb8541d826355bb (patch) | |
tree | 73c6607464776e416044fbbcf344c52a41d9c8ed /cpp/src/Ice/Network.cpp | |
parent | Better error message for LoadLibrary failure on Windows. (diff) | |
download | ice-172296d0909887bfb9847462beb8541d826355bb.tar.bz2 ice-172296d0909887bfb9847462beb8541d826355bb.tar.xz ice-172296d0909887bfb9847462beb8541d826355bb.zip |
Fix shadows declaration warnings - Close #348
Diffstat (limited to 'cpp/src/Ice/Network.cpp')
-rwxr-xr-x | cpp/src/Ice/Network.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index d1e4b8194ee..f4713ddea3a 100755 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -448,40 +448,40 @@ getLocalAddresses(ProtocolSupport protocol, bool includeLoopback, bool singleAdd numaddrs = ifc.ifc_len / static_cast<int>(sizeof(struct ifreq)); struct ifreq* ifr = ifc.ifc_req; set<string> interfaces; - for(int i = 0; i < numaddrs; ++i) + for(int j = 0; j < numaddrs; ++j) { - if(!(ifr[i].ifr_flags & IFF_LOOPBACK)) // Don't include loopback interface addresses + if(!(ifr[j].ifr_flags & IFF_LOOPBACK)) // Don't include loopback interface addresses { // // On Solaris the above Loopback check does not always work so we double // check the address below. Solaris also returns duplicate entries that need // to be filtered out. // - if(ifr[i].ifr_addr.sa_family == AF_INET && protocol != EnableIPv6) + if(ifr[j].ifr_addr.sa_family == AF_INET && protocol != EnableIPv6) { Address addr; - memcpy(&addr.saStorage, &ifr[i].ifr_addr, sizeof(sockaddr_in)); + memcpy(&addr.saStorage, &ifr[j].ifr_addr, sizeof(sockaddr_in)); if(addr.saIn.sin_addr.s_addr != 0 && (includeLoopback || addr.saIn.sin_addr.s_addr != htonl(INADDR_LOOPBACK))) { - if(!singleAddressPerInterface || interfaces.find(ifr[i].ifr_name) == interfaces.end()) + if(!singleAddressPerInterface || interfaces.find(ifr[j].ifr_name) == interfaces.end()) { result.push_back(addr); - interfaces.insert(ifr[i].ifr_name); + interfaces.insert(ifr[j].ifr_name); } } } - else if(ifr[i].ifr_addr.sa_family == AF_INET6 && protocol != EnableIPv4) + else if(ifr[j].ifr_addr.sa_family == AF_INET6 && protocol != EnableIPv4) { Address addr; - memcpy(&addr.saStorage, &ifr[i].ifr_addr, sizeof(sockaddr_in6)); + memcpy(&addr.saStorage, &ifr[j].ifr_addr, sizeof(sockaddr_in6)); if(!IN6_IS_ADDR_UNSPECIFIED(&addr.saIn6.sin6_addr) && (includeLoopback || !IN6_IS_ADDR_LOOPBACK(&addr.saIn6.sin6_addr))) { - if(!singleAddressPerInterface || interfaces.find(ifr[i].ifr_name) == interfaces.end()) + if(!singleAddressPerInterface || interfaces.find(ifr[j].ifr_name) == interfaces.end()) { result.push_back(addr); - interfaces.insert(ifr[i].ifr_name); + interfaces.insert(ifr[j].ifr_name); } } } |