summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2021-05-25 15:42:08 +0200
committerAndreas Buhr <andreas.buhr@qt.io>2021-05-26 13:08:09 +0200
commit7d760480c054bc7abd07b7238ae8bcecc3bc6837 (patch)
tree2dc49f0bad20d1a500ec14564645f98cf29ff2bf /src/corelib/text
parenta1dfe27955ab2da27551d19500c2d2a01d46e470 (diff)
Initialize SYSTEMTIME to {} instead of memset()ing
Change-Id: I7ee02a6bcf5961adce26b635f12722e12c4865d3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qlocale_win.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp
index c73e937581..0c83dcffb9 100644
--- a/src/corelib/text/qlocale_win.cpp
+++ b/src/corelib/text/qlocale_win.cpp
@@ -391,8 +391,7 @@ QVariant QSystemLocalePrivate::monthName(int month, QLocale::FormatType type)
QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type)
{
- SYSTEMTIME st;
- memset(&st, 0, sizeof(SYSTEMTIME));
+ SYSTEMTIME st = {};
st.wYear = date.year();
st.wMonth = date.month();
st.wDay = date.day();
@@ -410,8 +409,7 @@ QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type)
QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type)
{
- SYSTEMTIME st;
- memset(&st, 0, sizeof(SYSTEMTIME));
+ SYSTEMTIME st = {};
st.wHour = time.hour();
st.wMinute = time.minute();
st.wSecond = time.second();