summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-01-31 12:11:54 +0100
committerLars Knoll <lars.knoll@qt.io>2020-04-09 20:03:25 +0200
commitc6cdf38e752c22babdbe645366bdfb7ce51d01ff (patch)
tree450b02523cb5a16791674ad1d06fb68c72eac971 /qmake
parent775945137b6ef62de9a7d416b1fe59d79006ba82 (diff)
Change qHash() to work with size_t instead of uint
This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/cachekeys.h4
-rw-r--r--qmake/generators/makefile.h6
-rw-r--r--qmake/library/proitems.cpp2
-rw-r--r--qmake/library/proitems.h4
-rw-r--r--qmake/library/qmakeevaluator.cpp2
-rw-r--r--qmake/library/qmakeglobals.h2
6 files changed, 10 insertions, 10 deletions
diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h
index 8050f148aa..e9278653bd 100644
--- a/qmake/cachekeys.h
+++ b/qmake/cachekeys.h
@@ -64,7 +64,7 @@ struct FixStringCacheKey
return hash;
}
};
-inline uint qHash(const FixStringCacheKey &f) { return f.hashCode(); }
+inline size_t qHash(const FixStringCacheKey &f) { return f.hashCode(); }
// -------------------------------------------------------------------------------------------------
struct FileInfoCacheKey
@@ -102,7 +102,7 @@ struct FileInfoCacheKey
|| (c0 == QLatin1Char('\\') && c1 == QLatin1Char('\\')));
}
};
-inline uint qHash(const FileInfoCacheKey &f) { return f.hashCode(); }
+inline size_t qHash(const FileInfoCacheKey &f) { return f.hashCode(); }
// -------------------------------------------------------------------------------------------------
template <typename T>
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index a96b9c54da..bae32883b4 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -306,13 +306,13 @@ struct ReplaceExtraCompilerCacheKey
MakefileGenerator::ReplaceFor forShell;
ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o, MakefileGenerator::ReplaceFor s);
bool operator==(const ReplaceExtraCompilerCacheKey &f) const;
- inline uint hashCode() const {
+ inline size_t hashCode() const {
if (!hash)
- hash = (uint)forShell ^ qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/;
+ hash = (size_t)forShell ^ qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/;
return hash;
}
};
-inline uint qHash(const ReplaceExtraCompilerCacheKey &f) { return f.hashCode(); }
+inline size_t qHash(const ReplaceExtraCompilerCacheKey &f) { return f.hashCode(); }
QT_END_NAMESPACE
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index 9330c2b1bf..6bef098874 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -116,7 +116,7 @@ uint ProString::updatedHash() const
return (m_hash = hash(m_string.constData() + m_offset, m_length));
}
-uint qHash(const ProString &str)
+size_t qHash(const ProString &str)
{
if (!(str.m_hash & 0x80000000))
return str.m_hash;
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index 01370959c7..333f9ed889 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -173,7 +173,7 @@ private:
mutable uint m_hash;
QChar *prepareExtend(int extraLen, int thisTarget, int extraTarget);
uint updatedHash() const;
- friend uint qHash(const ProString &str);
+ friend size_t qHash(const ProString &str);
friend QString operator+(const ProString &one, const ProString &two);
friend class ProKey;
};
@@ -206,7 +206,7 @@ private:
};
Q_DECLARE_TYPEINFO(ProKey, Q_MOVABLE_TYPE);
-uint qHash(const ProString &str);
+size_t qHash(const ProString &str);
QString operator+(const ProString &one, const ProString &two);
inline QString operator+(const ProString &one, const QString &two)
{ return one.toQStringRef() + two; }
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index e350923e83..7041a2402e 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -107,7 +107,7 @@ QMakeBaseKey::QMakeBaseKey(const QString &_root, const QString &_stash, bool _ho
{
}
-uint qHash(const QMakeBaseKey &key)
+size_t qHash(const QMakeBaseKey &key)
{
return qHash(key.root) ^ qHash(key.stash) ^ (uint)key.hostBuild;
}
diff --git a/qmake/library/qmakeglobals.h b/qmake/library/qmakeglobals.h
index 6c00b1f3af..58b22ba8c5 100644
--- a/qmake/library/qmakeglobals.h
+++ b/qmake/library/qmakeglobals.h
@@ -62,7 +62,7 @@ public:
bool hostBuild;
};
-uint qHash(const QMakeBaseKey &key);
+size_t qHash(const QMakeBaseKey &key);
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two);
class QMakeBaseEnv