From e4505acd12435f1b7d0dabe79823ccb7e26011e9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Jun 2012 16:14:40 +0200 Subject: Windows: Fix MinGW warnings. - Missing initializers for structs - Missing enumeration value - Mixing enumeration/ints in operator ? Change-Id: I149ab01ad2ebd04f89e5c699905d5ba724828e0f Reviewed-by: Mark Brand Reviewed-by: Jonathan Liu Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qwizard_win.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/widgets/dialogs/qwizard_win.cpp') diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 6359ebfb09..4a4f109a82 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -306,7 +306,7 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type) { bool value = false; if (vistaState() == VistaAero) { - WIZ_MARGINS mar = {0}; + WIZ_MARGINS mar = {0, 0, 0, 0}; if (type == NormalTitleBar) mar.cyTopHeight = 0; else @@ -639,13 +639,14 @@ bool QVistaHelper::eventFilter(QObject *obj, QEvent *event) HFONT QVistaHelper::getCaptionFont(HANDLE hTheme) { - LOGFONT lf = {0}; + LOGFONT lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } }; if (!hTheme) pGetThemeSysFont(hTheme, WIZ_TMT_CAPTIONFONT, &lf); else { - NONCLIENTMETRICS ncm = {sizeof(NONCLIENTMETRICS)}; + NONCLIENTMETRICS ncm; + ncm.cbSize = sizeof(NONCLIENTMETRICS); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false); lf = ncm.lfMessageFont; } @@ -662,7 +663,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q // Set up a memory DC and bitmap that we'll draw into HDC dcMem; HBITMAP bmp; - BITMAPINFO dib = {{0}}; + BITMAPINFO dib; + ZeroMemory(&dib, sizeof(dib)); dcMem = CreateCompatibleDC(hdc); dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -680,7 +682,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q HFONT hOldFont = (HFONT)SelectObject(dcMem, (HGDIOBJ) hCaptionFont); // Draw the text! - WIZ_DTTOPTS dto = { sizeof(WIZ_DTTOPTS) }; + WIZ_DTTOPTS dto; + dto.dwSize = sizeof(WIZ_DTTOPTS); const UINT uFormat = WIZ_DT_SINGLELINE|WIZ_DT_CENTER|WIZ_DT_VCENTER|WIZ_DT_NOPREFIX; RECT rctext ={0,0, rect.width(), rect.height()}; @@ -708,7 +711,8 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc) // Set up a memory DC and bitmap that we'll draw into HDC dcMem; HBITMAP bmp; - BITMAPINFO dib = {{0}}; + BITMAPINFO dib; + ZeroMemory(&dib, sizeof(dib)); dcMem = CreateCompatibleDC(hdc); dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); -- cgit v1.2.3