diff options
author | Ricardo M. Correia <rcorreia@wizy.org> | 2012-05-13 21:31:59 +0200 |
---|---|---|
committer | Ricardo M. Correia <rcorreia@wizy.org> | 2012-05-13 21:42:54 +0200 |
commit | 4843b55fd167c54d86eb9e1f19525ed363cfe72d (patch) | |
tree | 81a74462fdd3fc20a25521a8634121ad0b1a445f /src/netbase.cpp | |
parent | 1653f97c8f3c37cd96e03cf397c31c5caf81af08 (diff) |
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.
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 2131bdf75b..c237e2dc4d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -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; } |