summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Network.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Network.cpp')
-rw-r--r--cpp/src/Ice/Network.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index b49a8b6f132..2dbbdadb50e 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -444,8 +444,7 @@ getLocalAddresses(ProtocolSupport protocol)
struct in_addr* inaddr = &reinterpret_cast<struct sockaddr_in*>(&addr)->sin_addr;
if(inaddr->s_addr != 0 && inaddr->s_addr != htonl(INADDR_LOOPBACK))
{
- unsigned int j;
- for(j = 0; j < result.size(); ++j)
+ for(unsigned int j = 0; j < result.size(); ++j)
{
if(compareAddress(addr, result[j]) == 0)
{
@@ -465,8 +464,7 @@ getLocalAddresses(ProtocolSupport protocol)
struct in6_addr* inaddr6 = &reinterpret_cast<struct sockaddr_in6*>(&addr)->sin6_addr;
if(!IN6_IS_ADDR_UNSPECIFIED(inaddr6) && !IN6_IS_ADDR_LOOPBACK(inaddr6))
{
- unsigned int j;
- for(j = 0; j < result.size(); ++j)
+ for(unsigned int j = 0; j < result.size(); ++j)
{
if(compareAddress(addr, result[j]) == 0)
{
@@ -719,8 +717,7 @@ IceInternal::getAddresses(const string& host, int port, ProtocolSupport protocol
throw ex;
}
- struct addrinfo* p;
- for(p = info; p != NULL; p = p->ai_next)
+ for(struct addrinfo* p = info; p != NULL; p = p->ai_next)
{
memcpy(&addr, p->ai_addr, p->ai_addrlen);
if(p->ai_family == PF_INET)