summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtimezoneprivate.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-05-16 16:43:42 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2017-06-13 11:27:57 +0000
commit536b918ecaed0b8a04ca2b7c0884eea12ddb6931 (patch)
treeac3b1cbf853daa45594865142ec2a5c3879a8f62 /src/corelib/tools/qtimezoneprivate.cpp
parent748d87f28f87fd12b5a1e156025a92c32b73ae8e (diff)
QTimeZone: make UTC offset range available for other code to reuse
When QDateTimeParser learns to parse zones, it'll need to know the valid range of offsets. Change-Id: I44cd88a140ebaf6a2b98b0f9a1be0cbc7a35bae4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qtimezoneprivate.cpp')
-rw-r--r--src/corelib/tools/qtimezoneprivate.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp
index 7b780ecf7d..e45dd48de0 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/tools/qtimezoneprivate.cpp
@@ -258,6 +258,8 @@ QTimeZonePrivate::Data QTimeZonePrivate::dataForLocalTime(qint64 forLocalMSecs,
brackets the correct time and at most one DST transition.
*/
const qint64 sixteenHoursInMSecs(16 * 3600 * 1000);
+ Q_STATIC_ASSERT(-sixteenHoursInMSecs / 1000 < QTimeZone::MinUtcOffsetSecs
+ && sixteenHoursInMSecs / 1000 > QTimeZone::MaxUtcOffsetSecs);
/*
Offsets are Local - UTC, positive to the east of Greenwich, negative to
the west; DST offset always exceeds standard offset, when DST applies.