From 0ca9d3f0f720e1933379ef40bc5c29253e21cba0 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 6 Feb 2012 08:20:02 +1000 Subject: Remove warnings with clang Change-Id: I924f0adc036b47e2342bf383d308c6a5269c2de6 Reviewed-by: Michael Brasser --- src/declarative/qml/qdeclarativebinding.cpp | 2 -- src/declarative/qml/v8/qv8engine_p.h | 2 +- src/quick/items/context2d/qquickcontext2dtile_p.h | 2 +- src/quick/items/qquickanchors.cpp | 8 ++++---- src/quick/items/qquickcanvas.cpp | 4 ++-- src/quick/items/qquickitemchangelistener_p.h | 2 ++ src/quick/items/qquickitemview_p_p.h | 2 +- src/quick/items/qquickpathview.cpp | 8 ++++---- src/quick/scenegraph/coreapi/qsgmaterial.h | 1 + src/quick/scenegraph/coreapi/qsgnodeupdater.cpp | 4 ++++ src/quick/scenegraph/coreapi/qsgnodeupdater_p.h | 1 + src/quick/scenegraph/qsgcontextplugin_p.h | 2 +- 12 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 4c29fcef83..e625c7a0f5 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -270,8 +270,6 @@ QDeclarativeBinding::QDeclarativeBinding(const QString &str, bool isRewritten, Q QObject *parent) : QDeclarativeExpression(ctxt, obj, str, isRewritten, url, lineNumber, columnNumber, *new QDeclarativeBindingPrivate) { - Q_D(QDeclarativeBinding); - setParent(parent); setNotifyOnValueChanged(true); } diff --git a/src/declarative/qml/v8/qv8engine_p.h b/src/declarative/qml/v8/qv8engine_p.h index ecfc33d85a..a1b8029f7e 100644 --- a/src/declarative/qml/v8/qv8engine_p.h +++ b/src/declarative/qml/v8/qv8engine_p.h @@ -251,7 +251,7 @@ public: static QJSEngine* get(QV8Engine* d) { Q_ASSERT(d); return d->q; } QV8Engine(QJSEngine* qq,QJSEngine::ContextOwnership ownership = QJSEngine::CreateNewContext); - ~QV8Engine(); + virtual ~QV8Engine(); // ### TODO get rid of it, do we really need CppOwnership? // This enum should be in sync with QDeclarativeEngine::ObjectOwnership diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h index f7cb1b54b2..e05030cb88 100644 --- a/src/quick/items/context2d/qquickcontext2dtile_p.h +++ b/src/quick/items/context2d/qquickcontext2dtile_p.h @@ -56,7 +56,7 @@ class QQuickContext2DTile { public: QQuickContext2DTile(); - ~QQuickContext2DTile(); + virtual ~QQuickContext2DTile(); bool dirty() const {return m_dirty;} void markDirty(bool dirty) {m_dirty = dirty;} diff --git a/src/quick/items/qquickanchors.cpp b/src/quick/items/qquickanchors.cpp index 77ab8dba9d..2d852f708d 100644 --- a/src/quick/items/qquickanchors.cpp +++ b/src/quick/items/qquickanchors.cpp @@ -258,7 +258,7 @@ int QQuickAnchorsPrivate::calculateDependency(QQuickItem *controlItem) return dependency; if (fill == controlItem) { - if ((controlItem == item->parentItem())) + if (controlItem == item->parentItem()) dependency |= QQuickItemPrivate::SizeChange; else //sibling dependency |= QQuickItemPrivate::GeometryChange; @@ -266,7 +266,7 @@ int QQuickAnchorsPrivate::calculateDependency(QQuickItem *controlItem) } if (centerIn == controlItem) { - if ((controlItem == item->parentItem())) + if (controlItem == item->parentItem()) dependency |= QQuickItemPrivate::SizeChange; else //sibling dependency |= QQuickItemPrivate::GeometryChange; @@ -276,7 +276,7 @@ int QQuickAnchorsPrivate::calculateDependency(QQuickItem *controlItem) if ((usedAnchors & QQuickAnchors::LeftAnchor && left.item == controlItem) || (usedAnchors & QQuickAnchors::RightAnchor && right.item == controlItem) || (usedAnchors & QQuickAnchors::HCenterAnchor && hCenter.item == controlItem)) { - if ((controlItem == item->parentItem())) + if (controlItem == item->parentItem()) dependency |= QQuickItemPrivate::WidthChange; else //sibling dependency |= QFlags(QQuickItemPrivate::XChange | QQuickItemPrivate::WidthChange); @@ -286,7 +286,7 @@ int QQuickAnchorsPrivate::calculateDependency(QQuickItem *controlItem) (usedAnchors & QQuickAnchors::BottomAnchor && bottom.item == controlItem) || (usedAnchors & QQuickAnchors::VCenterAnchor && vCenter.item == controlItem) || (usedAnchors & QQuickAnchors::BaselineAnchor && baseline.item == controlItem)) { - if ((controlItem == item->parentItem())) + if (controlItem == item->parentItem()) dependency |= QQuickItemPrivate::HeightChange; else //sibling dependency |= QFlags(QQuickItemPrivate::YChange | QQuickItemPrivate::HeightChange); diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp index a92e8398f2..d9476febf5 100644 --- a/src/quick/items/qquickcanvas.cpp +++ b/src/quick/items/qquickcanvas.cpp @@ -834,7 +834,7 @@ bool QQuickCanvasPrivate::deliverMouseEvent(QMouseEvent *event) if (!mouseGrabberItem && event->type() == QEvent::MouseButtonPress && - (event->button() & event->buttons()) == event->buttons()) { + (event->buttons() & event->button()) == event->buttons()) { if (deliverInitialMousePressEvent(rootItem, event)) event->accept(); else @@ -893,7 +893,7 @@ void QQuickCanvas::mouseDoubleClickEvent(QMouseEvent *event) qWarning() << "QQuickCanvas::mouseDoubleClickEvent()" << event->pos() << event->button() << event->buttons(); #endif - if (!d->mouseGrabberItem && (event->button() & event->buttons()) == event->buttons()) { + if (!d->mouseGrabberItem && (event->buttons() & event->button()) == event->buttons()) { if (d->deliverInitialMousePressEvent(d->rootItem, event)) event->accept(); else diff --git a/src/quick/items/qquickitemchangelistener_p.h b/src/quick/items/qquickitemchangelistener_p.h index c50bd846fc..9536d4462e 100644 --- a/src/quick/items/qquickitemchangelistener_p.h +++ b/src/quick/items/qquickitemchangelistener_p.h @@ -64,6 +64,8 @@ class QQuickAnchorsPrivate; class QQuickItemChangeListener { public: + virtual ~QQuickItemChangeListener() {}; + virtual void itemGeometryChanged(QQuickItem *, const QRectF & /* new */, const QRectF & /* old */ ) {} virtual void itemSiblingOrderChanged(QQuickItem *) {} virtual void itemVisibilityChanged(QQuickItem *) {} diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 340349e9f7..f191f0683c 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -56,7 +56,7 @@ class FxViewItem { public: FxViewItem(QQuickItem *, bool own); - ~FxViewItem(); + virtual ~FxViewItem(); // these are positions and sizes along the current direction of scrolling/flicking virtual qreal position() const = 0; diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index 675069cad8..aa8ddfbec0 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1503,14 +1503,14 @@ void QQuickPathView::refill() if (QQuickPathViewAttached *att = d->attached(d->currentItem)) att->setOnPath(false); } else if (!waiting && d->currentIndex >= 0 && d->currentIndex < d->modelCount) { - if (d->currentItem = d->getItem(d->currentIndex, d->currentIndex, false)) { + if ((d->currentItem = d->getItem(d->currentIndex, d->currentIndex, false))) { d->updateItem(d->currentItem, d->currentIndex < d->firstIndex ? 0.0 : 1.0); if (QQuickPathViewAttached *att = d->attached(d->currentItem)) att->setIsCurrentItem(true); } } } else if (!waiting && !d->currentItem) { - if (d->currentItem = d->getItem(d->currentIndex, d->currentIndex, true)) { + if ((d->currentItem = d->getItem(d->currentIndex, d->currentIndex, true))) { d->currentItem->setFocus(true); if (QQuickPathViewAttached *att = d->attached(d->currentItem)) att->setIsCurrentItem(true); @@ -1674,13 +1674,13 @@ void QQuickPathViewPrivate::createCurrentItem() return; int itemIndex = (currentIndex - firstIndex + modelCount) % modelCount; if (itemIndex < items.count()) { - if (currentItem = getItem(currentIndex, currentIndex, true)) { + if ((currentItem = getItem(currentIndex, currentIndex, true))) { currentItem->setFocus(true); if (QQuickPathViewAttached *att = attached(currentItem)) att->setIsCurrentItem(true); } } else if (currentIndex >= 0 && currentIndex < modelCount) { - if (currentItem = getItem(currentIndex, currentIndex, false)) { + if ((currentItem = getItem(currentIndex, currentIndex, false))) { updateItem(currentItem, currentIndex < firstIndex ? 0.0 : 1.0); if (QQuickPathViewAttached *att = attached(currentItem)) att->setIsCurrentItem(true); diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h index 95c32c59f2..65c8df219f 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.h +++ b/src/quick/scenegraph/coreapi/qsgmaterial.h @@ -83,6 +83,7 @@ public: }; QSGMaterialShader(); + virtual ~QSGMaterialShader() {}; virtual void activate(); virtual void deactivate(); diff --git a/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp b/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp index b071bbb621..31b82d9d88 100644 --- a/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp +++ b/src/quick/scenegraph/coreapi/qsgnodeupdater.cpp @@ -54,6 +54,10 @@ QSGNodeUpdater::QSGNodeUpdater() m_opacity_stack.add(1); } +QSGNodeUpdater::~QSGNodeUpdater() +{ +} + void QSGNodeUpdater::updateStates(QSGNode *n) { m_current_clip = 0; diff --git a/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h b/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h index c45412d201..5c455b8151 100644 --- a/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h +++ b/src/quick/scenegraph/coreapi/qsgnodeupdater_p.h @@ -51,6 +51,7 @@ class Q_QUICK_EXPORT QSGNodeUpdater { public: QSGNodeUpdater(); + virtual ~QSGNodeUpdater(); virtual void updateStates(QSGNode *n); virtual bool isNodeBlocked(QSGNode *n, QSGNode *root) const; diff --git a/src/quick/scenegraph/qsgcontextplugin_p.h b/src/quick/scenegraph/qsgcontextplugin_p.h index e6bb2ea969..081e64ecdd 100644 --- a/src/quick/scenegraph/qsgcontextplugin_p.h +++ b/src/quick/scenegraph/qsgcontextplugin_p.h @@ -76,7 +76,7 @@ public: virtual QStringList keys() const = 0; virtual QSGContext *create(const QString &key) const = 0; - virtual QDeclarativeTextureFactory *createTextureFactoryFromImage(const QImage &image) { return 0; } + virtual QDeclarativeTextureFactory *createTextureFactoryFromImage(const QImage &) { return 0; } }; QT_END_NAMESPACE -- cgit v1.2.3