From 6845c444d082cfac561b3c8f28f53480ae066746 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 10 Nov 2021 13:37:15 +0100 Subject: [PATCH] Replace enum with constexpr qint64 variables It's the modern recommended way to do it. Change-Id: I10db128348014b316c1772d18396f272b0a2b766 Reviewed-by: Thiago Macieira --- src/corelib/time/qtimezoneprivate_win.cpp | 12 +++++------- 1 file 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