summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-12-04 09:03:36 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-12-04 09:03:36 (GMT)
commit6001ef3bb9cdf41c5375a22cdaee85fffdf3b644 (patch)
treef37a69fc24d84522a0cb388802a38022a3cd9943 /src/corelib/tools
parentd1a28d167295958a4404fab37d60ef530c692590 (diff)
parentd7b34583926e3bd751120a4b827cd5ba6667dea3 (diff)
downloadQt-6001ef3bb9cdf41c5375a22cdaee85fffdf3b644.zip
Qt-6001ef3bb9cdf41c5375a22cdaee85fffdf3b644.tar.gz
Qt-6001ef3bb9cdf41c5375a22cdaee85fffdf3b644.tar.bz2
Merge commit 'oslo-staging-1/4.6' into master-mainline
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qhash.h8
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)); }