Windows: Fix MinGW warnings.

- Missing initializers for structs
- Missing enumeration value
- Mixing enumeration/ints in operator ?

Change-Id: I149ab01ad2ebd04f89e5c699905d5ba724828e0f
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint 2012-06-13 16:14:40 +02:00 committed by Qt by Nokia
parent f681e99e29
commit e4505acd12
6 changed files with 26 additions and 21 deletions

View File

@ -152,7 +152,6 @@ messageDebugEntries[] = {
{WM_KILLFOCUS, "WM_KILLFOCUS", true},
{WM_ENABLE, "WM_ENABLE", true},
{WM_SHOWWINDOW, "WM_SHOWWINDOW", true},
{WM_GETMINMAXINFO, "WM_GETMINMAXINFO"},
{WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
{WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED", true},
{WM_SETCURSOR, "WM_SETCURSOR", false},
@ -199,13 +198,13 @@ messageDebugEntries[] = {
{WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS", true},
{WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD", true},
{WM_CAPTURECHANGED, "WM_CAPTURECHANGED", true},
{WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION"},
{WM_IME_COMPOSITION, "WM_IME_COMPOSITION"},
{WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION"},
{WM_IME_NOTIFY, "WM_IME_NOTIFY"},
{WM_IME_REQUEST, "WM_IME_REQUEST"},
{WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE"},
{WM_THEMECHANGED , "WM_THEMECHANGED"}
{WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION", true},
{WM_IME_COMPOSITION, "WM_IME_COMPOSITION", true},
{WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION", true},
{WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
{WM_IME_REQUEST, "WM_IME_REQUEST", true},
{WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
{WM_THEMECHANGED, "WM_THEMECHANGED", true}
};
static inline const MessageDebugEntry *messageDebugEntry(UINT msg)

View File

@ -398,6 +398,7 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
case QPlatformIntegration::KeyboardInputInterval:
case QPlatformIntegration::ShowIsFullScreen:
case QPlatformIntegration::PasswordMaskDelay:
case QPlatformIntegration::StartDragVelocity:
break; // Not implemented
case QPlatformIntegration::FontSmoothingGamma:
return QVariant(QWindowsFontDatabase::fontSmoothingGamma());

View File

@ -796,10 +796,10 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
// Get the modifier states (may be altered later, depending on key code)
int state = 0;
state |= (nModifiers & ShiftAny ? Qt::ShiftModifier : 0);
state |= (nModifiers & ControlAny ? Qt::ControlModifier : 0);
state |= (nModifiers & AltAny ? Qt::AltModifier : 0);
state |= (nModifiers & MetaAny ? Qt::MetaModifier : 0);
state |= (nModifiers & ShiftAny ? int(Qt::ShiftModifier) : 0);
state |= (nModifiers & ControlAny ? int(Qt::ControlModifier) : 0);
state |= (nModifiers & AltAny ? int(Qt::AltModifier) : 0);
state |= (nModifiers & MetaAny ? int(Qt::MetaModifier) : 0);
// Now we know enough to either have MapVirtualKey or our own keymap tell us if it's a deadkey
const bool isDeadKey = isADeadKey(msg.wParam, state)
@ -920,7 +920,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
case Qt::Key_9:
state |= ((msg.wParam >= '0' && msg.wParam <= '9')
|| (msg.wParam >= VK_OEM_PLUS && msg.wParam <= VK_OEM_3))
? 0 : Qt::KeypadModifier;
? 0 : int(Qt::KeypadModifier);
default:
if ((uint)msg.lParam == 0x004c0001 || (uint)msg.lParam == 0xc04c0001)
state |= Qt::KeypadModifier;

View File

@ -150,7 +150,8 @@ static bool qt_write_dibv5(QDataStream &s, QImage image)
//depth will be always 32
int bpl_bmp = image.width()*4;
BMP_BITMAPV5HEADER bi ={0};
BMP_BITMAPV5HEADER bi;
ZeroMemory(&bi, sizeof(bi));
bi.bV5Size = sizeof(BMP_BITMAPV5HEADER);
bi.bV5Width = image.width();
bi.bV5Height = image.height();

View File

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

View File

@ -466,7 +466,7 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId)
if (currentIconHandle == m_hwnd &&
currentIconId == iconId && !isHidden) {
SendMessage(trayHandle, TB_GETITEMRECT, toolbarButton , (LPARAM)data);
RECT iconRect = {0, 0};
RECT iconRect = {0, 0, 0, 0};
if(ReadProcessMemory(trayProcess, data, &iconRect, sizeof(RECT), &numBytes)) {
MapWindowPoints(trayHandle, NULL, (LPPOINT)&iconRect, 2);
QRect geometry(iconRect.left + 1, iconRect.top + 1,