summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-07-19 10:54:05 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-07-22 17:08:43 +0200
commit9159ce0373d5faf852eea69462ba73ea7224fbca (patch)
treec1300d266b09546c6380f2d44aadb508030786cb
parent188d739400e10fc8571bbf2ec86d5cd338b04a5d (diff)
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 4059af81d33bb1f6a7773b77d3039f2fc53fcd23 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>
-rw-r--r--src/corelib/time/qdatetime.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index 3b3668ddf3..65c705907a 100644
--- a/src/corelib/time/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -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;
}
/*!