Fix some GCC warnings

Former-commit-id: 31c8460b4656c29ac165d7aa28f335851f2565df
This commit is contained in:
Lynix
2016-05-25 13:52:10 +02:00
parent 840b03691a
commit 8a3339badf
19 changed files with 113 additions and 54 deletions

View File

@@ -224,7 +224,7 @@ namespace std
// This is SDBM adapted for IP addresses, tested to generate the least collisions possible
// (It doesn't mean it cannot be improved though)
std::size_t hash = 0;
std::size_t h = 0;
switch (ip.GetProtocol())
{
case Nz::NetProtocol_Any:
@@ -233,20 +233,20 @@ namespace std
case Nz::NetProtocol_IPv4:
{
hash = ip.ToUInt32() + (hash << 6) + (hash << 16) - hash;
h = ip.ToUInt32() + (h << 6) + (h << 16) - h;
break;
}
case Nz::NetProtocol_IPv6:
{
Nz::IpAddress::IPv6 v6 = ip.ToIPv6();
for (std::size_t i = 0; i < v6.size(); i++)
hash = v6[i] + (hash << 6) + (hash << 16) - hash;
h = v6[i] + (h << 6) + (h << 16) - h;
break;
}
}
return ip.GetPort() + (hash << 6) + (hash << 16) - hash;
return ip.GetPort() + (h << 6) + (h << 16) - h;
}
};
}

View File

@@ -79,8 +79,8 @@ namespace Nz
PendingPacket m_pendingPacket;
UInt64 m_keepAliveInterval;
UInt64 m_keepAliveTime;
bool m_isLowDelayEnabled;
bool m_isKeepAliveEnabled;
bool m_isLowDelayEnabled;
};
}