summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2018-06-20 10:15:14 +0200
committerPaul Lemire <paul.lemire@kdab.com>2018-06-20 13:19:13 +0000
commitbe0cd9c0b19f1f1b72d2bc165e948d162b998f88 (patch)
tree9f5d2c1d94f75850c4e4667f753714be763f095a
parent7b2d0fdba63c0aca5e37f59706455618787a44eb (diff)
Fix compile warnings
Change-Id: I71f1352de28383d5105c7ff887191265b509d191 Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r--src/plugins/geometryloaders/default/basegeometryloader.cpp6
-rw-r--r--src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp3
-rw-r--r--src/plugins/sceneparsers/gltf/gltfimporter.cpp3
-rw-r--r--tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp4
-rw-r--r--tests/auto/render/uniform/tst_uniform.cpp2
5 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/geometryloaders/default/basegeometryloader.cpp b/src/plugins/geometryloaders/default/basegeometryloader.cpp
index 2943eec2b..95e56f3b1 100644
--- a/src/plugins/geometryloaders/default/basegeometryloader.cpp
+++ b/src/plugins/geometryloaders/default/basegeometryloader.cpp
@@ -151,7 +151,8 @@ void BaseGeometryLoader::generateGeometry()
}
} // of buffer filling loop
- QBuffer *buf(new QBuffer(QBuffer::VertexBuffer));
+ QBuffer *buf = new QBuffer();
+ buf->setType(QBuffer::VertexBuffer);
buf->setData(bufferBytes);
if (m_geometry)
@@ -197,7 +198,8 @@ void BaseGeometryLoader::generateGeometry()
memcpy(indexBytes.data(), reinterpret_cast<const char*>(m_indices.data()), indexBytes.size());
}
- QBuffer *indexBuffer(new QBuffer(QBuffer::IndexBuffer));
+ QBuffer *indexBuffer = new QBuffer();
+ indexBuffer->setType(QBuffer::IndexBuffer);
indexBuffer->setData(indexBytes);
QAttribute *indexAttribute = new QAttribute(indexBuffer, ty, 1, m_indices.size());
indexAttribute->setAttributeType(QAttribute::IndexAttribute);
diff --git a/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp b/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp
index ecb3824c9..b16f87f02 100644
--- a/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp
+++ b/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp
@@ -329,7 +329,8 @@ void GLTFGeometryLoader::processJSONBufferView(const QString &id, const QJsonObj
qUtf16PrintableImpl(bufferData.path), qUtf16PrintableImpl(id));
}
- Qt3DRender::QBuffer *b(new Qt3DRender::QBuffer(ty));
+ Qt3DRender::QBuffer *b = new Qt3DRender::QBuffer();
+ b->setType(ty);
b->setData(bytes);
m_gltf1.m_buffers[id] = b;
}
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
index d2f04d5cb..7df3e26d1 100644
--- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp
@@ -1167,7 +1167,8 @@ void GLTFImporter::processJSONBufferView(const QString &id, const QJsonObject& j
qUtf16PrintableImpl(bufferData.path), qUtf16PrintableImpl(id));
}
- Qt3DRender::QBuffer *b(new Qt3DRender::QBuffer(ty));
+ Qt3DRender::QBuffer *b = new Qt3DRender::QBuffer();
+ b->setType(ty);
b->setData(bytes);
m_buffers[id] = b;
}
diff --git a/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp b/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp
index 6a1c8da8c..78dff8b64 100644
--- a/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp
+++ b/tests/auto/animation/qcallbackmapping/tst_qcallbackmapping.cpp
@@ -125,7 +125,7 @@ private Q_SLOTS:
QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::CallbackMapping);
QCOMPARE(mapping.channelName(), data.channelName);
QCOMPARE(mapping.callback(), data.callback);
- QCOMPARE(QVariant::Vector3D, data.type);
+ QCOMPARE(int(QVariant::Vector3D), data.type);
}
// WHEN
@@ -194,7 +194,7 @@ private Q_SLOTS:
auto change = arbiter.events.at(0).staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "type");
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
- QCOMPARE(change->value().toInt(), QVariant::Vector3D);
+ QCOMPARE(change->value().toInt(), int(QVariant::Vector3D));
change = arbiter.events.at(1).staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "callback");
diff --git a/tests/auto/render/uniform/tst_uniform.cpp b/tests/auto/render/uniform/tst_uniform.cpp
index c0e33f49b..5f946afa3 100644
--- a/tests/auto/render/uniform/tst_uniform.cpp
+++ b/tests/auto/render/uniform/tst_uniform.cpp
@@ -149,7 +149,7 @@ private Q_SLOTS:
UniformValue v(nodeId);
// THEN
- QCOMPARE(v.byteSize(), sizeof(Qt3DCore::QNodeId));
+ QCOMPARE(uint(v.byteSize()), sizeof(Qt3DCore::QNodeId));
QCOMPARE(v.constData<Qt3DCore::QNodeId>()[0], nodeId);
}
}