diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-01-31 12:11:54 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-04-09 20:03:25 +0200 |
commit | c6cdf38e752c22babdbe645366bdfb7ce51d01ff (patch) | |
tree | 450b02523cb5a16791674ad1d06fb68c72eac971 /util/glgen | |
parent | 775945137b6ef62de9a7d416b1fe59d79006ba82 (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 'util/glgen')
-rw-r--r-- | util/glgen/qopenglversionfunctions.h.header | 2 | ||||
-rw-r--r-- | util/glgen/specparser.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/util/glgen/qopenglversionfunctions.h.header b/util/glgen/qopenglversionfunctions.h.header index 3e57bf0277..951d09c1d1 100644 --- a/util/glgen/qopenglversionfunctions.h.header +++ b/util/glgen/qopenglversionfunctions.h.header @@ -78,7 +78,7 @@ struct QOpenGLVersionStatus OpenGLStatus status; }; -inline uint qHash(const QOpenGLVersionStatus &v, uint seed) +inline size_t qHash(const QOpenGLVersionStatus &v, size_t seed) { return qHash(static_cast<int>(v.status * 1000) + v.version.first * 100 + v.version.second * 10, seed); diff --git a/util/glgen/specparser.h b/util/glgen/specparser.h index 7fee5c4df9..38051f9f43 100644 --- a/util/glgen/specparser.h +++ b/util/glgen/specparser.h @@ -77,7 +77,7 @@ inline bool operator <= (const Version &lhs, const Version &rhs) return !(lhs > rhs); } -inline uint qHash(const Version &v) +inline size_t qHash(const Version &v) { return qHash(v.major * 100 + v.minor * 10); } @@ -118,7 +118,7 @@ inline bool operator < (const VersionProfile &lhs, const VersionProfile &rhs) return (lhs.version < rhs.version); } -inline uint qHash(const VersionProfile &v) +inline size_t Hash(const VersionProfile &v) { return qHash(static_cast<int>(v.profile * 1000) + v.version.major * 100 + v.version.minor * 10); } |