From c6cdf38e752c22babdbe645366bdfb7ce51d01ff Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 31 Jan 2020 12:11:54 +0100 Subject: Change qHash() to work with size_t instead of uint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- util/glgen/qopenglversionfunctions.h.header | 2 +- util/glgen/specparser.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'util/glgen') 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(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(v.profile * 1000) + v.version.major * 100 + v.version.minor * 10); } -- cgit v1.2.3