From f1398be0f55048ed2ef0ec8b51e376df694d4a70 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 31 Mar 2018 12:09:04 +1100 Subject: Match struct initialization exactly to declaration to avoid warnings from clang. --- win32/PlatWin.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 79970a969..2eab32b60 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -771,7 +771,8 @@ void SurfaceGDI::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fil int height = static_cast(rc.Height()); // Ensure not distorted too much by corners when small cornerSize = std::min(cornerSize, (std::min(width, height) / 2) - 2); - BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}}; + const BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}, + {{0, 0, 0, 0}}}; void *image = 0; HBITMAP hbmMem = CreateDIBSection(hMemDC, &bpih, DIB_RGB_COLORS, &image, NULL, 0); @@ -833,7 +834,8 @@ void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsig rc.top += static_cast((rc.Height() - height) / 2); rc.bottom = rc.top + height; - BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}}; + const BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0}, + {{0, 0, 0, 0}}}; unsigned char *image = 0; HBITMAP hbmMem = CreateDIBSection(hMemDC, &bpih, DIB_RGB_COLORS, reinterpret_cast(&image), NULL, 0); @@ -1777,7 +1779,7 @@ void Window::SetPosition(PRectangle rc) { } static RECT RectFromMonitor(HMONITOR hMonitor) { - MONITORINFO mi = {0}; + MONITORINFO mi = {}; mi.cbSize = sizeof(mi); if (GetMonitorInfo(hMonitor, &mi)) { return mi.rcWork; -- cgit v1.2.3