diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-12-11 11:11:45 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-12-11 11:11:45 (GMT) |
commit | b42da2ec8677ce67ecd5d5f8188537e2a597da2a (patch) | |
tree | e41b2eb449e0d0392e85603612836d935967f400 /src/corelib/tools/qhash.h | |
parent | 664c78144754c499d07a95c3914fd34202bf4b98 (diff) | |
parent | 343de9228ae65c36c4a9a45297d45cdeb04a8e44 (diff) | |
download | Qt-b42da2ec8677ce67ecd5d5f8188537e2a597da2a.zip Qt-b42da2ec8677ce67ecd5d5f8188537e2a597da2a.tar.gz Qt-b42da2ec8677ce67ecd5d5f8188537e2a597da2a.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'src/corelib/tools/qhash.h')
-rw-r--r-- | src/corelib/tools/qhash.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 1918229..2de03dc 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -69,18 +69,18 @@ inline uint qHash(int key) { return uint(key); } inline uint qHash(ulong key) { if (sizeof(ulong) > sizeof(uint)) { - return uint((key >> (8 * sizeof(uint) - 1)) ^ key); + return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)); } else { - return uint(key); + return uint(key & (~0U)); } } inline uint qHash(long key) { return qHash(ulong(key)); } inline uint qHash(quint64 key) { if (sizeof(quint64) > sizeof(uint)) { - return uint((key >> (8 * sizeof(uint) - 1)) ^ key); + return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)); } else { - return uint(key); + return uint(key & (~0U)); } } inline uint qHash(qint64 key) { return qHash(quint64(key)); } |