Initialize SYSTEMTIME to {} instead of memset()ing

Change-Id: I7ee02a6bcf5961adce26b635f12722e12c4865d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
bb10
Andreas Buhr 2021-05-25 15:42:08 +02:00
parent a1dfe27955
commit 7d760480c0
1 changed files with 2 additions and 4 deletions

View File

@ -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();