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 /tests/auto/corelib/tools/collections | |
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 'tests/auto/corelib/tools/collections')
-rw-r--r-- | tests/auto/corelib/tools/collections/tst_collections.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp index 456c3e6cf9..2059cf74cf 100644 --- a/tests/auto/corelib/tools/collections/tst_collections.cpp +++ b/tests/auto/corelib/tools/collections/tst_collections.cpp @@ -2604,7 +2604,7 @@ public: bool operator==(const EqualsComparable &) const { return true; } }; -uint qHash(const EqualsComparable &) +size_t qHash(const EqualsComparable &) { return 0; } @@ -2917,7 +2917,7 @@ public: inline bool operator==(const Aligned4 &other) const { return i == other.i; } inline bool operator<(const Aligned4 &other) const { return i < other.i; } - friend inline int qHash(const Aligned4 &a) { return qHash(a.i); } + friend inline size_t qHash(const Aligned4 &a) { return qHash(a.i); } }; Q_STATIC_ASSERT(alignof(Aligned4) % 4 == 0); @@ -3069,7 +3069,7 @@ template<template<class, class> class C> void QTBUG13079_collectionInsideCollect } -quint32 qHash(const QTBUG13079_Node<QSet> &) +size_t qHash(const QTBUG13079_Node<QSet> &) { return 0; } |