summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-01-20 17:07:12 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2022-01-21 21:45:11 +0100
commit6db1284de91b9a5112e602fd59a3826588f0fce9 (patch)
tree1f03d3166777624dcd1f24121bff55791bb0e50b /tests/auto
parente7115b75306144ed8fd19dd96da605a3d359489c (diff)
Use Q_INT64_C() to express qint64 constants
When int is 32-bit, 0x80000000L is int-min, and (consequently) negating it makes no difference, so MSVC warns about this. Instead of using an L suffix, wrap the constant in Q_INT64_C(). Do the same for similar large constants in the same block. Pick-to: 6.2 6.3 Change-Id: Ib371b932792f170ab7db2e472a4283df3a205af3 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/time/qdate/tst_qdate.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/corelib/time/qdate/tst_qdate.cpp b/tests/auto/corelib/time/qdate/tst_qdate.cpp
index b14903f92f..911ad90a7a 100644
--- a/tests/auto/corelib/time/qdate/tst_qdate.cpp
+++ b/tests/auto/corelib/time/qdate/tst_qdate.cpp
@@ -557,9 +557,9 @@ void tst_QDate::startOfDay_endOfDay_fixed_data()
using Bounds = std::numeric_limits<qint64>;
const QDateTime
first(QDateTime::fromMSecsSinceEpoch(Bounds::min() + 1, Qt::UTC)),
- start32sign(QDateTime::fromMSecsSinceEpoch(-0x80000000L * kilo, Qt::UTC)),
- end32sign(QDateTime::fromMSecsSinceEpoch(0x80000000L * kilo, Qt::UTC)),
- end32unsign(QDateTime::fromMSecsSinceEpoch(0x100000000L * kilo, Qt::UTC)),
+ start32sign(QDateTime::fromMSecsSinceEpoch(Q_INT64_C(-0x80000000) * kilo, Qt::UTC)),
+ end32sign(QDateTime::fromMSecsSinceEpoch(Q_INT64_C(0x80000000) * kilo, Qt::UTC)),
+ end32unsign(QDateTime::fromMSecsSinceEpoch(Q_INT64_C(0x100000000) * kilo, Qt::UTC)),
last(QDateTime::fromMSecsSinceEpoch(Bounds::max(), Qt::UTC));
const struct {