Remove some now-redundant casts to qint64

One was long redundant. The other two, relatively recently added,
should be redundant thanks to the former enum member MSECS_PER_DAY
being changed to a constexpr qint64 by
commit 4059af81d3

Change-Id: I601ed8dae905fed6399ce29c25545ec651e9838a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
This commit is contained in:
Edward Welbourne 2021-07-19 10:54:05 +02:00
parent 188d739400
commit 9159ce0373

View File

@ -2841,10 +2841,7 @@ bool QDateTimePrivate::epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTi
? QDateTimePrivate::DaylightTime
: QDateTimePrivate::StandardTime;
}
// NB: cast to qint64 here is important to make sure a matching
// add_overflow is found, GCC 7.5.0 fails without this cast
if (add_overflow(msecs, qint64(sys.d->offsetFromUtc(msecs)) * MSECS_PER_SEC, &msecs))
if (add_overflow(msecs, sys.d->offsetFromUtc(msecs) * MSECS_PER_SEC, &msecs))
return false;
msecsToTime(msecs, localDate, localTime);
return true;
@ -4146,9 +4143,7 @@ void QDateTime::setMSecsSinceEpoch(qint64 msecs)
: QDateTimePrivate::StandardTime;
offsetFromUtc = data.offsetFromUtc;
if (!offsetFromUtc
// NB: cast to qint64 here is important to make sure a matching
// add_overflow is found, GCC 7.5.0 fails without this cast
|| !add_overflow(msecs, qint64(offsetFromUtc * MSECS_PER_SEC), &local)) {
|| !add_overflow(msecs, offsetFromUtc * MSECS_PER_SEC, &local)) {
status |= QDateTimePrivate::ValidWhenMask;
}
}
@ -5312,7 +5307,7 @@ QDataStream &operator<<(QDataStream &out, QDate date)
if (out.version() < QDataStream::Qt_5_0)
return out << quint32(date.jd);
else
return out << qint64(date.jd);
return out << date.jd;
}
/*!