From 46a2818ead9a1ffd9990a36b19d68b19fdc3d291 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 14 Dec 2017 16:42:40 +0100 Subject: [PATCH] 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 --- src/plugins/qmlprofiler/tests/qmlevent_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprofiler/tests/qmlevent_test.cpp b/src/plugins/qmlprofiler/tests/qmlevent_test.cpp index f834579054d..f832c02f49a 100644 --- a/src/plugins/qmlprofiler/tests/qmlevent_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlevent_test.cpp @@ -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 numbers(1 << 17); std::memset(numbers.data(), 0, (1 << 17));