From 00e0783992a4326fcca93e118edb9a3ed09fd5a4 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Mon, 2 Dec 2019 20:22:44 +0000 Subject: Fix compile warnings Change-Id: Idb253d8cb42809ae21cfbbda70d6b6c75891070f Reviewed-by: Paul Lemire --- tests/auto/animation/animationutils/tst_animationutils.cpp | 4 ++-- tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp | 12 ++++++------ tests/auto/core/threadpooler/tst_threadpooler.cpp | 14 +++++++------- .../render/proximityfiltering/tst_proximityfiltering.cpp | 2 +- tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp | 2 +- tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp | 1 + .../tst_vsyncframeadvanceservice.cpp | 2 +- 7 files changed, 19 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp index 385398bd1..463656557 100644 --- a/tests/auto/animation/animationutils/tst_animationutils.cpp +++ b/tests/auto/animation/animationutils/tst_animationutils.cpp @@ -1047,7 +1047,7 @@ private Q_SLOTS: mapping.type = static_cast(QVariant::Vector3D); mapping.channelIndices = QVector() << 0 << 1 << 2; mapping.callback = &callback; - mapping.callbackFlags = 0; + mapping.callbackFlags = {}; mappingData.push_back(mapping); channelResults = QVector() << 1.0f << 2.0f << 3.0f; @@ -1073,7 +1073,7 @@ private Q_SLOTS: mapping.type = static_cast(QVariant::Double); mapping.channelIndices = QVector() << 0; mapping.callback = &callback; - mapping.callbackFlags = 0; + mapping.callbackFlags = {}; mappingData.push_back(mapping); channelResults = QVector() << 1.0f; diff --git a/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp b/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp index 4bc04fafa..7d8f6eed6 100644 --- a/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp +++ b/tests/auto/core/qcircularbuffer/tst_qcircularbuffer.cpp @@ -166,13 +166,13 @@ void tst_QCircularBuffer::construction() QVERIFY(circ4.size() == 2); QVERIFY(circ4.at(0) == 10); QVERIFY(circ4.at(1) == 10); - QVERIFY(circ4.refCount().load() == 1); + QVERIFY(circ4.refCount().loadRelaxed() == 1); // Copy construct from circ4. Both circ4 and circ5 should now have a // refCount() of 2 since we are using implicit sharing. QCircularBuffer circ5(circ4); - QVERIFY(circ4.refCount().load() == 2); - QVERIFY(circ5.refCount().load() == 2); + QVERIFY(circ4.refCount().loadRelaxed() == 2); + QVERIFY(circ5.refCount().loadRelaxed() == 2); QVERIFY(circ5.capacity() == 5); QVERIFY(circ5.size() == 2); QVERIFY(circ5.at(0) == 10); @@ -199,7 +199,7 @@ void tst_QCircularBuffer::destruction() cir->append(MyComplexType(2)); cir->append(MyComplexType(3)); cir->remove(0); - Q_UNUSED(cir); + Q_UNUSED(cir) // Check that the dtor was called 2 times fewer than the constructor. // At this stage will still have 2 items in the circular buffer. @@ -208,7 +208,7 @@ void tst_QCircularBuffer::destruction() // Destroy the circular buffer and check that the active count // is 0. (Same number of calls to dtor as have been made to the constructors) delete cir; - cir = 0; + cir = nullptr; QVERIFY(MyComplexType::ms_activeCount == 0); } @@ -273,7 +273,7 @@ void tst_QCircularBuffer::clear() circ.clear(); QVERIFY(circ.size() == 0); QVERIFY(circ.capacity() == 3); - QVERIFY(circ.refCount().load() == 1); + QVERIFY(circ.refCount().loadRelaxed() == 1); } void tst_QCircularBuffer::contains() diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index a656c25c1..cfe3480ee 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -195,13 +195,13 @@ void tst_ThreadPooler::defaultPerThread() // GIVEN QAtomicInt callCounter; int maxThreadCount = QThread::idealThreadCount(); - callCounter.store(0); + callCounter.storeRelaxed(0); // WHEN m_jobManager->waitForPerThreadFunction(perThreadFunction, &callCounter); // THEN - QVERIFY(maxThreadCount == callCounter.load()); + QVERIFY(maxThreadCount == callCounter.loadRelaxed()); } void tst_ThreadPooler::defaultAspectQueue() @@ -210,7 +210,7 @@ void tst_ThreadPooler::defaultAspectQueue() QAtomicInt callCounter; int value = 0; // Not used in this test QVector > jobList; - callCounter.store(0); + callCounter.storeRelaxed(0); const int jobCount = 5; // WHEN @@ -223,7 +223,7 @@ void tst_ThreadPooler::defaultAspectQueue() m_jobManager->waitForAllJobs(); // THEN - QVERIFY(jobCount == callCounter.load()); + QVERIFY(jobCount == callCounter.loadRelaxed()); } /* @@ -236,7 +236,7 @@ void tst_ThreadPooler::doubleAspectQueue() QAtomicInt callCounter; int value = 0; // Not used in this test QVector > jobList; - callCounter.store(0); + callCounter.storeRelaxed(0); const int jobCount = 3; // WHEN @@ -258,7 +258,7 @@ void tst_ThreadPooler::doubleAspectQueue() m_jobManager->waitForAllJobs(); // THEN - QVERIFY(jobCount * 2 == callCounter.load()); + QVERIFY(jobCount * 2 == callCounter.loadRelaxed()); } /* @@ -335,7 +335,7 @@ public: quint64 globalAtomicValue() const { - return m_globalAtomic.load(); + return m_globalAtomic.loadRelaxed(); } private: diff --git a/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp b/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp index ad12ffad0..1b65388af 100644 --- a/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp +++ b/tests/auto/render/proximityfiltering/tst_proximityfiltering.cpp @@ -50,7 +50,7 @@ Qt3DCore::QEntity *buildEntityAtDistance(float distance, Qt3DCore::QEntity *pare // create geometry with a valid bounding volume - a single point is sufficient auto geometry = new Qt3DRender::QGeometry; - auto vertexBuffer = new Qt3DRender::QBuffer(Qt3DRender::QBuffer::VertexBuffer, geometry); + auto vertexBuffer = new Qt3DRender::QBuffer(geometry); auto positionAttribute = new Qt3DRender::QAttribute; positionAttribute->setName(Qt3DRender::QAttribute::defaultPositionAttributeName()); diff --git a/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp b/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp index 24febdac4..6116e031e 100644 --- a/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp +++ b/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp @@ -94,7 +94,7 @@ private Q_SLOTS: { Qt3DRender::QFrameGraphNode *nodeWithNestedChildren = new MyFrameGraphNode(); Qt3DRender::QFrameGraphNode *child = new MyFrameGraphNode(nodeWithNestedChildren); - Qt3DCore::QNode *dummy = new Qt3DCore::QNode(nodeWithNestedChildren); + new Qt3DCore::QNode(nodeWithNestedChildren); Qt3DRender::QFrameGraphNode *grandChild = new MyFrameGraphNode(nodeWithNestedChildren); QVector childIds = {child->id(), grandChild->id()}; QTest::newRow("nodeWithNestedChildren") << nodeWithNestedChildren << childIds << true << 4; diff --git a/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp b/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp index 7a08fe018..24dbe514a 100644 --- a/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp +++ b/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp @@ -560,6 +560,7 @@ private slots: QVERIFY(!Qt3DRender::Render::ShaderBuilder::getPrototypeNames().isEmpty()); QFETCH(Qt3DRender::QShaderProgram::ShaderType, type); QFETCH(Qt3DRender::QShaderProgram::ShaderType, notificationType); + Q_UNUSED(notificationType) const auto gl3Api = []{ auto api = Qt3DRender::GraphicsApiFilterData(); diff --git a/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp b/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp index 1238f1800..aafdb36f7 100644 --- a/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp +++ b/tests/auto/render/vsyncframeadvanceservice/tst_vsyncframeadvanceservice.cpp @@ -71,7 +71,7 @@ private: bool isReadyToSubmit() { m_submitSemaphore.acquire(1); - return m_running.load() == 1; + return m_running.loadRelaxed() == 1; } Qt3DRender::Render::VSyncFrameAdvanceService *m_tickService; -- cgit v1.2.3