diff options
author | Mike Krus <mike.krus@kdab.com> | 2016-05-01 19:28:19 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-05-02 21:36:49 +0000 |
commit | 4a02cbc106cc447aa0bc72828690c01aa2406927 (patch) | |
tree | e4da57d287215c6e2d7adb3d8515f6f41d189ad9 | |
parent | 0a4c91e544608cd2e55c1a4f7834e832648f6674 (diff) |
Fix CLANG reported warnings
Ignored 3rd party libraries
Change-Id: I20e1feac64a8fbfafc736b24d6d8c591192e817b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/plugins/sceneparsers/assimp/assimpio.cpp | 2 | ||||
-rw-r--r-- | src/plugins/sceneparsers/gltf/gltfio.cpp | 10 | ||||
-rw-r--r-- | src/render/frontend/qitemmodelbuffer.cpp | 2 | ||||
-rw-r--r-- | src/render/geometry/qgeometryrenderer.cpp | 1 | ||||
-rw-r--r-- | src/render/graphicshelpers/graphicshelpergl4.cpp | 4 | ||||
-rw-r--r-- | src/render/jobs/pickboundingvolumejob.cpp | 2 | ||||
-rw-r--r-- | tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h | 10 | ||||
-rw-r--r-- | tests/auto/render/buffer/tst_buffer.cpp | 2 | ||||
-rw-r--r-- | tests/auto/render/qbuffer/tst_qbuffer.cpp | 2 |
9 files changed, 19 insertions, 16 deletions
diff --git a/src/plugins/sceneparsers/assimp/assimpio.cpp b/src/plugins/sceneparsers/assimp/assimpio.cpp index eb13def2c..cbb94e347 100644 --- a/src/plugins/sceneparsers/assimp/assimpio.cpp +++ b/src/plugins/sceneparsers/assimp/assimpio.cpp @@ -465,7 +465,7 @@ Qt3DCore::QEntity *AssimpIO::node(aiNode *node) // Add Camera if (m_scene->m_cameras.contains(node)) - m_scene->m_cameras.value(node)->setParent(entityNode); + m_scene->m_cameras[node]->setParent(entityNode); // TO DO : Add lights .... diff --git a/src/plugins/sceneparsers/gltf/gltfio.cpp b/src/plugins/sceneparsers/gltf/gltfio.cpp index 5ffa11048..d2c400ca5 100644 --- a/src/plugins/sceneparsers/gltf/gltfio.cpp +++ b/src/plugins/sceneparsers/gltf/gltfio.cpp @@ -535,7 +535,7 @@ QMaterial *GLTFIO::materialWithCustomShader(const QString &id, const QJsonObject << "for material" << id << "in GLTF file" << m_basePath; return NULL; } - QTechnique *technique = m_techniques.value(techniqueName); + QTechnique *technique = m_techniques[techniqueName]; technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGLES); technique->graphicsApiFilter()->setMajorVersion(2); technique->graphicsApiFilter()->setMinorVersion(0); @@ -551,7 +551,7 @@ QMaterial *GLTFIO::materialWithCustomShader(const QString &id, const QJsonObject qCWarning(GLTFIOLog) << "unknown technique" << coreTechniqueName << "for material" << id << "in GLTF file" << m_basePath; } else { - coreTechnique = m_techniques.value(coreTechniqueName); + coreTechnique = m_techniques[coreTechniqueName]; coreTechnique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL); coreTechnique->graphicsApiFilter()->setMajorVersion(3); coreTechnique->graphicsApiFilter()->setMinorVersion(1); @@ -565,7 +565,7 @@ QMaterial *GLTFIO::materialWithCustomShader(const QString &id, const QJsonObject qCWarning(GLTFIOLog) << "unknown technique" << gl2TechniqueName << "for material" << id << "in GLTF file" << m_basePath; } else { - gl2Technique = m_techniques.value(gl2TechniqueName); + gl2Technique = m_techniques[gl2TechniqueName]; gl2Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL); gl2Technique->graphicsApiFilter()->setMajorVersion(2); gl2Technique->graphicsApiFilter()->setMinorVersion(0); @@ -702,7 +702,7 @@ QMaterial *GLTFIO::commonMaterial(const QJsonObject &jsonObj) QMaterial* GLTFIO::material(const QString &id) { if (m_materialCache.contains(id)) - return m_materialCache.value(id); + return m_materialCache[id]; QJsonObject mats = m_json.object().value(KEY_MATERIALS).toObject(); if (!mats.contains(id)) { @@ -1245,7 +1245,7 @@ QVariant GLTFIO::parameterValueFromJSON(int type, const QJsonValue &value) const qCWarning(GLTFIOLog) << "unknown texture" << textureId; return QVariant(); } else { - return QVariant::fromValue(m_textures.value(textureId)); + return QVariant::fromValue(m_textures.value(textureId, nullptr)); } } } else if (value.isDouble()) { diff --git a/src/render/frontend/qitemmodelbuffer.cpp b/src/render/frontend/qitemmodelbuffer.cpp index 8b6fccc7c..3941ac2fd 100644 --- a/src/render/frontend/qitemmodelbuffer.cpp +++ b/src/render/frontend/qitemmodelbuffer.cpp @@ -257,7 +257,7 @@ QStringList QItemModelBuffer::attributeNames() const QAttribute *QItemModelBuffer::attributeByName(QString nm) const { - return m_attributes.value(nm); + return m_attributes.value(nm, nullptr); } void QItemModelBuffer::onModelDataChanged(const QModelIndex& topLeft, diff --git a/src/render/geometry/qgeometryrenderer.cpp b/src/render/geometry/qgeometryrenderer.cpp index dfd610fe6..90a3fd662 100644 --- a/src/render/geometry/qgeometryrenderer.cpp +++ b/src/render/geometry/qgeometryrenderer.cpp @@ -406,6 +406,7 @@ void QGeometryRenderer::setGeometryFactory(const QGeometryFactoryPtr &factory) */ void QGeometryRenderer::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e) { + Q_UNUSED(e); // TODO: Avoid cloning here // Q_D(QGeometryRenderer); // QScenePropertyChangePtr change = qSharedPointerCast<QScenePropertyChange>(e); diff --git a/src/render/graphicshelpers/graphicshelpergl4.cpp b/src/render/graphicshelpers/graphicshelpergl4.cpp index 72865270b..f8f41aabb 100644 --- a/src/render/graphicshelpers/graphicshelpergl4.cpp +++ b/src/render/graphicshelpers/graphicshelpergl4.cpp @@ -47,7 +47,9 @@ #include <private/qgraphicsutils_p.h> # ifndef QT_OPENGL_4_3 -# define GL_PATCH_VERTICES 36466 +# ifndef GL_PATCH_VERTICES +# define GL_PATCH_VERTICES 36466 +# endif # define GL_ACTIVE_RESOURCES 0x92F5 # define GL_BUFFER_BINDING 0x9302 # define GL_BUFFER_DATA_SIZE 0x9303 diff --git a/src/render/jobs/pickboundingvolumejob.cpp b/src/render/jobs/pickboundingvolumejob.cpp index 07b665c37..63d0d5bb7 100644 --- a/src/render/jobs/pickboundingvolumejob.cpp +++ b/src/render/jobs/pickboundingvolumejob.cpp @@ -146,7 +146,7 @@ static QVector<Entity *> gatherEntities(Entity *entity, QVector<Entity *> entiti for (Entity *child : children) entities = gatherEntities(child, std::move(entities)); } - return std::move(entities); + return entities; } class EntityGatherer diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h b/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h index 2ddeb617d..ab0240419 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h +++ b/tests/auto/quick3d/quick3dnodeinstantiator/stringmodel.h @@ -61,7 +61,7 @@ public: endInsertRows(); } - int rowCount(const QModelIndex &) const + int rowCount(const QModelIndex &) const Q_DECL_OVERRIDE { return items.count(); } @@ -71,7 +71,7 @@ public: return roles; } - virtual int columnCount(const QModelIndex &) const + virtual int columnCount(const QModelIndex &) const Q_DECL_OVERRIDE { return 1; } @@ -81,7 +81,7 @@ public: return rowCount(QModelIndex()) > 0; } - virtual QModelIndex index(int row, int column, const QModelIndex &parent) const + virtual QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE { Q_UNUSED(column); if (row>=0 && row<rowCount(parent)) @@ -90,12 +90,12 @@ public: return QModelIndex(); } - virtual QModelIndex parent(const QModelIndex &) const + virtual QModelIndex parent(const QModelIndex &) const Q_DECL_OVERRIDE { return QModelIndex(); } - QVariant data (const QModelIndex & index, int role) const + QVariant data (const QModelIndex & index, int role) const Q_DECL_OVERRIDE { int row = index.row(); if ((row<0) || (row>=items.count())) diff --git a/tests/auto/render/buffer/tst_buffer.cpp b/tests/auto/render/buffer/tst_buffer.cpp index 3b6a3d434..b26bf8007 100644 --- a/tests/auto/render/buffer/tst_buffer.cpp +++ b/tests/auto/render/buffer/tst_buffer.cpp @@ -47,7 +47,7 @@ public: return QByteArrayLiteral("454"); } - bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const + bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const Q_DECL_FINAL { const TestFunctor *otherFunctor = functor_cast<TestFunctor>(&other); if (otherFunctor != nullptr) diff --git a/tests/auto/render/qbuffer/tst_qbuffer.cpp b/tests/auto/render/qbuffer/tst_qbuffer.cpp index 7dbdd0c74..ab28ca07b 100644 --- a/tests/auto/render/qbuffer/tst_qbuffer.cpp +++ b/tests/auto/render/qbuffer/tst_qbuffer.cpp @@ -49,7 +49,7 @@ public: return QByteArray(); } - bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const + bool operator ==(const Qt3DRender::QBufferDataGenerator &other) const Q_DECL_FINAL { const TestFunctor *otherFunctor = functor_cast<TestFunctor>(&other); if (otherFunctor != nullptr) |