diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-10-28 10:24:28 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-01 11:52:03 +0100 |
commit | c29b3c0974383dfe5e2b4890b5d6377d5aa4264e (patch) | |
tree | 8794cef1f6d14b0fc83ba2a3a088ce3b10389255 | |
parent | 80066259f1fcda5d057899592cdecdaff068e9a3 (diff) |
Declarative: Fix gcc 4.6 warnings about assigned/unused variables.
Change-Id: Iac4bb4a6b1aa4071a239bb25f25f01b71e36868b
Reviewed-by: Alexis Menard <alexis.menard@openbossa.org>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
-rw-r--r-- | src/declarative/items/context2d/qquickcontext2d.cpp | 1 | ||||
-rw-r--r-- | src/declarative/items/qquickitemview.cpp | 1 | ||||
-rw-r--r-- | src/declarative/items/qquicklistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/items/qquickshadereffectmesh.cpp | 1 | ||||
-rw-r--r-- | src/declarative/items/qquickspriteimage.cpp | 3 | ||||
-rw-r--r-- | src/declarative/items/qquicktextedit.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecompiler.cpp | 6 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeexpression.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeproperty.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/v4/qv4irbuilder.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/v8/qv8qobjectwrapper.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/v8/qv8typewrapper.cpp | 2 | ||||
-rw-r--r-- | src/declarative/scenegraph/coreapi/qsgmaterial.cpp | 2 | ||||
-rw-r--r-- | src/qmltest/quicktest.cpp | 2 | ||||
-rw-r--r-- | src/qmltest/quicktestresult.cpp | 1 |
15 files changed, 8 insertions, 18 deletions
diff --git a/src/declarative/items/context2d/qquickcontext2d.cpp b/src/declarative/items/context2d/qquickcontext2d.cpp index ade890d943..2297f53769 100644 --- a/src/declarative/items/context2d/qquickcontext2d.cpp +++ b/src/declarative/items/context2d/qquickcontext2d.cpp @@ -120,6 +120,7 @@ QColor qt_color_from_string(v8::Local<v8::Value> name) return QColor(p); else { bool isRgb(false), isHsl(false), hasAlpha(false); + Q_UNUSED(isHsl) while (isspace(*p)) p++; if (strncmp(p, "rgb", 3) == 0) diff --git a/src/declarative/items/qquickitemview.cpp b/src/declarative/items/qquickitemview.cpp index b3429ded7c..923db4747a 100644 --- a/src/declarative/items/qquickitemview.cpp +++ b/src/declarative/items/qquickitemview.cpp @@ -1146,7 +1146,6 @@ qreal QQuickItemViewPrivate::endPosition() const qreal QQuickItemViewPrivate::contentStartPosition() const { - Q_Q(const QQuickItemView); qreal pos = -headerSize(); if (layoutOrientation() == Qt::Vertical) pos -= vData.startMargin; diff --git a/src/declarative/items/qquicklistview.cpp b/src/declarative/items/qquicklistview.cpp index e43a831c4c..0b3460e9fc 100644 --- a/src/declarative/items/qquicklistview.cpp +++ b/src/declarative/items/qquicklistview.cpp @@ -2321,8 +2321,6 @@ void QQuickListView::updateSections() bool QQuickListViewPrivate::applyInsertionChange(const QDeclarativeChangeSet::Insert &change, FxViewItem *firstVisible, InsertionsResult *insertResult) { - Q_Q(QQuickListView); - int modelIndex = change.index; int count = change.count; diff --git a/src/declarative/items/qquickshadereffectmesh.cpp b/src/declarative/items/qquickshadereffectmesh.cpp index 79b37d40bd..7709bed614 100644 --- a/src/declarative/items/qquickshadereffectmesh.cpp +++ b/src/declarative/items/qquickshadereffectmesh.cpp @@ -76,6 +76,7 @@ QSGGeometry *QQuickGridMesh::updateGeometry(QSGGeometry *geometry, const QVector if (!geometry) { bool error = true; + Q_UNUSED(error) switch (attrCount) { case 0: qWarning("QQuickGridMesh:: No attributes specified."); diff --git a/src/declarative/items/qquickspriteimage.cpp b/src/declarative/items/qquickspriteimage.cpp index 098db67f3a..1bfb80944c 100644 --- a/src/declarative/items/qquickspriteimage.cpp +++ b/src/declarative/items/qquickspriteimage.cpp @@ -151,7 +151,7 @@ QQuickSpriteMaterial::~QQuickSpriteMaterial() class SpriteMaterialData : public QSGMaterialShader { public: - SpriteMaterialData(const char *vertexFile = 0, const char *fragmentFile = 0) + SpriteMaterialData(const char * /* vertexFile */ = 0, const char * /* fragmentFile */ = 0) { } @@ -438,7 +438,6 @@ void QQuickSpriteImage::prepareNextFrame() m_material->interpolate = m_interpolate; //Advance State - SpriteVertices *p = (SpriteVertices *) m_node->geometry()->vertexData(); m_spriteEngine->updateSprites(timeInt); int curY = m_spriteEngine->spriteY(); if (curY != m_material->animY){ diff --git a/src/declarative/items/qquicktextedit.cpp b/src/declarative/items/qquicktextedit.cpp index f132c70400..0c13c6dd59 100644 --- a/src/declarative/items/qquicktextedit.cpp +++ b/src/declarative/items/qquicktextedit.cpp @@ -1396,7 +1396,6 @@ void QQuickTextEdit::inputMethodEvent(QInputMethodEvent *event) void QQuickTextEdit::itemChange(ItemChange change, const ItemChangeData &value) { - Q_D(QQuickTextEdit); if (change == ItemActiveFocusHasChanged) { setCursorVisible(value.boolValue); // ### refactor: focus handling && d->canvas && d->canvas->hasFocus()); } diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 782a20eeb4..fb98a8c0ec 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -303,7 +303,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::PointF: { bool ok; - QPointF point = QDeclarativeStringConverters::pointFFromString(value.asString(), &ok); + QDeclarativeStringConverters::pointFFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: point expected")); } break; @@ -311,7 +311,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::SizeF: { bool ok; - QSizeF size = QDeclarativeStringConverters::sizeFFromString(value.asString(), &ok); + QDeclarativeStringConverters::sizeFFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: size expected")); } break; @@ -319,7 +319,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(QDeclarativeScript::Property *p case QVariant::RectF: { bool ok; - QRectF rect = QDeclarativeStringConverters::rectFFromString(value.asString(), &ok); + QDeclarativeStringConverters::rectFFromString(value.asString(), &ok); if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: rect expected")); } break; diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp index d3ba92ab42..bfa9c58d86 100644 --- a/src/declarative/qml/qdeclarativeexpression.cpp +++ b/src/declarative/qml/qdeclarativeexpression.cpp @@ -506,7 +506,6 @@ QDeclarativeJavaScriptExpression::GuardList::updateGuards(QDeclarativeJavaScript } bool outputWarningHeader = false; - bool noChanges = true; for (int ii = 0; ii < properties.count(); ++ii) { Endpoint &guard = endpoints[ii]; const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii); diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index ea3df6c7e0..c630de4040 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -1619,7 +1619,6 @@ QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObject, int in const QMetaObject *subObject, int subIndex, QDeclarativeEngine *) { - QMetaProperty prop = metaObject->property(index); QMetaProperty subProp = subObject->property(subIndex); QDeclarativePropertyData core; diff --git a/src/declarative/qml/v4/qv4irbuilder.cpp b/src/declarative/qml/v4/qv4irbuilder.cpp index a1e753986c..eefaf67474 100644 --- a/src/declarative/qml/v4/qv4irbuilder.cpp +++ b/src/declarative/qml/v4/qv4irbuilder.cpp @@ -75,7 +75,6 @@ static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine, else if (t == qMetaTypeId<QQuickAnchorLine>()) return IR::SGAnchorLineType; else if (const QMetaObject *m = engine->metaObjectForType(t)) { - meta = m; return IR::ObjectType; } diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp index 79d1d20314..c2ee429d5c 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp @@ -1834,7 +1834,6 @@ v8::Handle<v8::Value> QV8QObjectWrapper::Invoke(const v8::Arguments &args) } if (method.coreIndex == -1) { - QMetaMethod mm = object->metaObject()->method(index); method.load(object->metaObject()->method(index)); if (method.coreIndex == -1) diff --git a/src/declarative/qml/v8/qv8typewrapper.cpp b/src/declarative/qml/v8/qv8typewrapper.cpp index 0023afc858..1a3a349524 100644 --- a/src/declarative/qml/v8/qv8typewrapper.cpp +++ b/src/declarative/qml/v8/qv8typewrapper.cpp @@ -159,7 +159,6 @@ QVariant QV8TypeWrapper::toVariant(QV8ObjectResource *r) v8::Handle<v8::Value> QV8TypeWrapper::Getter(v8::Local<v8::String> property, const v8::AccessorInfo &info) { - v8::Object::ExternalResource *r = info.This()->GetExternalResource(); QV8TypeResource *resource = v8_resource_cast<QV8TypeResource>(info.This()); if (!resource) @@ -257,7 +256,6 @@ v8::Handle<v8::Value> QV8TypeWrapper::Setter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - v8::Object::ExternalResource *r = info.This()->GetExternalResource(); QV8TypeResource *resource = v8_resource_cast<QV8TypeResource>(info.This()); if (!resource) diff --git a/src/declarative/scenegraph/coreapi/qsgmaterial.cpp b/src/declarative/scenegraph/coreapi/qsgmaterial.cpp index 65ce9eec93..36b50e89b6 100644 --- a/src/declarative/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/declarative/scenegraph/coreapi/qsgmaterial.cpp @@ -220,7 +220,7 @@ void QSGMaterialShader::deactivate() \sa activate(), deactivate() */ -void QSGMaterialShader::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) +void QSGMaterialShader::updateState(const RenderState & /* state */, QSGMaterial * /* newMaterial */, QSGMaterial * /* oldMaterial */) { } diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp index fb21bd48fd..989632c6e7 100644 --- a/src/qmltest/quicktest.cpp +++ b/src/qmltest/quicktest.cpp @@ -76,7 +76,7 @@ class QTestRootObject : public QObject Q_PROPERTY(bool hasTestCase READ hasTestCase WRITE setHasTestCase NOTIFY hasTestCaseChanged) public: QTestRootObject(QObject *parent = 0) - : QObject(parent), hasQuit(false), m_hasTestCase(false), m_windowShown(false) {} + : QObject(parent), hasQuit(false), m_windowShown(false), m_hasTestCase(false) {} bool hasQuit:1; bool hasTestCase() const { return m_hasTestCase; } diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp index 7d8080fc08..2feef36898 100644 --- a/src/qmltest/quicktestresult.cpp +++ b/src/qmltest/quicktestresult.cpp @@ -314,7 +314,6 @@ void QuickTestResult::startLogging() { // The program name is used for logging headers and footers if it // is set. Otherwise the test case name is used. - Q_D(QuickTestResult); if (loggingStarted) return; QTestLog::startLogging(); |