From f1d37d999bf4088b430c7a42c78ddb5ec827a916 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 17 Sep 2020 09:54:58 +0200 Subject: Match new qHash() signature As documented in Qt 6 porting guide, qHash() should now also accept a size_t as seed in addition to returning it. Change-Id: I2b3ea26f631203468c071fa6ff65f95d82566132 Reviewed-by: Lars Knoll --- src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp | 2 +- .../qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp | 2 +- src/qml/jsruntime/qv4jsonobject_p.h | 2 +- src/qml/jsruntime/qv4regexp_p.h | 2 +- src/qml/qml/qqmlprivate.h | 2 +- src/qml/qml/qqmltype_p.h | 4 ++-- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 4 ++-- src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | 4 ++-- src/quick/scenegraph/coreapi/qsgtexture.cpp | 2 +- src/quick/scenegraph/coreapi/qsgtexture_p.h | 2 +- src/quick/scenegraph/qsgrhishadereffectnode.cpp | 2 +- src/quickshapes/qquickshape_p_p.h | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp index 314a0adb0f..7a5940cdd3 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp @@ -52,7 +52,7 @@ QV4Debugger::BreakPoint::BreakPoint(const QString &fileName, int line) : fileName(fileName), lineNumber(line) {} -inline size_t qHash(const QV4Debugger::BreakPoint &b, uint seed = 0) Q_DECL_NOTHROW +inline size_t qHash(const QV4Debugger::BreakPoint &b, size_t seed = 0) Q_DECL_NOTHROW { return qHash(b.fileName, seed) ^ b.lineNumber; } diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp index e9fb58de47..a8403e15e2 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp @@ -83,7 +83,7 @@ public: int hitCount; }; -inline size_t qHash(const BreakPoint &b, uint seed = 0) Q_DECL_NOTHROW +inline size_t qHash(const BreakPoint &b, size_t seed = 0) Q_DECL_NOTHROW { return qHash(b.fileName, seed) ^ b.lineNumber; } diff --git a/src/qml/jsruntime/qv4jsonobject_p.h b/src/qml/jsruntime/qv4jsonobject_p.h index 7b225fb1b6..9143286975 100644 --- a/src/qml/jsruntime/qv4jsonobject_p.h +++ b/src/qml/jsruntime/qv4jsonobject_p.h @@ -77,7 +77,7 @@ struct ObjectItem { inline bool operator ==(const ObjectItem &a, const ObjectItem &b) { return a.o->d() == b.o->d(); } -inline size_t qHash(const ObjectItem &i, uint seed = 0) +inline size_t qHash(const ObjectItem &i, size_t seed = 0) { return ::qHash((void *)i.o->d(), seed); } struct JsonObject : Object { diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h index 9e78ed4175..ff6cc061ee 100644 --- a/src/qml/jsruntime/qv4regexp_p.h +++ b/src/qml/jsruntime/qv4regexp_p.h @@ -164,7 +164,7 @@ inline RegExpCacheKey::RegExpCacheKey(const RegExp::Data *re) , flags(re->flags) {} -inline size_t qHash(const RegExpCacheKey& key, uint seed = 0) Q_DECL_NOTHROW +inline size_t qHash(const RegExpCacheKey& key, size_t seed = 0) Q_DECL_NOTHROW { return qHash(key.pattern, seed); } class RegExpCache : public QHash diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 244396452b..39bea42df6 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -93,7 +93,7 @@ typedef void (*IRLoaderFunction)(Document *, const QQmlPrivate::CachedQmlUnit *) using QQmlAttachedPropertiesFunc = QQmlPrivate::QQmlAttachedPropertiesFunc; -inline size_t qHash(QQmlAttachedPropertiesFunc func, uint seed = 0) +inline size_t qHash(QQmlAttachedPropertiesFunc func, size_t seed = 0) { return qHash(quintptr(func), seed); } diff --git a/src/qml/qml/qqmltype_p.h b/src/qml/qml/qqmltype_p.h index ac718e2fd4..25e905309f 100644 --- a/src/qml/qml/qqmltype_p.h +++ b/src/qml/qml/qqmltype_p.h @@ -197,11 +197,11 @@ public: private: friend class QQmlTypePrivate; - friend size_t qHash(const QQmlType &t, uint seed); + friend size_t qHash(const QQmlType &t, size_t seed); QQmlRefPointer d; }; -inline size_t qHash(const QQmlType &t, uint seed = 0) +inline size_t qHash(const QQmlType &t, size_t seed = 0) { return qHash(reinterpret_cast(t.d.data()), seed); } diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 51b9df0f45..8091ccad5d 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -3904,7 +3904,7 @@ bool operator!=(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW return !(a == b); } -size_t qHash(const GraphicsState &s, uint seed) Q_DECL_NOTHROW +size_t qHash(const GraphicsState &s, size_t seed) Q_DECL_NOTHROW { // do not bother with all fields return seed @@ -3932,7 +3932,7 @@ bool operator!=(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKe return !(a == b); } -size_t qHash(const GraphicsPipelineStateKey &k, uint seed) Q_DECL_NOTHROW +size_t qHash(const GraphicsPipelineStateKey &k, size_t seed) Q_DECL_NOTHROW { // no srb and rp included due to their special comparison semantics and lack of hash keys return qHash(k.state, seed) + qHash(k.sms->programRhi.program, seed); diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h index 54652df923..4a46246ecd 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -644,7 +644,7 @@ struct GraphicsState bool operator==(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW; bool operator!=(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW; -size_t qHash(const GraphicsState &s, uint seed = 0) Q_DECL_NOTHROW; +size_t qHash(const GraphicsState &s, size_t seed = 0) Q_DECL_NOTHROW; struct ShaderManagerShader; @@ -658,7 +658,7 @@ struct GraphicsPipelineStateKey bool operator==(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) Q_DECL_NOTHROW; bool operator!=(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) Q_DECL_NOTHROW; -size_t qHash(const GraphicsPipelineStateKey &k, uint seed = 0) Q_DECL_NOTHROW; +size_t qHash(const GraphicsPipelineStateKey &k, size_t seed = 0) Q_DECL_NOTHROW; struct ShaderManagerShader { diff --git a/src/quick/scenegraph/coreapi/qsgtexture.cpp b/src/quick/scenegraph/coreapi/qsgtexture.cpp index 66ba477990..0f75e7e04b 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture.cpp +++ b/src/quick/scenegraph/coreapi/qsgtexture.cpp @@ -84,7 +84,7 @@ bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) return !(a == b); } -size_t qHash(const QSGSamplerDescription &s, uint seed) Q_DECL_NOTHROW +size_t qHash(const QSGSamplerDescription &s, size_t seed) Q_DECL_NOTHROW { const int f = s.filtering; const int m = s.mipmapFiltering; diff --git a/src/quick/scenegraph/coreapi/qsgtexture_p.h b/src/quick/scenegraph/coreapi/qsgtexture_p.h index 594cd223f7..05e008978a 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture_p.h +++ b/src/quick/scenegraph/coreapi/qsgtexture_p.h @@ -72,7 +72,7 @@ Q_DECLARE_TYPEINFO(QSGSamplerDescription, Q_MOVABLE_TYPE); bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) Q_DECL_NOTHROW; bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) Q_DECL_NOTHROW; -size_t qHash(const QSGSamplerDescription &s, uint seed = 0) Q_DECL_NOTHROW; +size_t qHash(const QSGSamplerDescription &s, size_t seed = 0) Q_DECL_NOTHROW; #if QT_CONFIG(opengl) class Q_QUICK_PRIVATE_EXPORT QSGTexturePlatformOpenGL : public QPlatformInterface::QSGOpenGLTexture diff --git a/src/quick/scenegraph/qsgrhishadereffectnode.cpp b/src/quick/scenegraph/qsgrhishadereffectnode.cpp index 5c756721f0..57d12a8cf3 100644 --- a/src/quick/scenegraph/qsgrhishadereffectnode.cpp +++ b/src/quick/scenegraph/qsgrhishadereffectnode.cpp @@ -188,7 +188,7 @@ struct QSGRhiShaderMaterialTypeCache QHash m_types; }; -size_t qHash(const QSGRhiShaderMaterialTypeCache::Key &key, uint seed = 0) +size_t qHash(const QSGRhiShaderMaterialTypeCache::Key &key, size_t seed = 0) { size_t hash = seed; for (int i = 0; i < 2; ++i) diff --git a/src/quickshapes/qquickshape_p_p.h b/src/quickshapes/qquickshape_p_p.h index 82aafade87..10dfd268e7 100644 --- a/src/quickshapes/qquickshape_p_p.h +++ b/src/quickshapes/qquickshape_p_p.h @@ -200,7 +200,7 @@ struct QQuickShapeGradientCacheKey } }; -inline size_t qHash(const QQuickShapeGradientCacheKey &v, uint seed = 0) +inline size_t qHash(const QQuickShapeGradientCacheKey &v, size_t seed = 0) { uint h = seed + v.spread; for (int i = 0; i < 3 && i < v.stops.count(); ++i) -- cgit v1.2.3