Make CNetAddr::GetHash() return an unsigned val.

This prevents an undefined operation in main.cpp, when shifting the hash value
left by 32 bits.
Shifting a signed int left into the sign bit is undefined in C++11.
This commit is contained in:
Ricardo M. Correia
2012-05-13 21:31:59 +02:00
parent 1653f97c8f
commit 4843b55fd1
3 changed files with 4 additions and 4 deletions

View File

@@ -820,10 +820,10 @@ std::vector<unsigned char> CNetAddr::GetGroup() const
return vchRet;
}
int64 CNetAddr::GetHash() const
uint64 CNetAddr::GetHash() const
{
uint256 hash = Hash(&ip[0], &ip[16]);
int64 nRet;
uint64 nRet;
memcpy(&nRet, &hash, sizeof(nRet));
return nRet;
}