diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-09-28 14:16:36 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-29 06:12:32 (GMT) |
commit | d65dbb5d508d4cdbc383686428430035c205b21c (patch) | |
tree | 35457ae8b8cb93fdae295ac28c78d221091b98d9 /src/gui/kernel | |
parent | 66e7e69f00a08664f0c0a6ed62a37a6918eaf8f3 (diff) | |
download | Qt-d65dbb5d508d4cdbc383686428430035c205b21c.zip Qt-d65dbb5d508d4cdbc383686428430035c205b21c.tar.gz Qt-d65dbb5d508d4cdbc383686428430035c205b21c.tar.bz2 |
Fix g++/MinGW compiler warnings.
- Assigned/Unused variables.
- Unsigned comparison >= 0 is always true.
- Constructor initialization order.
- Signed/Unsigned comparisons.
Change-Id: I1f9edab0506573420ed0bf3055252ba48625c8eb
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qkeymapper_win.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qole_win.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp index 681ab6c..dfa7c96 100644 --- a/src/gui/kernel/qkeymapper_win.cpp +++ b/src/gui/kernel/qkeymapper_win.cpp @@ -819,10 +819,10 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool // 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 bool isDeadKey = isADeadKey(msg.wParam, state) @@ -966,7 +966,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool 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; diff --git a/src/gui/kernel/qole_win.cpp b/src/gui/kernel/qole_win.cpp index b111742..7c3be23 100644 --- a/src/gui/kernel/qole_win.cpp +++ b/src/gui/kernel/qole_win.cpp @@ -232,7 +232,6 @@ bool QOleEnumFmtEtc::copyFormatEtc(LPFORMATETC dest, LPFORMATETC src) const *dest = *src; if (src->ptd) { - LPVOID pout; LPMALLOC pmalloc; #if !defined(Q_OS_WINCE) @@ -242,7 +241,7 @@ bool QOleEnumFmtEtc::copyFormatEtc(LPFORMATETC dest, LPFORMATETC src) const #endif return false; - pout = (LPVOID)pmalloc->Alloc(src->ptd->tdSize); + pmalloc->Alloc(src->ptd->tdSize); memcpy(dest->ptd, src->ptd, size_t(src->ptd->tdSize)); pmalloc->Release(); diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 6afac03..5b125b2 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1471,7 +1471,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) data.crect.setRect(x, y, w, h); } else { GetClientRect(q->internalWinId(), &rect); - RECT rcNormalPosition ={0}; + RECT rcNormalPosition ={0, 0, 0, 0}; // Use (0,0) as window position for embedded ActiveQt controls. if (!tlwExtra || !tlwExtra->embedded) GetWindowRect(q->internalWinId(), &rcNormalPosition); |