summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qdatetime.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2024-04-10 16:21:49 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2024-04-19 13:56:36 +0200
commit24f5e48fba15ef1954f8c552db961b9141269c98 (patch)
treeef316927e3d301731a33e55aa0f349dabc7324e6 /src/corelib/time/qdatetime.cpp
parent9d242afbd01bef6f5f0455100dc8299980ae08ca (diff)
Apply NSDMI to some internal datetime and timezone types
Although parsedRfcDateTime's clients never read utcOffset unless date and time are valid, and never set them to anything valid without also setting utcOffset, let's not leave it uninitialized by default. The TZ file digester didn't actually set QTzTimeZoneCacheEntry except when setting it to true, so let's make sure it's properly initialized to false. The m_preZoneRule was initialized to all-zeros in one branch of its construction, so set it to that by default so that its default constructor leaves no member uninitialized. These types are only constructed in parsers anyway, so the minor cost of setting fields to zero is dwarfed by string manipulations. Task-number: QTBUG-122619 Change-Id: I6c57fc6d33c379af3f7c6de80c4ca47e431f9d92 Reviewed-by: Mate Barany <mate.barany@qt.io>
Diffstat (limited to 'src/corelib/time/qdatetime.cpp')
-rw-r--r--src/corelib/time/qdatetime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index 2f1f80d70d..199fe0f015 100644
--- a/src/corelib/time/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -130,7 +130,7 @@ ParsedInt readInt(QStringView text)
struct ParsedRfcDateTime {
QDate date;
QTime time;
- int utcOffset;
+ int utcOffset = 0;
};
static int shortDayFromName(QStringView name)