diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-11-10 13:37:15 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-11-11 22:44:10 +0100 |
commit | 6845c444d082cfac561b3c8f28f53480ae066746 (patch) | |
tree | 06bd7dfb3a8a7be8fc6956805a9ce69ec8b1acd9 /src/corelib/time | |
parent | 838edd9c48284b97dfc22cf3644bb082035a9a93 (diff) |
Replace enum with constexpr qint64 variables
It's the modern recommended way to do it.
Change-Id: I10db128348014b316c1772d18396f272b0a2b766
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time')
-rw-r--r-- | src/corelib/time/qtimezoneprivate_win.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/corelib/time/qtimezoneprivate_win.cpp b/src/corelib/time/qtimezoneprivate_win.cpp index f144d7937a..ef89baf5fe 100644 --- a/src/corelib/time/qtimezoneprivate_win.cpp +++ b/src/corelib/time/qtimezoneprivate_win.cpp @@ -71,13 +71,11 @@ QT_BEGIN_NAMESPACE static const wchar_t tzRegPath[] = LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones)"; static const wchar_t currTzRegPath[] = LR"(SYSTEM\CurrentControlSet\Control\TimeZoneInformation)"; -enum { - MIN_YEAR = -292275056, - MAX_YEAR = 292278994, - MSECS_PER_DAY = 86400000, - TIME_T_MAX = 2145916799, // int maximum 2037-12-31T23:59:59 UTC - JULIAN_DAY_FOR_EPOCH = 2440588 // result of julianDayFromDate(1970, 1, 1) -}; +constexpr qint64 MIN_YEAR = -292275056; +constexpr qint64 MAX_YEAR = 292278994; +constexpr qint64 MSECS_PER_DAY = 86400000; +constexpr qint64 TIME_T_MAX = 2145916799; // int maximum 2037-12-31T23:59:59 UTC +constexpr qint64 JULIAN_DAY_FOR_EPOCH = 2440588; // result of julianDayFromDate(1970, 1, 1) // Copied from MSDN, see above for link typedef struct _REG_TZI_FORMAT |