From 963cbbaa420b12e810d23820b78f73c3eaaa15a8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 30 Oct 2020 16:00:24 +0100 Subject: Replace old Q_DECL statements with modern C++ Since we depend on C++17 now, all of these can go. Change-Id: I0484fd4bb99e4367ec211c29146c316453729959 Reviewed-by: Volker Hilsheimer --- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 12 ++++++------ src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | 12 ++++++------ src/quick/scenegraph/coreapi/qsgtexture.cpp | 6 +++--- src/quick/scenegraph/coreapi/qsgtexture_p.h | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/quick/scenegraph') diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 636b06dfa0..903a98c8ed 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -3889,7 +3889,7 @@ void Renderer::invalidatePipelineCacheDependency(QRhiRenderPassDescriptor *rpDes } } -bool operator==(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW +bool operator==(const GraphicsState &a, const GraphicsState &b) noexcept { return a.depthTest == b.depthTest && a.depthWrite == b.depthWrite @@ -3906,12 +3906,12 @@ bool operator==(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW && a.lineWidth == b.lineWidth; } -bool operator!=(const GraphicsState &a, const GraphicsState &b) Q_DECL_NOTHROW +bool operator!=(const GraphicsState &a, const GraphicsState &b) noexcept { return !(a == b); } -size_t qHash(const GraphicsState &s, size_t seed) Q_DECL_NOTHROW +size_t qHash(const GraphicsState &s, size_t seed) noexcept { // do not bother with all fields return seed @@ -3926,7 +3926,7 @@ size_t qHash(const GraphicsState &s, size_t seed) Q_DECL_NOTHROW + s.sampleCount; } -bool operator==(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) Q_DECL_NOTHROW +bool operator==(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) noexcept { return a.state == b.state && a.sms->programRhi.program == b.sms->programRhi.program @@ -3934,12 +3934,12 @@ bool operator==(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKe && a.layoutCompatibleSrb->isLayoutCompatible(b.layoutCompatibleSrb); } -bool operator!=(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) Q_DECL_NOTHROW +bool operator!=(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) noexcept { return !(a == b); } -size_t qHash(const GraphicsPipelineStateKey &k, size_t seed) Q_DECL_NOTHROW +size_t qHash(const GraphicsPipelineStateKey &k, size_t seed) noexcept { // 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 4a46246ecd..bff9547207 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -642,9 +642,9 @@ struct GraphicsState float lineWidth = 1.0f; }; -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, size_t seed = 0) Q_DECL_NOTHROW; +bool operator==(const GraphicsState &a, const GraphicsState &b) noexcept; +bool operator!=(const GraphicsState &a, const GraphicsState &b) noexcept; +size_t qHash(const GraphicsState &s, size_t seed = 0) noexcept; struct ShaderManagerShader; @@ -656,9 +656,9 @@ struct GraphicsPipelineStateKey const QRhiShaderResourceBindings *layoutCompatibleSrb; }; -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, size_t seed = 0) Q_DECL_NOTHROW; +bool operator==(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) noexcept; +bool operator!=(const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) noexcept; +size_t qHash(const GraphicsPipelineStateKey &k, size_t seed = 0) noexcept; struct ShaderManagerShader { diff --git a/src/quick/scenegraph/coreapi/qsgtexture.cpp b/src/quick/scenegraph/coreapi/qsgtexture.cpp index fc44de7eeb..4bf1e020fd 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture.cpp +++ b/src/quick/scenegraph/coreapi/qsgtexture.cpp @@ -70,7 +70,7 @@ static const bool qsg_leak_check = !qEnvironmentVariableIsEmpty("QML_LEAK_CHECK" QT_BEGIN_NAMESPACE -bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) Q_DECL_NOTHROW +bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept { return a.filtering == b.filtering && a.mipmapFiltering == b.mipmapFiltering @@ -79,12 +79,12 @@ bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) && a.anisotropylevel == b.anisotropylevel; } -bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) Q_DECL_NOTHROW +bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept { return !(a == b); } -size_t qHash(const QSGSamplerDescription &s, size_t seed) Q_DECL_NOTHROW +size_t qHash(const QSGSamplerDescription &s, size_t seed) noexcept { 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 852ed1f501..723c612fb8 100644 --- a/src/quick/scenegraph/coreapi/qsgtexture_p.h +++ b/src/quick/scenegraph/coreapi/qsgtexture_p.h @@ -70,9 +70,9 @@ struct QSGSamplerDescription 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, size_t seed = 0) Q_DECL_NOTHROW; +bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept; +bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept; +size_t qHash(const QSGSamplerDescription &s, size_t seed = 0) noexcept; #if QT_CONFIG(opengl) class Q_QUICK_PRIVATE_EXPORT QSGTexturePlatformOpenGL : public QNativeInterface::QSGOpenGLTexture -- cgit v1.2.3