Remove warnings with clang
authorYann Bodson <yann.bodson@nokia.com>
Sun, 5 Feb 2012 22:20:02 +0000 (08:20 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 7 Feb 2012 04:32:40 +0000 (05:32 +0100)
Change-Id: I924f0adc036b47e2342bf383d308c6a5269c2de6
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
12 files changed:
src/declarative/qml/qdeclarativebinding.cpp
src/declarative/qml/v8/qv8engine_p.h
src/quick/items/context2d/qquickcontext2dtile_p.h
src/quick/items/qquickanchors.cpp
src/quick/items/qquickcanvas.cpp
src/quick/items/qquickitemchangelistener_p.h
src/quick/items/qquickitemview_p_p.h
src/quick/items/qquickpathview.cpp
src/quick/scenegraph/coreapi/qsgmaterial.h
src/quick/scenegraph/coreapi/qsgnodeupdater.cpp
src/quick/scenegraph/coreapi/qsgnodeupdater_p.h
src/quick/scenegraph/qsgcontextplugin_p.h

index 4c29fce..e625c7a 100644 (file)
@@ -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);
 }
index ecfc33d..a1b8029 100644 (file)
@@ -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
index f7cb1b5..e05030c 100644 (file)
@@ -56,7 +56,7 @@ class QQuickContext2DTile
 {
 public:
     QQuickContext2DTile();
-    ~QQuickContext2DTile();
+    virtual ~QQuickContext2DTile();
 
     bool dirty() const {return m_dirty;}
     void markDirty(bool dirty) {m_dirty = dirty;}
index 77ab8db..2d852f7 100644 (file)
@@ -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::GeometryChangeType>(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::GeometryChangeType>(QQuickItemPrivate::YChange | QQuickItemPrivate::HeightChange);
index a92e839..d9476fe 100644 (file)
@@ -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
index c50bd84..9536d44 100644 (file)
@@ -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 *) {}
index 340349e..f191f06 100644 (file)
@@ -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;
index 675069c..aa8ddfb 100644 (file)
@@ -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);
index 95c32c5..65c8df2 100644 (file)
@@ -83,6 +83,7 @@ public:
     };
 
     QSGMaterialShader();
+    virtual ~QSGMaterialShader() {};
 
     virtual void activate();
     virtual void deactivate();
index b071bbb..31b82d9 100644 (file)
@@ -54,6 +54,10 @@ QSGNodeUpdater::QSGNodeUpdater()
     m_opacity_stack.add(1);
 }
 
+QSGNodeUpdater::~QSGNodeUpdater()
+{
+}
+
 void QSGNodeUpdater::updateStates(QSGNode *n)
 {
     m_current_clip = 0;
index c45412d..5c455b8 100644 (file)
@@ -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;
index e6bb2ea..081e64e 100644 (file)
@@ -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