summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-04-01 23:51:10 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-05-23 12:08:43 -0700
commit4ef99b8fbb3ba32df5591ac306fe8a7baa31c92c (patch)
treefac5c9a629fd3e080f4faf74de0e398be40c62a8 /src/corelib
parenta24ced747443868b77d015452280ff83493be60a (diff)
Deprecate qGlobalQHashSeed and qSetGlobalQHashSeed in Qt 6.6
That's two years from when the replacements were added (6.2). Change-Id: Id2983978ad544ff79911fffd1671f7dd38fede02 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qhash.cpp5
-rw-r--r--src/corelib/tools/qhash.h2
-rw-r--r--src/corelib/tools/qhashfunctions.h5
3 files changed, 9 insertions, 3 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
{