summaryrefslogtreecommitdiffstats
path: root/src/corelib/time
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-27 15:00:26 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-06-13 15:05:32 +0200
commit4059af81d33bb1f6a7773b77d3039f2fc53fcd23 (patch)
treec0308c515ef615133d58fd821847d0707706e40a /src/corelib/time
parente650ea323f5d7146caa020b69d22ace437609883 (diff)
Stop using mixed enum arithmetic
It's deprecated. Port some unnamed enumerations (used only to declare constants) to constexpr integers instead. Apply qToUnderlying as needed. Task-number: QTBUG-94059 Change-Id: Ifaa64ece966ce08df40dc71ffcfa7ac038110e0b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time')
-rw-r--r--src/corelib/time/qdatetime.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index 319385bb1d..564eeccf6f 100644
--- a/src/corelib/time/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -76,17 +76,15 @@ QT_BEGIN_NAMESPACE
Date/Time Constants
*****************************************************************************/
-enum : qint64 {
- SECS_PER_DAY = 86400,
- MSECS_PER_DAY = 86400000,
- SECS_PER_HOUR = 3600,
- MSECS_PER_HOUR = 3600000,
- SECS_PER_MIN = 60,
- MSECS_PER_MIN = 60000,
- MSECS_PER_SEC = 1000,
- TIME_T_MAX = std::numeric_limits<time_t>::max(),
- JULIAN_DAY_FOR_EPOCH = 2440588 // result of julianDayFromDate(1970, 1, 1)
-};
+constexpr qint64 SECS_PER_DAY = 86400;
+constexpr qint64 MSECS_PER_DAY = 86400000;
+constexpr qint64 SECS_PER_HOUR = 3600;
+constexpr qint64 MSECS_PER_HOUR = 3600000;
+constexpr qint64 SECS_PER_MIN = 60;
+constexpr qint64 MSECS_PER_MIN = 60000;
+constexpr qint64 MSECS_PER_SEC = 1000;
+constexpr qint64 TIME_T_MAX = std::numeric_limits<time_t>::max();
+constexpr qint64 JULIAN_DAY_FOR_EPOCH = 2440588; // result of julianDayFromDate(1970, 1, 1)
/*****************************************************************************
QDate static helper functions