diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qhash.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qhash.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qhashfunctions.h | 5 | ||||
-rw-r--r-- | src/tools/moc/collectjson.cpp | 2 | ||||
-rw-r--r-- | src/tools/rcc/main.cpp | 4 |
5 files changed, 11 insertions, 7 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 6301e7595d..315b5f17bf 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -868,9 +868,10 @@ void QHashSeed::resetRandomGlobalSeed() qt_qhash_seed.storeRelaxed(seed + 1); } - +#if QT_DEPRECATED_SINCE(6,6) /*! \relates QHash \since 5.6 + \obsolete Use QHashSeed::globalSeed() instead. Returns the current global QHash seed. @@ -886,6 +887,7 @@ int qGlobalQHashSeed() /*! \relates QHash \since 5.6 + \obsolete Use QHashSeed instead. Sets the global QHash seed to \a newSeed. @@ -919,6 +921,7 @@ void qSetGlobalQHashSeed(int newSeed) fprintf(stderr, "qSetGlobalQHashSeed: forced seed value is not 0; ignoring call\n"); } } +#endif // QT_DEPRECATED_SINCE(6,6) /*! \internal diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 4fb68ba0b5..121ffa9fde 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -475,7 +475,7 @@ struct Data numBuckets = GrowthPolicy::bucketsForCapacity(reserve); size_t nSpans = (numBuckets + Span::LocalBucketMask) / Span::NEntries; spans = new Span[nSpans]; - seed = qGlobalQHashSeed(); + seed = QHashSeed::globalSeed(); } Data(const Data &other, size_t reserved = 0) : size(other.size), diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index 76e781da7a..4c2eba3e53 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -64,9 +64,12 @@ class QByteArray; class QString; class QLatin1String; -// ### Qt 7: these should use size_t, not int. +#if QT_DEPRECATED_SINCE(6,6) +QT_DEPRECATED_VERSION_X_6_6("Use QHashSeed instead") Q_CORE_EXPORT int qGlobalQHashSeed(); +QT_DEPRECATED_VERSION_X_6_6("Use QHashSeed instead") Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed); +#endif struct QHashSeed { diff --git a/src/tools/moc/collectjson.cpp b/src/tools/moc/collectjson.cpp index fe499151cb..ed65a9ed08 100644 --- a/src/tools/moc/collectjson.cpp +++ b/src/tools/moc/collectjson.cpp @@ -53,7 +53,7 @@ static bool readFromDevice(QIODevice *device, QJsonArray *allMetaObjects) int collectJson(const QStringList &jsonFiles, const QString &outputFile) { - qSetGlobalQHashSeed(0); + QHashSeed::setDeterministicGlobalSeed(); QFile output; if (outputFile.isEmpty()) { diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp index 45a5150842..eca7991280 100644 --- a/src/tools/rcc/main.cpp +++ b/src/tools/rcc/main.cpp @@ -441,9 +441,7 @@ int main(int argc, char *argv[]) // rcc uses a QHash to store files in the resource system. // we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078 // similar requirements exist for reproducibly builds. - qSetGlobalQHashSeed(0); - if (qGlobalQHashSeed() != 0) - qWarning("Cannot force QHash seed"); + QHashSeed::setDeterministicGlobalSeed(); return QT_PREPEND_NAMESPACE(runRcc)(argc, argv); } |