From ad51d58450eaf0a0d4fccecfc479e719f5e3ff9b Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 6 Jul 2009 09:23:40 +0200 Subject: Removed pointless variables to silence warnings from RVCT. --- src/corelib/io/qresource.cpp | 4 +--- src/corelib/kernel/qsharedmemory_symbian.cpp | 2 -- src/gui/itemviews/qheaderview.cpp | 6 +----- src/gui/kernel/qwidget_s60.cpp | 6 +----- src/gui/painting/qpainter.cpp | 1 - src/gui/styles/qwindowsstyle.cpp | 4 ---- src/gui/text/qfontengine.cpp | 3 +-- src/gui/widgets/qcalendarwidget.cpp | 11 ----------- src/network/access/qhttpnetworkreply.cpp | 2 -- 9 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 158147b..29bbe4c 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -263,9 +263,8 @@ QResourcePrivate::ensureInitialized() const if(path.startsWith(QLatin1Char(':'))) path = path.mid(1); - bool found = false; if(path.startsWith(QLatin1Char('/'))) { - found = that->load(path); + that->load(path); } else { QMutexLocker lock(resourceMutex()); QStringList searchPaths = *resourceSearchPaths(); @@ -273,7 +272,6 @@ QResourcePrivate::ensureInitialized() const for(int i = 0; i < searchPaths.size(); ++i) { const QString searchPath(searchPaths.at(i) + QLatin1Char('/') + path); if(that->load(searchPath)) { - found = true; that->absoluteFilePath = QLatin1Char(':') + searchPath; break; } diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp index d05f9f3..f564391 100644 --- a/src/corelib/kernel/qsharedmemory_symbian.cpp +++ b/src/corelib/kernel/qsharedmemory_symbian.cpp @@ -134,8 +134,6 @@ bool QSharedMemoryPrivate::create(int size) bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode) { // Grab a pointer to the memory block - TBool readOnly = (mode == QSharedMemory::ReadOnly ? true : false); - if (!chunk.Handle()) { QString function = QLatin1String("QSharedMemory::handle"); QString safeKey = makePlatformSafeKey(key); diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index a44528d..8ae048e 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -2821,16 +2821,12 @@ void QHeaderViewPrivate::setupSectionIndicator(int section, int position) sectionIndicator = new QLabel(viewport); } - int x, y, w, h; + int w, h; int p = q->sectionViewportPosition(section); if (orientation == Qt::Horizontal) { - x = p; - y = 0; w = q->sectionSize(section); h = viewport->height(); } else { - x = 0; - y = p; w = viewport->width(); h = q->sectionSize(section); } diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 4e84ff4..d56c119 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -266,17 +266,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO || type == Qt::Sheet || (flags & Qt::MSWindowsFixedSizeDialogHint)); bool desktop = (type == Qt::Desktop); - bool tool = (type == Qt::Tool || type == Qt::Drawer); + //bool tool = (type == Qt::Tool || type == Qt::Drawer); WId id = 0; if (popup) flags |= Qt::WindowStaysOnTopHint; // a popup stays on top - // always initialize - if (!window) - initializeWindow = true; - TRect clientRect = static_cast(S60->appUi())->ClientRect(); int sw = clientRect.Width(); int sh = clientRect.Height(); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b2e3051..2b3f7c3 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5719,7 +5719,6 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif engine.justify(line); } QFixed x = QFixed::fromReal(p.x()); - QFixed ox = x; for (int i = 0; i < nItems; ++i) { int item = visualOrder[i]; diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index 313db30..062eaec 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -1782,8 +1782,6 @@ case PE_FrameDockWidget: case PE_FrameTabWidget: if (use2000style) { - QRect rect = opt->rect; - QPalette pal = opt->palette; qDrawWinButton(p, opt->rect, opt->palette, false, 0); break; } @@ -2523,7 +2521,6 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai bool floating = false; bool active = dwOpt->state & State_Active; - int menuOffset = 0; //used to center text when floated QColor inactiveCaptionTextColor = d->inactiveCaptionText; if (dwOpt->movable) { QColor left, right; @@ -2538,7 +2535,6 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai left = d->inactiveCaptionColor; right = d->inactiveGradientCaptionColor; } - menuOffset = 2; QBrush fillBrush(left); if (left != right) { QPoint p1(r.x(), r.top() + r.height()/2); diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 06d3516..d82b01f 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1043,9 +1043,8 @@ quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, uint unicode) return 0; quint16 segCountX2 = qFromBigEndian(cmap + 6); const unsigned char *ends = cmap + 14; - quint16 endIndex = 0; int i = 0; - for (; i < segCountX2/2 && (endIndex = qFromBigEndian(ends + 2*i)) < unicode; i++) {} + for (; i < segCountX2/2 && qFromBigEndian(ends + 2*i) < unicode; i++) {} const unsigned char *idx = ends + segCountX2 + 2 + 2*i; quint16 startIndex = qFromBigEndian(idx); diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index 0c1dc2f..744281b 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -2142,14 +2142,11 @@ QSize QCalendarWidget::minimumSizeHint() const int end = 53; int rows = 7; int cols = 8; - int startRow = 0; - int startCol = 0; const int marginH = (style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1) * 2; if (horizontalHeaderFormat() == QCalendarWidget::NoHorizontalHeader) { rows = 6; - startRow = 1; } else { for (int i = 1; i <= 7; i++) { QFontMetrics fm(d->m_model->formatForCell(0, i).font()); @@ -2160,7 +2157,6 @@ QSize QCalendarWidget::minimumSizeHint() const if (verticalHeaderFormat() == QCalendarWidget::NoVerticalHeader) { cols = 7; - startCol = 1; } else { for (int i = 1; i <= 6; i++) { QFontMetrics fm(d->m_model->formatForCell(i, 0).font()); @@ -2527,13 +2523,6 @@ void QCalendarWidget::setDateRange(const QDate &min, const QDate &max) if (!min.isValid() || !max.isValid()) return; - QDate minimum = min; - QDate maximum = max; - if (min > max) { - minimum = max; - maximum = min; - } - QDate oldDate = d->m_model->m_date; d->m_model->setRange(min, max); d->yearEdit->setMinimum(d->m_model->m_minimumDate.year()); diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index 167b957..90e81d6 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -470,8 +470,6 @@ bool QHttpNetworkReplyPrivate::parseStatus(const QByteArray &status) qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket) { qint64 bytes = 0; - char crlfcrlf[5]; - crlfcrlf[4] = '\0'; char c = 0; bool allHeaders = false; while (!allHeaders && socket->bytesAvailable()) { -- cgit v0.12