From 37e0953613ef9a3db137bc8d3076441d9ae317d9 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 16 Mar 2021 10:46:16 +0100 Subject: [PATCH] QHash: add a Qt 7 TODO The hashing seed's type has been changed from int to size_t in Qt 6. However the functions setting/getting the seed, and the seed itself, are still simply int, meaning that we've crippled our seeding. Add a TODO to amend it. Change-Id: Ie9dd177149ec299ccf16d4e31f9f4b065804cfed Reviewed-by: Lars Knoll --- src/corelib/tools/qhash.cpp | 1 + src/corelib/tools/qhashfunctions.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 933dff84ab5..092985887f6 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -740,6 +740,7 @@ static uint qt_create_qhash_seed() /* The QHash seed itself. */ +// ### Qt 7: this should use size_t, not int. static QBasicAtomicInt qt_qhash_seed = Q_BASIC_ATOMIC_INITIALIZER(-1); /*! diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index 25f9c1f1e45..018c317834b 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -64,6 +64,7 @@ class QByteArray; class QString; class QLatin1String; +// ### Qt 7: these should use size_t, not int. Q_CORE_EXPORT int qGlobalQHashSeed(); Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);