From 6d6c0c81edc750e2ac7f9fd4f4772f6d85507464 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 3 May 2017 08:36:50 +0300 Subject: [PATCH] Tests: Minor cleanup in debugger/simple_test_app * Replace double casts with ll suffix, which resolves the warning. * Replace recurring shifts by using a local variable. Change-Id: I344fab50619dc27e68a151abb2f3061543c36662 Reviewed-by: hjk --- tests/manual/debugger/simple/simple_test_app.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 425ce874afd..3bbe0d55201 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -6106,14 +6106,16 @@ namespace qjson { }; QJsonArray arr; for (unsigned int i = 0; i < 32; ++i) { - arr.append(QJsonValue(qint64(quint64(1) << i) - 1)); - arr.append(QJsonValue(qint64(quint64(1) << i))); - arr.append(QJsonValue(qint64(quint64(1) << i) + 1)); + const qint64 bit = 1ll << i; + arr.append(QJsonValue(bit - 1)); + arr.append(QJsonValue(bit)); + arr.append(QJsonValue(bit + 1)); } for (unsigned int i = 0; i < 32; ++i) { - arr.append(QJsonValue(-qint64(quint64(1) << i) + 1)); - arr.append(QJsonValue(-qint64(quint64(1) << i))); - arr.append(QJsonValue(-qint64(quint64(1) << i) - 1)); + const qint64 bit = -(1ll << i); + arr.append(QJsonValue(bit + 1)); + arr.append(QJsonValue(bit)); + arr.append(QJsonValue(bit - 1)); } BREAK_HERE; // Check v -1 QJsonValue.