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 /src/quick | |
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>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickopenglshadereffectnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickopenglshadereffectnode_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktextnodeengine.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgtexture.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgtexture_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrhishadereffectnode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgdepthstencilbuffer_p.h | 2 | ||||
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 2 |
11 files changed, 13 insertions, 13 deletions
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); |