Fix MSVC 64bit warnings about int64 truncation in tests.

Change-Id: Ic98090dbc7e320df652a60fc67a5291c60f7796a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This commit is contained in:
Friedemann Kleint 2014-01-24 15:36:04 +01:00 committed by The Qt Project
parent 1fb42377a2
commit cff2b83b10
3 changed files with 5 additions and 5 deletions

View File

@ -1040,7 +1040,7 @@ void tst_QUrlInternal::encodingRecodeInvalidUtf8()
output = QTest::currentDataTag();
if (!qt_urlRecode(output, input.constData(), input.constData() + input.length(), QUrl::FullyEncoded))
output += input;
for (int i = strlen(QTest::currentDataTag()); i < output.length(); ++i) {
for (int i = int(strlen(QTest::currentDataTag())); i < output.length(); ++i) {
QVERIFY2(output.at(i).unicode() < 0x80 || output.at(i) == QChar::ReplacementCharacter,
qPrintable(QString("Character at i == %1 was U+%2").arg(i).arg(output.at(i).unicode(), 4, 16, QLatin1Char('0'))));
}

View File

@ -469,7 +469,7 @@ void tst_QArrayData::simpleVector()
for (int i = 0; i < 60; ++i)
QCOMPARE(v1[i], v8[i % 10]);
v1.insert(v1.size(), v6.constBegin(), v6.constEnd());
v1.insert(int(v1.size()), v6.constBegin(), v6.constEnd());
// v1 is now [ 0..9 x 6, <new data>0..9 x 3</new data> ]
QCOMPARE(v1.size(), size_t(90));
@ -1235,7 +1235,7 @@ void tst_QArrayData::arrayOps2()
vo.resize(10);
for (size_t i = 7; i < 10; ++i) {
vi[i] = i;
vi[i] = int(i);
vs[i] = QString::number(i);
QCOMPARE(vo[i].id, i);
@ -1727,7 +1727,7 @@ void tst_QArrayData::grow()
// Going element-wise is slow under valgrind
if (previousCapacity - i > 10) {
i = previousCapacity - 5;
vector.back() = -i;
vector.back() = -int(i);
vector.resize(i);
// It's still not the time to re-allocate

View File

@ -133,7 +133,7 @@ public:
memset( reparseInfo, 0, sizeof( *reparseInfo ));
reparseInfo->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
reparseInfo->ReparseTargetLength = DWORD(target.size() * sizeof(wchar_t));
reparseInfo->ReparseTargetLength = WORD(target.size()) * WORD(sizeof(wchar_t));
reparseInfo->ReparseTargetMaximumLength = reparseInfo->ReparseTargetLength + sizeof(wchar_t);
target.toWCharArray(reparseInfo->ReparseTarget);
reparseInfo->ReparseDataLength = reparseInfo->ReparseTargetLength + 12;