diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-04-16 12:54:59 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-04-16 14:47:55 +0200 |
commit | c3fcbe73189b26e49ad8fa824b2b8e6b7db0a8f4 (patch) | |
tree | b603742c87fcb512c13a5eb2a02a3ff59c34d543 | |
parent | 3768ec496cb8be1b8bedafd08c19732a405dfeea (diff) |
Change qHash return value to size_t
Else on Windows there's a warning:
conversion from 'size_t' to 'uint', possible loss of data
Change-Id: Ifed4899409a13fed31c206ae1e0f195280ee2925
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
24 files changed, 28 insertions, 28 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp index 5521e7628b..314a0adb0f 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 uint qHash(const QV4Debugger::BreakPoint &b, uint seed = 0) Q_DECL_NOTHROW +inline size_t qHash(const QV4Debugger::BreakPoint &b, uint 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 b4eb442aca..e9fb58de47 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 uint qHash(const BreakPoint &b, uint seed = 0) Q_DECL_NOTHROW +inline size_t qHash(const BreakPoint &b, uint 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 7d9f204910..7b225fb1b6 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 int qHash(const ObjectItem &i, uint seed = 0) +inline size_t qHash(const ObjectItem &i, uint 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 6afb10ea95..9e78ed4175 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 uint qHash(const RegExpCacheKey& key, uint seed = 0) Q_DECL_NOTHROW +inline size_t qHash(const RegExpCacheKey& key, uint seed = 0) Q_DECL_NOTHROW { return qHash(key.pattern, seed); } class RegExpCache : public QHash<RegExpCacheKey, WeakValue> diff --git a/src/qml/qml/ftw/qhashedstring_p.h b/src/qml/qml/ftw/qhashedstring_p.h index a2e10ff143..08f019b4bd 100644 --- a/src/qml/qml/ftw/qhashedstring_p.h +++ b/src/qml/qml/ftw/qhashedstring_p.h @@ -172,12 +172,12 @@ private: mutable quint32 m_hash = 0; }; -inline uint qHash(const QHashedString &string) +inline size_t qHash(const QHashedString &string) { return uint(string.hash()); } -inline uint qHash(const QHashedStringRef &string) +inline size_t qHash(const QHashedStringRef &string) { return uint(string.hash()); } diff --git a/src/qml/qml/qqmlmetatypedata_p.h b/src/qml/qml/qqmlmetatypedata_p.h index 322ead084a..727e57a6de 100644 --- a/src/qml/qml/qqmlmetatypedata_p.h +++ b/src/qml/qml/qqmlmetatypedata_p.h @@ -136,7 +136,7 @@ private: QStringList *m_typeRegistrationFailures = nullptr; }; -inline uint qHash(const QQmlMetaTypeData::VersionedUri &v) +inline size_t qHash(const QQmlMetaTypeData::VersionedUri &v) { return v.uri.hash() ^ qHash(v.majorVersion); } diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 259deb5f32..78d6d05291 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -92,7 +92,7 @@ typedef void (*IRLoaderFunction)(Document *, const QQmlPrivate::CachedQmlUnit *) using QQmlAttachedPropertiesFunc = QQmlPrivate::QQmlAttachedPropertiesFunc<QObject>; -inline uint qHash(QQmlAttachedPropertiesFunc func, uint seed = 0) +inline size_t qHash(QQmlAttachedPropertiesFunc func, uint seed = 0) { return qHash(quintptr(func), seed); } diff --git a/src/qml/qml/qqmlproperty.h b/src/qml/qml/qqmlproperty.h index 34eab8208c..2fd14719c6 100644 --- a/src/qml/qml/qqmlproperty.h +++ b/src/qml/qml/qqmlproperty.h @@ -127,7 +127,7 @@ private: }; typedef QList<QQmlProperty> QQmlProperties; -inline uint qHash (const QQmlProperty &key) +inline size_t qHash (const QQmlProperty &key) { return qHash(key.object()) + qHash(key.name()); } diff --git a/src/qml/qml/qqmltype_p.h b/src/qml/qml/qqmltype_p.h index 7f224b3f60..eb3a773181 100644 --- a/src/qml/qml/qqmltype_p.h +++ b/src/qml/qml/qqmltype_p.h @@ -199,11 +199,11 @@ public: private: friend class QQmlTypePrivate; - friend uint qHash(const QQmlType &t, uint seed); + friend size_t qHash(const QQmlType &t, uint seed); QQmlRefPointer<const QQmlTypePrivate> d; }; -inline uint qHash(const QQmlType &t, uint seed = 0) +inline size_t qHash(const QQmlType &t, uint seed = 0) { return qHash(reinterpret_cast<quintptr>(t.d.data()), seed); } diff --git a/src/qmldebug/qqmlprofilereventlocation_p.h b/src/qmldebug/qqmlprofilereventlocation_p.h index 6f37eab14b..beec3a0eb0 100644 --- a/src/qmldebug/qqmlprofilereventlocation_p.h +++ b/src/qmldebug/qqmlprofilereventlocation_p.h @@ -103,7 +103,7 @@ inline bool operator!=(const QQmlProfilerEventLocation &location1, return !(location1 == location2); } -inline uint qHash(const QQmlProfilerEventLocation &location) +inline size_t qHash(const QQmlProfilerEventLocation &location) { return qHash(location.filename()) ^ ((location.line() & 0xfff) // 12 bits of line number diff --git a/src/qmldebug/qqmlprofilereventtype_p.h b/src/qmldebug/qqmlprofilereventtype_p.h index 7189df53ef..c89115be83 100644 --- a/src/qmldebug/qqmlprofilereventtype_p.h +++ b/src/qmldebug/qqmlprofilereventtype_p.h @@ -97,7 +97,7 @@ private: QDataStream &operator>>(QDataStream &stream, QQmlProfilerEventType &type); QDataStream &operator<<(QDataStream &stream, const QQmlProfilerEventType &type); -inline uint qHash(const QQmlProfilerEventType &type) +inline size_t qHash(const QQmlProfilerEventType &type) { return qHash(type.location()) ^ (((type.message() << 12) & 0xf000) // 4 bits message diff --git a/src/qmlmodels/qqmlchangeset_p.h b/src/qmlmodels/qqmlchangeset_p.h index 5b44d2958c..203518cf90 100644 --- a/src/qmlmodels/qqmlchangeset_p.h +++ b/src/qmlmodels/qqmlchangeset_p.h @@ -149,7 +149,7 @@ private: Q_DECLARE_TYPEINFO(QQmlChangeSet::Change, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QQmlChangeSet::MoveKey, Q_PRIMITIVE_TYPE); -inline uint qHash(const QQmlChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); } +inline size_t qHash(const QQmlChangeSet::MoveKey &key) { return qHash(qMakePair(key.moveId, key.offset)); } inline bool operator ==(const QQmlChangeSet::MoveKey &l, const QQmlChangeSet::MoveKey &r) { return l.moveId == r.moveId && l.offset == r.offset; } diff --git a/src/quick/items/qquickopenglshadereffectnode.cpp b/src/quick/items/qquickopenglshadereffectnode.cpp index 71cfe96462..5ae8985f57 100644 --- a/src/quick/items/qquickopenglshadereffectnode.cpp +++ b/src/quick/items/qquickopenglshadereffectnode.cpp @@ -351,7 +351,7 @@ bool QQuickOpenGLShaderEffectMaterialKey::operator != (const QQuickOpenGLShaderE return !(*this == other); } -uint qHash(const QQuickOpenGLShaderEffectMaterialKey &key) +size_t qHash(const QQuickOpenGLShaderEffectMaterialKey &key) { uint hash = 1; typedef QQuickOpenGLShaderEffectMaterialKey Key; diff --git a/src/quick/items/qquickopenglshadereffectnode_p.h b/src/quick/items/qquickopenglshadereffectnode_p.h index 705b8d4f47..377c34eb95 100644 --- a/src/quick/items/qquickopenglshadereffectnode_p.h +++ b/src/quick/items/qquickopenglshadereffectnode_p.h @@ -81,7 +81,7 @@ struct QQuickOpenGLShaderEffectMaterialKey { bool operator != (const QQuickOpenGLShaderEffectMaterialKey &other) const; }; -uint qHash(const QQuickOpenGLShaderEffectMaterialKey &key); +size_t qHash(const QQuickOpenGLShaderEffectMaterialKey &key); class QQuickCustomMaterialShader; class QQuickOpenGLShaderEffectNode; diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp index 4b807c6e94..ccdf2c9fa5 100644 --- a/src/quick/items/qquicktextnodeengine.cpp +++ b/src/quick/items/qquicktextnodeengine.cpp @@ -698,7 +698,7 @@ void QQuickTextNodeEngine::addFrameDecorations(QTextDocument *document, QTextFra } } -uint qHash(const QQuickTextNodeEngine::BinaryTreeNodeKey &key) +size_t qHash(const QQuickTextNodeEngine::BinaryTreeNodeKey &key) { // Just use the default hash for pairs return qHash(qMakePair(key.fontEngine, qMakePair(key.clipNode, diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 5dac796f2a..ee96085c69 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -4637,7 +4637,7 @@ bool operator!=(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW return !(a == b); } -uint qHash(const GraphicsState &s, uint seed) Q_DECL_NOTHROW +size_t qHash(const GraphicsState &s, uint seed) Q_DECL_NOTHROW { // do not bother with all fields return seed @@ -4665,7 +4665,7 @@ bool operator!=(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKe return !(a == b); } -uint qHash(const GraphicsPipelineStateKey &k, uint seed) Q_DECL_NOTHROW +size_t qHash(const GraphicsPipelineStateKey &k, uint 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 b48220fb8c..da58b98a72 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -645,7 +645,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; -uint qHash(const GraphicsState &s, uint seed = 0) Q_DECL_NOTHROW; +size_t qHash(const GraphicsState &s, uint seed = 0) Q_DECL_NOTHROW; struct ShaderManagerShader; @@ -659,7 +659,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; -uint qHash(const GraphicsPipelineStateKey &k, uint seed = 0) Q_DECL_NOTHROW; +size_t qHash(const GraphicsPipelineStateKey &k, uint seed = 0) Q_DECL_NOTHROW; struct ShaderManagerShader { diff --git a/src/quick/scenegraph/coreapi/qsgtexture.cpp b/src/quick/scenegraph/coreapi/qsgtexture.cpp index 277b422d7c..00ba58d868 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture.cpp +++ b/src/quick/scenegraph/coreapi/qsgtexture.cpp @@ -83,7 +83,7 @@ bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) return !(a == b); } -uint qHash(const QSGSamplerDescription &s, uint seed) Q_DECL_NOTHROW +size_t qHash(const QSGSamplerDescription &s, uint 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 cd6eced3d7..091cf43d8f 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; -uint qHash(const QSGSamplerDescription &s, uint seed = 0) Q_DECL_NOTHROW; +size_t qHash(const QSGSamplerDescription &s, uint seed = 0) Q_DECL_NOTHROW; class Q_QUICK_PRIVATE_EXPORT QSGTexturePrivate : public QObjectPrivate { diff --git a/src/quick/scenegraph/qsgrhishadereffectnode.cpp b/src/quick/scenegraph/qsgrhishadereffectnode.cpp index e804dc96b7..bafd6beaa9 100644 --- a/src/quick/scenegraph/qsgrhishadereffectnode.cpp +++ b/src/quick/scenegraph/qsgrhishadereffectnode.cpp @@ -185,7 +185,7 @@ struct QSGRhiShaderMaterialTypeCache QHash<Key, QSGMaterialType *> m_types; }; -uint qHash(const QSGRhiShaderMaterialTypeCache::Key &key, uint seed = 0) +size_t qHash(const QSGRhiShaderMaterialTypeCache::Key &key, uint seed = 0) { uint hash = seed; for (int i = 0; i < 2; ++i) diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp index 1154c06d7c..c6091758bb 100644 --- a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp +++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp @@ -207,7 +207,7 @@ void QSGDepthStencilBufferManager::insertBuffer(const QSharedPointer<QSGDepthSte m_buffers.insert(buffer->m_format, buffer.toWeakRef()); } -uint qHash(const QSGDepthStencilBuffer::Format &format) +size_t qHash(const QSGDepthStencilBuffer::Format &format) { return qHash(qMakePair(format.size.width(), format.size.height())) ^ (uint(format.samples) << 12) ^ (uint(format.attachments) << 28); diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h b/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h index 10c94a5954..dfcd854fc2 100644 --- a/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h +++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h @@ -140,7 +140,7 @@ private: friend class QSGDepthStencilBuffer; }; -extern uint qHash(const QSGDepthStencilBuffer::Format &format); +extern size_t qHash(const QSGDepthStencilBuffer::Format &format); QT_END_NAMESPACE diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index d96ebe70b2..8dde8fbdd9 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1033,7 +1033,7 @@ inline bool operator==(const QQuickPixmapKey &lhs, const QQuickPixmapKey &rhs) lhs.options == rhs.options; } -inline uint qHash(const QQuickPixmapKey &key) +inline size_t qHash(const QQuickPixmapKey &key) { return qHash(*key.url) ^ (key.size->width()*7) ^ (key.size->height()*17) ^ (key.frame*23) ^ (key.region->x()*29) ^ (key.region->y()*31) ^ (key.options.autoTransform() * 0x5c5c5c5c); diff --git a/src/quickshapes/qquickshape_p_p.h b/src/quickshapes/qquickshape_p_p.h index e9b89d2ab3..7851137465 100644 --- a/src/quickshapes/qquickshape_p_p.h +++ b/src/quickshapes/qquickshape_p_p.h @@ -200,7 +200,7 @@ struct QQuickShapeGradientCacheKey } }; -inline uint qHash(const QQuickShapeGradientCacheKey &v, uint seed = 0) +inline size_t qHash(const QQuickShapeGradientCacheKey &v, uint seed = 0) { uint h = seed + v.spread; for (int i = 0; i < 3 && i < v.stops.count(); ++i) |