QmlProfiler: Silence truncation warning

When building Qt Creator with MSVC, this is the only warning I get:
  warning: C4309: 'initializing': truncation of constant value

It would be great to silence it.

MSVC supports the "i8" literal extension, which would be fancier than
the cast, here. But I don't know what other compilers think of it.

Change-Id: I3f1bb4f58f6ab378cbeb44a667aebc5ddee25eec
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Alessandro Portale
2017-12-14 16:42:40 +01:00
parent 29b7914429
commit 46a2818ead

View File

@@ -120,8 +120,8 @@ void QmlEventTest::testNumbers()
void QmlEventTest::testMaxSize()
{
const qint8 marker1 = 0xee;
const qint8 marker2 = 0xbb;
const qint8 marker1 = qint8(0xee);
const qint8 marker2 = qint8(0xbb);
QmlEvent event;
QVarLengthArray<qint8> numbers(1 << 17);
std::memset(numbers.data(), 0, (1 << 17));