mirror of https://github.com/qt/qt3d.git
Silence some warnings in tests with MSVC2015
Change-Id: I81634986b22871f2c0cb9175925ca6ac4714694f Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
This commit is contained in:
parent
298c6ebcf6
commit
533a07838d
|
@ -75,7 +75,7 @@ void tst_HandleManager::correctPointer()
|
|||
{
|
||||
// GIVEN
|
||||
Qt3DCore::QHandleManager<SimpleResource> manager;
|
||||
SimpleResource *p1 = (SimpleResource *)0xdeadbeef;
|
||||
SimpleResource *p1 = (SimpleResource *)(quintptr)0xdeadbeef;
|
||||
|
||||
// WHEN
|
||||
const Handle h = manager.acquire(p1);
|
||||
|
@ -93,9 +93,9 @@ void tst_HandleManager::correctPointers()
|
|||
// GIVEN
|
||||
Qt3DCore::QHandleManager<SimpleResource> manager;
|
||||
SimpleResource *p[3];
|
||||
p[0] = (SimpleResource *)0xdeadbeef;
|
||||
p[1] = (SimpleResource *)0x11111111;
|
||||
p[2] = (SimpleResource *)0x22222222;
|
||||
p[0] = (SimpleResource *)(quintptr)0xdeadbeef;
|
||||
p[1] = (SimpleResource *)(quintptr)0x11111111;
|
||||
p[2] = (SimpleResource *)(quintptr)0x22222222;
|
||||
|
||||
// WHEN
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
|
@ -211,7 +211,7 @@ void tst_HandleManager::resetRemovesAllEntries()
|
|||
|
||||
// WHEN
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
SimpleResource *p = (SimpleResource *) 0xdead0000 + i;
|
||||
SimpleResource *p = (SimpleResource *)(quintptr)(0xdead0000 + i);
|
||||
const Handle h = manager.acquire(p);
|
||||
|
||||
bool ok = false;
|
||||
|
@ -240,7 +240,7 @@ void tst_HandleManager::maximumEntries()
|
|||
|
||||
// WHEN
|
||||
for (int i = 0; i < (int)Handle::maxIndex(); ++i) {
|
||||
SimpleResource *p = (SimpleResource *) 0xdead0000 + i;
|
||||
SimpleResource *p = (SimpleResource *)(quintptr)(0xdead0000 + i);
|
||||
const Handle h = manager.acquire(p);
|
||||
|
||||
bool ok = false;
|
||||
|
@ -264,7 +264,7 @@ void tst_HandleManager::checkNoCounterOverflow()
|
|||
// GIVEN
|
||||
const int indexBits = 16;
|
||||
Qt3DCore::QHandleManager<SimpleResource, indexBits> manager;
|
||||
SimpleResource *p = (SimpleResource *) 0xdead0000;
|
||||
SimpleResource *p = (SimpleResource *)(quintptr)0xdead0000;
|
||||
Qt3DCore::QHandle<SimpleResource, indexBits> h = manager.acquire(p);
|
||||
|
||||
// THEN
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
|
||||
void sceneChangeEventWithLock(const Qt3DCore::QSceneChangeList &e) Q_DECL_OVERRIDE
|
||||
{
|
||||
for (uint i = 0, m = e.size(); i < m; ++i) {
|
||||
for (size_t i = 0, m = e.size(); i < m; ++i) {
|
||||
events << ChangeRecord(e.at(i), false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -294,8 +294,8 @@ void tst_QFrameAllocator::containsCheckQFrameChunk()
|
|||
ptrs << c.allocate(16);
|
||||
}
|
||||
|
||||
QVERIFY(!c.contains((void *)0xffffffff, 16));
|
||||
QVERIFY(!c2.contains((void *)0xffffffff, 16));
|
||||
QVERIFY(!c.contains((void *)(quintptr)0xffffffff, 16));
|
||||
QVERIFY(!c2.contains((void *)(quintptr)0xffffffff, 16));
|
||||
QVERIFY(c.contains(ptrs.first(), 16));
|
||||
QVERIFY(!c2.contains(ptrs.first(), 16));
|
||||
QVERIFY(c.contains(ptrs.last(), 16));
|
||||
|
@ -305,7 +305,7 @@ void tst_QFrameAllocator::containsCheckQFrameChunk()
|
|||
ptrs << c2.allocate(16);
|
||||
}
|
||||
|
||||
QVERIFY(!c.contains((void *)0xffffffff, 16));
|
||||
QVERIFY(!c.contains((void *)(quintptr)0xffffffff, 16));
|
||||
QVERIFY(!c.contains(ptrs.last(), 16));
|
||||
QVERIFY(c.contains(ptrs.first(), 16));
|
||||
QVERIFY(c2.contains(ptrs.last(), 16));
|
||||
|
|
|
@ -66,15 +66,15 @@ private Q_SLOTS:
|
|||
QTest::newRow("defaultConstructed") << defaultConstructed;
|
||||
|
||||
Qt3DCore::QTransform *matrixPropertySet = new Qt3DCore::QTransform();
|
||||
matrixPropertySet->setMatrix(Qt3DCore::QTransform::rotateAround(QVector3D(0.1877, 0.6868, 0.3884), 45.0, QVector3D(0, 0, 1)));
|
||||
matrixPropertySet->setMatrix(Qt3DCore::QTransform::rotateAround(QVector3D(0.1877f, 0.6868f, 0.3884f), 45.0f, QVector3D(0.0f, 0.0f, 1.0f)));
|
||||
QTest::newRow("matrixPropertySet") << matrixPropertySet;
|
||||
|
||||
Qt3DCore::QTransform *translationSet = new Qt3DCore::QTransform();
|
||||
translationSet->setTranslation(QVector3D(0.1877, 0.6868, 0.3884));
|
||||
translationSet->setTranslation(QVector3D(0.1877f, 0.6868f, 0.3884f));
|
||||
QTest::newRow("translationSet") << translationSet;
|
||||
|
||||
Qt3DCore::QTransform *scaleSet = new Qt3DCore::QTransform();
|
||||
scaleSet->setScale3D(QVector3D(0.1, 0.6, 0.3));
|
||||
scaleSet->setScale3D(QVector3D(0.1f, 0.6f, 0.3f));
|
||||
QTest::newRow("scaleSet") << scaleSet;
|
||||
|
||||
Qt3DCore::QTransform *rotationSet = new Qt3DCore::QTransform();
|
||||
|
@ -326,7 +326,7 @@ private Q_SLOTS:
|
|||
// GIVEN
|
||||
Qt3DCore::QTransform t;
|
||||
Qt3DCore::QTransform t2;
|
||||
QMatrix4x4 m = Qt3DCore::QTransform::rotateAround(QVector3D(0.1877, 0.6868, 0.3884), 45.0, QVector3D(0, 0, 1));
|
||||
QMatrix4x4 m = Qt3DCore::QTransform::rotateAround(QVector3D(0.1877f, 0.6868f, 0.3884f), 45.0f, QVector3D(0.0f, 0.0f, 1.0f));
|
||||
|
||||
// WHEN
|
||||
t.setMatrix(m);
|
||||
|
|
|
@ -238,10 +238,10 @@ void tst_QRay3D::point()
|
|||
QFETCH(QVector3D, point_on_line_pos_0_6);
|
||||
QFETCH(QVector3D, point_on_line_neg_7_2);
|
||||
Qt3DRender::QRay3D line(point, direction);
|
||||
QVERIFY(fuzzyCompare(line.point(0.6), point_on_line_pos_0_6));
|
||||
QVERIFY(fuzzyCompare(line.point(-7.2), point_on_line_neg_7_2));
|
||||
QVERIFY(fuzzyCompare(line.projectedDistance(point_on_line_pos_0_6), 0.6));
|
||||
QVERIFY(fuzzyCompare(line.projectedDistance(point_on_line_neg_7_2), -7.2));
|
||||
QVERIFY(fuzzyCompare(line.point(0.6f), point_on_line_pos_0_6));
|
||||
QVERIFY(fuzzyCompare(line.point(-7.2f), point_on_line_neg_7_2));
|
||||
QVERIFY(fuzzyCompare(line.projectedDistance(point_on_line_pos_0_6), 0.6f));
|
||||
QVERIFY(fuzzyCompare(line.projectedDistance(point_on_line_neg_7_2), -7.2f));
|
||||
}
|
||||
|
||||
void tst_QRay3D::contains_point_data()
|
||||
|
|
|
@ -313,7 +313,7 @@ void tst_RayCasting::mousePicking()
|
|||
Qt3DRender::QCamera camera;
|
||||
camera.setProjectionType(QCameraLens::PerspectiveProjection);
|
||||
camera.setFieldOfView(45.0f);
|
||||
camera.setAspectRatio(800.0/600.0f);
|
||||
camera.setAspectRatio(800.0f/600.0f);
|
||||
camera.setNearPlane(0.1f);
|
||||
camera.setFarPlane(1000.0f);
|
||||
camera.setPosition(QVector3D(0.0f, 0.0f, -40.0f));
|
||||
|
|
|
@ -104,7 +104,7 @@ private Q_SLOTS:
|
|||
Qt3DRender::QCamera camera;
|
||||
camera.setProjectionType(Qt3DRender::QCameraLens::PerspectiveProjection);
|
||||
camera.setFieldOfView(45.0f);
|
||||
camera.setAspectRatio(800.0/600.0f);
|
||||
camera.setAspectRatio(800.0f/600.0f);
|
||||
camera.setNearPlane(0.1f);
|
||||
camera.setFarPlane(1000.0f);
|
||||
camera.setPosition(QVector3D(0.0f, 0.0f, 40.0f));
|
||||
|
|
|
@ -73,7 +73,7 @@ ExampleScene::~ExampleScene()
|
|||
void ExampleScene::updateScene()
|
||||
{
|
||||
for (int i = 0; i < m_entities.size(); ++i) {
|
||||
const bool visible = (i % 2) ^ m_even;
|
||||
const bool visible = (i % 2) ^ static_cast<int>(m_even);
|
||||
m_entities[i]->setParent(visible ? this : nullptr);
|
||||
}
|
||||
m_even = !m_even;
|
||||
|
|
Loading…
Reference in New Issue