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 | |
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')
-rw-r--r-- | src/gui/dialogs/qpagesetupdialog_win.cpp | 3 | ||||
-rw-r--r-- | src/gui/itemviews/qtableview.cpp | 1 | ||||
-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 | ||||
-rw-r--r-- | src/gui/painting/qcosmeticstroker.cpp | 1 | ||||
-rw-r--r-- | src/gui/util/qcompleter.cpp | 2 | ||||
-rw-r--r-- | src/gui/util/qsystemtrayicon_win.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qplaintextedit.cpp | 1 |
9 files changed, 11 insertions, 14 deletions
diff --git a/src/gui/dialogs/qpagesetupdialog_win.cpp b/src/gui/dialogs/qpagesetupdialog_win.cpp index c928284..2c647da 100644 --- a/src/gui/dialogs/qpagesetupdialog_win.cpp +++ b/src/gui/dialogs/qpagesetupdialog_win.cpp @@ -101,9 +101,6 @@ int QPageSetupDialog::exec() Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created)); psd.hwndOwner = parent ? parent->winId() : 0; - QRect paperRect = d->printer->paperRect(); - QRect pageRect = d->printer->pageRect(); - psd.Flags = PSD_MARGINS; double multiplier = 1; switch (QLocale::system().measurementSystem()) { diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 3e48993..1476ecb 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -3188,6 +3188,7 @@ void QTableView::selectionChanged(const QItemSelection &selected, { #ifndef QT_NO_ACCESSIBILITY Q_D(QTableView); + Q_UNUSED(d) if (QAccessible::isActive()) { // ### does not work properly for selection ranges. QModelIndex sel = selected.indexes().value(0); 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); diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index a697b73..6c1be87 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -518,7 +518,6 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) Q_ASSERT(type == path.elements() || *type == QPainterPath::MoveToElement); QPointF p = QPointF(points[0], points[1]) * state->matrix; - QPointF movedTo = p; patternOffset = state->lastPen.dashOffset()*64; lastPixel.x = -1; diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index 8245ba1..09cbe2b 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -474,6 +474,8 @@ QMatchData QCompletionEngine::filterHistory() return QMatchData(); bool isDirModel = false; bool isFsModel = false; + Q_UNUSED(isDirModel) + Q_UNUSED(isFsModel) #ifndef QT_NO_DIRMODEL isDirModel = (qobject_cast<QDirModel *>(source) != 0); #endif diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 03853ac..f449b27 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -424,7 +424,7 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId) if (currentIconHandle == winId() && 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, diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index f1fc4bf..71c1b3b 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -1833,7 +1833,6 @@ static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, QRectF */ void QPlainTextEdit::paintEvent(QPaintEvent *e) { - Q_D(QPlainTextEdit); QPainter painter(viewport()); Q_ASSERT(qobject_cast<QPlainTextDocumentLayout*>(document()->documentLayout())); |