Title: [239092] trunk
Revision
239092
Author
[email protected]
Date
2018-12-11 17:15:55 -0800 (Tue, 11 Dec 2018)

Log Message

[Win][Clang] Fix warning -Wmissing-field-initializers
https://bugs.webkit.org/show_bug.cgi?id=192584

Reviewed by Yusuke Suzuki.

Initialize a struct with '{ }' instead of '= {0}'.

Source/WebCore:

No new tests, no behavior changes.

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::setFileDescriptorData):
(WebCore::setFileContentData):
(WebCore::setUCharData):
(WebCore::setUtf8Data):
(WebCore::setCFData):
* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor):
* platform/win/DefWndProcWindowClass.cpp:
(WebCore::registerClass):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageIconForCachedImageFilename):
* platform/win/PasteboardWin.cpp:
(WebCore::writeURL):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::writeRangeToDataObject):
(WebCore::Pasteboard::writePlainTextToDataObject):
(WebCore::writeFileToDataObject):
(WebCore::Pasteboard::writeMarkup):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::show):
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::WebCore::signedPublicKeyAndChallengeString):

Source/WebKit:

* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::showPopupMenu):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::initializeToolTipWindow):
(WebKit::WebView::setToolTip):

Source/WebKitLegacy/win:

* WebKitMessageLoop.cpp:
(WebKitMessageLoop::run):
* WebView.cpp:
(WebView::onMenuCommand):
(WebView::gesture):
(WebView::setShouldInvertColors):
(WebView::initializeToolTipWindow):
(WebView::setToolTip):
(WebView::fullScreenClientForceRepaint):

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest):
* DumpRenderTree/win/EventSender.cpp:
(makeMsg):
(replaySavedEvents):
(beginDragWithFilesCallback):
* DumpRenderTree/win/PixelDumpSupportWin.cpp:
(createBitmapContextFromWebView):
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(updateMenuItemForHistoryItem):
* MiniBrowser/win/WinMain.cpp:
(wWinMain):
* TestWebKitAPI/win/HostWindow.cpp:
(TestWebKitAPI::HostWindow::clientRect const):
(TestWebKitAPI::HostWindow::registerWindowClass):
* TestWebKitAPI/win/PlatformWebViewWin.cpp:
(TestWebKitAPI::PlatformWebView::registerWindowClass):
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::registerWindowClass):
(WTR::PlatformWebView::windowFrame):
(WTR::PlatformWebView::windowSnapshotImage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (239091 => 239092)


--- trunk/Source/WebCore/ChangeLog	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/ChangeLog	2018-12-12 01:15:55 UTC (rev 239092)
@@ -1,3 +1,42 @@
+2018-12-11  Fujii Hironori  <[email protected]>
+
+        [Win][Clang] Fix warning -Wmissing-field-initializers
+        https://bugs.webkit.org/show_bug.cgi?id=192584
+
+        Reviewed by Yusuke Suzuki.
+
+        Initialize a struct with '{ }' instead of '= {0}'.
+
+        No new tests, no behavior changes.
+
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::lastResortFallbackFont):
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
+        (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
+        * platform/win/ClipboardUtilitiesWin.cpp:
+        (WebCore::setFileDescriptorData):
+        (WebCore::setFileContentData):
+        (WebCore::setUCharData):
+        (WebCore::setUtf8Data):
+        (WebCore::setCFData):
+        * platform/win/CursorWin.cpp:
+        (WebCore::createSharedCursor):
+        * platform/win/DefWndProcWindowClass.cpp:
+        (WebCore::registerClass):
+        * platform/win/DragImageWin.cpp:
+        (WebCore::createDragImageIconForCachedImageFilename):
+        * platform/win/PasteboardWin.cpp:
+        (WebCore::writeURL):
+        (WebCore::Pasteboard::writeString):
+        (WebCore::Pasteboard::writeRangeToDataObject):
+        (WebCore::Pasteboard::writePlainTextToDataObject):
+        (WebCore::writeFileToDataObject):
+        (WebCore::Pasteboard::writeMarkup):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenuWin::show):
+        * platform/win/SSLKeyGeneratorWin.cpp:
+        (WebCore::WebCore::signedPublicKeyAndChallengeString):
+
 2018-12-11  Jer Noble  <[email protected]>
 
         Globally namespaced objects shouldn't use framework-prefixed names

Modified: trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -374,7 +374,7 @@
     }
 
     // Fall back to Non-client metrics fonts.
