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>
bb10
Edward Welbourne 2022-01-20 17:07:12 +01:00
parent e7115b7530
commit 6db1284de9
1 changed files with 3 additions and 3 deletions

View File

@ -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 {