Fix compiler warnings from int/size_t mismatches

Cast expliclity to int to silence compiler.

Change-Id: I29649c7da1850d7842318b0b2102ceb57659be3e
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-04-27 16:35:46 +02:00
parent e451d5187e
commit 086687deb2
2 changed files with 2 additions and 2 deletions

View File

@ -1678,7 +1678,7 @@ void tst_QTextCodec::utf8Codec()
QFETCH(int, len);
QString str = codec->toUnicode(utf8.isNull() ? 0 : utf8.constData(),
len < 0 ? qstrlen(utf8.constData()) : len);
len < 0 ? int(qstrlen(utf8.constData())) : len);
QCOMPARE(str, res);
str = QString::fromUtf8(utf8.isNull() ? 0 : utf8.constData(), len);

View File

@ -529,7 +529,7 @@ void tst_QXmlSimpleReader::inputFromString()
{
QString str = "<foo><bar>kake</bar><bar>ja</bar></foo>";
QBuffer buff;
buff.setData((char*)str.utf16(), str.size()*sizeof(ushort));
buff.setData((char*)str.utf16(), int(str.size()*sizeof(ushort)));
QXmlInputSource input(&buff);