-    NONCLIENTMETRICS nonClientMetrics = {0};
+    NONCLIENTMETRICS nonClientMetrics { };
     nonClientMetrics.cbSize = sizeof(nonClientMetrics);
     if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(nonClientMetrics), &nonClientMetrics, 0)) {
         if (simpleFont = fontFromDescriptionAndLogFont(fontDescription, nonClientMetrics.lfMessageFont, fallbackFontName))

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -61,7 +61,7 @@
     static ATOM windowAtom;
     static LPCWSTR windowClassName = L"MediaPlayerPrivateFullscreenWindowClass";
     if (!windowAtom) {
-        WNDCLASSEX wcex = {0};
+        WNDCLASSEX wcex { };
         wcex.cbSize = sizeof(wcex);
         wcex.style = CS_HREDRAW | CS_VREDRAW;
         wcex.lpfnWndProc = staticWndProc;
@@ -72,7 +72,7 @@
 
     ASSERT(!m_hwnd);
 
-    MONITORINFO mi = {0};
+    MONITORINFO mi { };
     mi.cbSize = sizeof(MONITORINFO);
     if (!GetMonitorInfo(MonitorFromWindow(parentHwnd, MONITOR_DEFAULTTONEAREST), &mi))
         return;

Modified: trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -424,7 +424,7 @@
 {
     String pathname = passedPathname;
 
-    STGMEDIUM medium = { 0 };
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     medium.hGlobal = ::GlobalAlloc(GPTR, sizeof(FILEGROUPDESCRIPTOR));
@@ -446,7 +446,7 @@
 
 void setFileContentData(IDataObject* dataObject, int size, void* dataBlob)
 {
-    STGMEDIUM medium = { 0 };
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     medium.hGlobal = ::GlobalAlloc(GPTR, size);
@@ -754,7 +754,7 @@
 
 void setUCharData(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings)
 {
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     medium.hGlobal = createGlobalData(dataStrings.first());
@@ -766,7 +766,7 @@
 
 void setUtf8Data(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings)
 {
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     CString charString = dataStrings.first().utf8();
@@ -785,7 +785,7 @@
 #if USE(CF)
 void setCFData(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings)
 {
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     SIZE_T dropFilesSize = sizeof(DROPFILES) + (sizeof(WCHAR) * (dataStrings.first().length() + 2));

Modified: trunk/Source/WebCore/platform/win/CursorWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/CursorWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/CursorWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -111,7 +111,7 @@
         SelectObject(andMaskDC.get(), oldAndMask);
         SelectObject(xorMaskDC.get(), oldXorMask);
 
-        ICONINFO icon = {0};
+        ICONINFO icon { };
         icon.fIcon = FALSE;
         icon.xHotspot = effectiveHotSpot.x();
         icon.yHotspot = effectiveHotSpot.y();

Modified: trunk/Source/WebCore/platform/win/DefWndProcWindowClass.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/DefWndProcWindowClass.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/DefWndProcWindowClass.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -35,7 +35,7 @@
 
 static ATOM registerClass()
 {
-    WNDCLASSW wndClass = {0};
+    WNDCLASSW wndClass { };
     wndClass.lpszClassName = className;
     wndClass.lpfnWndProc = ::DefWindowProcW;
     wndClass.hInstance = instanceHandle();

Modified: trunk/Source/WebCore/platform/win/DragImageWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/DragImageWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/DragImageWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -73,7 +73,7 @@
         
 DragImageRef createDragImageIconForCachedImageFilename(const String& filename)
 {
-    SHFILEINFO shfi = {0};
+    SHFILEINFO shfi { };
     String fname = filename;
     if (FAILED(SHGetFileInfo(stringToNullTerminatedWChar(fname).data(), FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES)))
         return 0;

Modified: trunk/Source/WebCore/platform/win/PasteboardWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/PasteboardWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/PasteboardWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -373,7 +373,7 @@
             title = url.host().toString();
     }
 
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     medium.hGlobal = createGlobalData(url, title);
@@ -417,7 +417,7 @@
     }
 
     if (winType == ClipboardDataTypeText) {
-        STGMEDIUM medium = {0};
+        STGMEDIUM medium { };
         medium.tymed = TYMED_HGLOBAL;
         medium.hGlobal = createGlobalData(data);
         if (!medium.hGlobal)
@@ -440,7 +440,7 @@
     if (!m_writableDataObject)
         return;
 
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     Vector<char> data;
@@ -505,7 +505,7 @@
     if (!m_writableDataObject)
         return;
 
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     String str = text;
@@ -606,7 +606,7 @@
 {
     HRESULT hr = S_OK;
     FORMATETC* fe;
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     if (!fileDescriptor || !fileContent)
@@ -1063,7 +1063,7 @@
     Vector<char> data;
     markupToCFHTML(markup, "", data);
 
-    STGMEDIUM medium = {0};
+    STGMEDIUM medium { };
     medium.tymed = TYMED_HGLOBAL;
 
     medium.hGlobal = createGlobalData(data);

Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/PopupMenuWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -161,7 +161,7 @@
         shouldAnimate = FALSE;
 
     if (shouldAnimate) {
-        RECT viewRect = {0};
+        RECT viewRect { };
         ::GetWindowRect(hostWindow, &viewRect);
         if (!::IsRectEmpty(&viewRect))
             ::AnimateWindow(m_popup, defaultAnimationDuration, AW_BLEND);

Modified: trunk/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp (239091 => 239092)


--- trunk/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebCore/platform/win/SSLKeyGeneratorWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -60,7 +60,7 @@
         if (!CryptExportPublicKeyInfo(hContext, AT_KEYEXCHANGE, X509_ASN_ENCODING, pPubInfo, &dwPubInfoLength))
             break;
 
-        CERT_KEYGEN_REQUEST_INFO requestInfo = { 0 };
+        CERT_KEYGEN_REQUEST_INFO requestInfo { };
         requestInfo.dwVersion = CERT_KEYGEN_REQUEST_V1;
         requestInfo.pwszChallengeString = L"";
         requestInfo.SubjectPublicKeyInfo = *pPubInfo;
@@ -71,7 +71,7 @@
         auto localChallengeWide = stringToNullTerminatedWChar(localChallenge);
         requestInfo.pwszChallengeString = const_cast<wchar_t*>(localChallengeWide.data());
 
-        CRYPT_ALGORITHM_IDENTIFIER signAlgo = { 0 };
+        CRYPT_ALGORITHM_IDENTIFIER signAlgo { };
         signAlgo.pszObjId = szOID_RSA_SHA1RSA;
 
         DWORD dwEncodedLength;

Modified: trunk/Source/WebKit/ChangeLog (239091 => 239092)


--- trunk/Source/WebKit/ChangeLog	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKit/ChangeLog	2018-12-12 01:15:55 UTC (rev 239092)
@@ -1,3 +1,20 @@
+2018-12-11  Fujii Hironori  <[email protected]>
+
+        [Win][Clang] Fix warning -Wmissing-field-initializers
+        https://bugs.webkit.org/show_bug.cgi?id=192584
+
+        Reviewed by Yusuke Suzuki.
+
+        Initialize a struct with '{ }' instead of '= {0}'.
+
+        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
+        (WebKit::ProcessLauncher::launchProcess):
+        * UIProcess/win/WebPopupMenuProxyWin.cpp:
+        (WebKit::WebPopupMenuProxyWin::showPopupMenu):
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::initializeToolTipWindow):
+        (WebKit::WebView::setToolTip):
+
 2018-12-11  Chris Dumez  <[email protected]>
 
         PSON logic gets confused by concurrent decidePolicyForNavigationAction requests

Modified: trunk/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp (239091 => 239092)


--- trunk/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -87,11 +87,11 @@
 
     auto commandLine = stringToNullTerminatedWChar(commandLineBuilder.toString());
 
-    STARTUPINFO startupInfo = { 0 };
+    STARTUPINFO startupInfo { };
     startupInfo.cb = sizeof(startupInfo);
     startupInfo.dwFlags = STARTF_USESHOWWINDOW;
     startupInfo.wShowWindow = SW_HIDE;
-    PROCESS_INFORMATION processInformation = { 0 };
+    PROCESS_INFORMATION processInformation { };
     BOOL result = ::CreateProcess(0, commandLine.data(), 0, 0, true, 0, 0, 0, &startupInfo, &processInformation);
 
     // We can now close the client identifier handle.

Modified: trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp (239091 => 239092)


--- trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -218,7 +218,7 @@
         shouldAnimate = FALSE;
 
     if (shouldAnimate) {
-        RECT viewRect = {0};
+        RECT viewRect { };
         ::GetWindowRect(hostWindow, &viewRect);
 
         if (!::IsRectEmpty(&viewRect)) {

Modified: trunk/Source/WebKit/UIProcess/win/WebView.cpp (239091 => 239092)


--- trunk/Source/WebKit/UIProcess/win/WebView.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKit/UIProcess/win/WebView.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -653,7 +653,7 @@
     if (!m_toolTipWindow)
         return;
 
-    TOOLINFO info = { 0 };
+    TOOLINFO info { };
     info.cbSize = sizeof(info);
     info.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
     info.uId = reinterpret_cast<UINT_PTR>(m_window);
@@ -871,7 +871,7 @@
         return;
 
     if (!toolTip.isEmpty()) {
-        TOOLINFO info = { 0 };
+        TOOLINFO info { };
         info.cbSize = sizeof(info);
         info.uFlags = TTF_IDISHWND;
         info.uId = reinterpret_cast<UINT_PTR>(nativeWindow());

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (239091 => 239092)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2018-12-12 01:15:55 UTC (rev 239092)
@@ -1,3 +1,22 @@
+2018-12-11  Fujii Hironori  <[email protected]>
+
+        [Win][Clang] Fix warning -Wmissing-field-initializers
+        https://bugs.webkit.org/show_bug.cgi?id=192584
+
+        Reviewed by Yusuke Suzuki.
+
+        Initialize a struct with '{ }' instead of '= {0}'.
+
+        * WebKitMessageLoop.cpp:
+        (WebKitMessageLoop::run):
+        * WebView.cpp:
+        (WebView::onMenuCommand):
+        (WebView::gesture):
+        (WebView::setShouldInvertColors):
+        (WebView::initializeToolTipWindow):
+        (WebView::setToolTip):
+        (WebView::fullScreenClientForceRepaint):
+
 2018-12-05  Wenson Hsieh  <[email protected]>
 
         Turn WritingDirection into an enum class

Modified: trunk/Source/WebKitLegacy/win/WebKitMessageLoop.cpp (239091 => 239092)


--- trunk/Source/WebKitLegacy/win/WebKitMessageLoop.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKitLegacy/win/WebKitMessageLoop.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -84,7 +84,7 @@
 
 HRESULT WebKitMessageLoop::run(_In_ HACCEL hAccelTable)
 {
-    MSG msg = { 0 };
+    MSG msg { };
 
     while (GetMessage(&msg, 0, 0, 0)) {
         performMessageLoopTasks();

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (239091 => 239092)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -1785,7 +1785,7 @@
     HMENU hMenu = reinterpret_cast<HMENU>(lParam);
     unsigned index = static_cast<unsigned>(wParam);
 
-    MENUITEMINFO menuItemInfo = { 0 };
+    MENUITEMINFO menuItemInfo { };
     menuItemInfo.cbSize = sizeof(menuItemInfo);
     menuItemInfo.fMask = MIIM_STRING;
     ::GetMenuItemInfo(hMenu, index, true, &menuItemInfo);
@@ -1997,7 +1997,7 @@
 
     HGESTUREINFO gestureHandle = reinterpret_cast<HGESTUREINFO>(lParam);
     
-    GESTUREINFO gi = {0};
+    GESTUREINFO gi { };
     gi.cbSize = sizeof(GESTUREINFO);
 
     if (!GetGestureInfoPtr()(gestureHandle, reinterpret_cast<PGESTUREINFO>(&gi)))
@@ -2484,7 +2484,7 @@
         m_layerTreeHost->setShouldInvertColors(shouldInvertColors);
 #endif
 
-    RECT windowRect = {0};
+    RECT windowRect { };
     frameRect(&windowRect);
 
     // repaint expects logical pixels, so rescale here.
@@ -3191,7 +3191,7 @@
     if (!m_toolTipHwnd)
         return;
 
-    TOOLINFO info = {0};
+    TOOLINFO info { };
     info.cbSize = sizeof(info);
     info.uFlags = TTF_IDISHWND | TTF_SUBCLASS ;
     info.uId = reinterpret_cast<UINT_PTR>(m_viewWindow);
@@ -3213,7 +3213,7 @@
     m_toolTip = toolTip;
 
     if (!m_toolTip.isEmpty()) {
-        TOOLINFO info = {0};
+        TOOLINFO info { };
         info.cbSize = sizeof(info);
         info.uFlags = TTF_IDISHWND;
         info.uId = reinterpret_cast<UINT_PTR>(m_viewWindow);
@@ -7576,7 +7576,7 @@
 void WebView::fullScreenClientForceRepaint()
 {
     ASSERT(m_fullscreenController);
-    RECT windowRect = {0};
+    RECT windowRect { };
     frameRect(&windowRect);
     repaint(windowRect, true /*contentChanged*/, true /*immediate*/, false /*contentOnly*/);
     m_fullscreenController->repaintCompleted();

Modified: trunk/Tools/ChangeLog (239091 => 239092)


--- trunk/Tools/ChangeLog	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/ChangeLog	2018-12-12 01:15:55 UTC (rev 239092)
@@ -1,3 +1,34 @@
+2018-12-11  Fujii Hironori  <[email protected]>
+
+        [Win][Clang] Fix warning -Wmissing-field-initializers
+        https://bugs.webkit.org/show_bug.cgi?id=192584
+
+        Reviewed by Yusuke Suzuki.
+
+        Initialize a struct with '{ }' instead of '= {0}'.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (runTest):
+        * DumpRenderTree/win/EventSender.cpp:
+        (makeMsg):
+        (replaySavedEvents):
+        (beginDragWithFilesCallback):
+        * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+        (createBitmapContextFromWebView):
+        * MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
+        (updateMenuItemForHistoryItem):
+        * MiniBrowser/win/WinMain.cpp:
+        (wWinMain):
+        * TestWebKitAPI/win/HostWindow.cpp:
+        (TestWebKitAPI::HostWindow::clientRect const):
+        (TestWebKitAPI::HostWindow::registerWindowClass):
+        * TestWebKitAPI/win/PlatformWebViewWin.cpp:
+        (TestWebKitAPI::PlatformWebView::registerWindowClass):
+        * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+        (WTR::registerWindowClass):
+        (WTR::PlatformWebView::windowFrame):
+        (WTR::PlatformWebView::windowSnapshotImage):
+
 2018-12-11  Chris Dumez  <[email protected]>
 
         PSON logic gets confused by concurrent decidePolicyForNavigationAction requests

Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (239091 => 239092)


--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -1231,7 +1231,7 @@
     workQueue.clear();
     workQueue.setFrozen(false);
 
-    MSG msg = { 0 };
+    MSG msg { };
     HWND hostWindow;
     webView->hostWindow(&hostWindow);
 

Modified: trunk/Tools/DumpRenderTree/win/EventSender.cpp (239091 => 239092)


--- trunk/Tools/DumpRenderTree/win/EventSender.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/DumpRenderTree/win/EventSender.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -120,7 +120,7 @@
 
 static MSG makeMsg(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
-    MSG result = {0};
+    MSG result { };
     result.hwnd = hwnd;
     result.message = message;
     result.wParam = wParam;
@@ -362,7 +362,7 @@
 {
     replayingSavedEvents = true;
   
-    MSG msg = { 0 };
+    MSG msg { };
 
     while (startOfQueue < endOfQueue && !msgQueue[startOfQueue].delay) {
         msg = msgQueue[startOfQueue++].msg;
@@ -696,7 +696,7 @@
     // We should append "0" in the end of |files| so that |DragQueryFileW| retrieved the number of files correctly from Ole Clipboard.
     files.append(0);
 
-    STGMEDIUM hDropMedium = {0};
+    STGMEDIUM hDropMedium { };
     hDropMedium.tymed = TYMED_HGLOBAL;
     SIZE_T dropFilesSize = sizeof(DROPFILES) + (sizeof(WCHAR) * files.size());
     hDropMedium.hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, dropFilesSize);
@@ -713,7 +713,7 @@
         data[i] = files[i];
     GlobalUnlock(hDropMedium.hGlobal); 
 
-    STGMEDIUM hFileNameMedium = {0};
+    STGMEDIUM hFileNameMedium { };
     hFileNameMedium.tymed = TYMED_HGLOBAL;
     SIZE_T hFileNameSize = sizeof(WCHAR) * files.size();
     hFileNameMedium.hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, hFileNameSize);
@@ -925,7 +925,7 @@
     static JSClassRef eventSenderClass = 0;
 
     if (!eventSenderClass) {
-        JSClassDefinition classDefinition = {0};
+        JSClassDefinition classDefinition { };
         classDefinition.staticFunctions = staticFunctions;
         classDefinition.staticValues = staticValues;
 

Modified: trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp (239091 => 239092)


--- trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/DumpRenderTree/win/PixelDumpSupportWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -62,7 +62,7 @@
     if (!GetWindowRect(webViewWindow, &frame))
         return nullptr;
 
-    BITMAPINFO bmp = {0};
+    BITMAPINFO bmp { };
     bmp.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
     bmp.bmiHeader.biWidth = frame.right - frame.left;
     bmp.bmiHeader.biHeight = -(frame.bottom - frame.top);
@@ -79,7 +79,7 @@
     ::SelectObject(memoryDC.get(), bitmap);
     SendMessage(webViewWindow, WM_PRINT, reinterpret_cast<WPARAM>(memoryDC.get()), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
 
-    BITMAP info = {0};
+    BITMAP info { };
     GetObject(bitmap, sizeof(info), &info);
     ASSERT(info.bmBitsPixel == 32);
 

Modified: trunk/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp (239091 => 239092)


--- trunk/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/MiniBrowser/win/WebKitLegacyBrowserWindow.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -329,7 +329,7 @@
 {
     UINT menuID = IDM_HISTORY_LINK0 + currentHistoryItem;
 
-    MENUITEMINFO menuItemInfo = { 0 };
+    MENUITEMINFO menuItemInfo { };
     menuItemInfo.cbSize = sizeof(MENUITEMINFO);
     menuItemInfo.fMask = MIIM_TYPE;
     menuItemInfo.fType = MFT_STRING;

Modified: trunk/Tools/MiniBrowser/win/WinMain.cpp (239091 => 239092)


--- trunk/Tools/MiniBrowser/win/WinMain.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/MiniBrowser/win/WinMain.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -41,7 +41,7 @@
     _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
 #endif
 
-    MSG msg = {0};
+    MSG msg { };
     HACCEL hAccelTable;
 
     INITCOMMONCONTROLSEX InitCtrlEx;

Modified: trunk/Tools/TestWebKitAPI/win/HostWindow.cpp (239091 => 239092)


--- trunk/Tools/TestWebKitAPI/win/HostWindow.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/TestWebKitAPI/win/HostWindow.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -50,9 +50,9 @@
 
 RECT HostWindow::clientRect() const
 {
-    RECT rect = {0};
+    RECT rect { };
     if (!::GetClientRect(m_window, &rect)) {
-        RECT emptyRect = {0};
+        RECT emptyRect { };
         return emptyRect;
     }
     return rect;
@@ -65,7 +65,7 @@
         return;
     initialized = true;
 
-    WNDCLASSEXW wndClass = {0};
+    WNDCLASSEXW wndClass { };
     wndClass.cbSize = sizeof(wndClass);
     wndClass.style = CS_HREDRAW | CS_VREDRAW;
     wndClass.lpfnWndProc = wndProc;

Modified: trunk/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp (239091 => 239092)


--- trunk/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/TestWebKitAPI/win/PlatformWebViewWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -47,7 +47,7 @@
         return;
     initialized = true;
 
-    WNDCLASSEXW wndClass = {0};
+    WNDCLASSEXW wndClass { };
     wndClass.cbSize = sizeof(wndClass);
     wndClass.style = CS_HREDRAW | CS_VREDRAW;
     wndClass.lpfnWndProc = wndProc;

Modified: trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp (239091 => 239092)


--- trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp	2018-12-12 00:18:13 UTC (rev 239091)
+++ trunk/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp	2018-12-12 01:15:55 UTC (rev 239092)
@@ -49,7 +49,7 @@
         return;
     initialized = true;
 
-    WNDCLASSEXW wndClass = {0};
+    WNDCLASSEXW wndClass { };
     wndClass.cbSize = sizeof(wndClass);
     wndClass.style = CS_HREDRAW | CS_VREDRAW;
     wndClass.lpfnWndProc = DefWindowProc;
@@ -117,7 +117,7 @@
 
 WKRect PlatformWebView::windowFrame()
 {
-    WKRect wkFrame = {0};
+    WKRect wkFrame { };
     RECT r;
 
     if (::GetWindowRect(m_window, &r)) {
@@ -203,7 +203,7 @@
     WebCore::HWndDC windowDC(m_window);
     auto memoryDC = adoptGDIObject(::CreateCompatibleDC(windowDC));
 
-    BITMAPINFO bitmapInfo = {0};
+    BITMAPINFO bitmapInfo { };
     WKRect wkFrame = windowFrame();
     bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
     bitmapInfo.bmiHeader.biWidth = width;
@@ -230,7 +230,7 @@
         0,
         SRCCOPY);
 
-    BITMAP bitmapTag = {0};
+    BITMAP bitmapTag { };
     GetObject(bitmap.get(), sizeof(bitmapTag), &bitmapTag);
     ASSERT(bitmapTag.bmBitsPixel == 32);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to