diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-12-05 11:20:23 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-12-05 11:20:33 (GMT) |
commit | 291a26abae4b7e1e4b77baf42964ccb77edf4adf (patch) | |
tree | c7dfb42a84295438ef163e4975f6af2d88f649cc /src/corelib/tools | |
parent | 1bb5999cdca0a70df3f96d596c83c3cf7c97c5fd (diff) | |
parent | 33441e2a611f07207b0b942368aab9010cdf8ab1 (diff) | |
download | Qt-291a26abae4b7e1e4b77baf42964ccb77edf4adf.zip Qt-291a26abae4b7e1e4b77baf42964ccb77edf4adf.tar.gz Qt-291a26abae4b7e1e4b77baf42964ccb77edf4adf.tar.bz2 |
Merge commit '33441e2a611f07207b0b942368aab9010cdf8ab1' of oslo-staging-1/4.6 into 4.6
Diffstat (limited to 'src/corelib/tools')
-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)); } |