Fix compiler warnings.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Thu, 27 Oct 2011 14:16:16 +0000 (16:16 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 27 Oct 2011 14:35:12 +0000 (16:35 +0200)
- Fix gcc 4.6.X warnings about assigned but unused variables
- Remove trailing ';' from inline functions (Clang)

Change-Id: I8670afd6b149748a740f22c65de137762e9f18e1
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
15 files changed:
src/corelib/concurrent/qtconcurrentiteratekernel.h
src/corelib/concurrent/qtconcurrentresultstore.h
src/corelib/global/qglobal.h
src/gui/kernel/qdnd.cpp
src/gui/kernel/qplatformdrag_qpa.h
src/gui/opengl/qopengltriangulatingstroker.cpp
src/gui/painting/qcosmeticstroker.cpp
src/gui/text/qtextodfwriter.cpp
src/opengl/gl2paintengineex/qtriangulatingstroker.cpp
src/plugins/bearer/connman/qofonoservice_linux.cpp
src/sql/drivers/odbc/qsql_odbc.cpp
src/testlib/qbenchmarkmeasurement_p.h
src/tools/uic/cpp/cppwriteinitialization.cpp
src/widgets/kernel/qguiplatformplugin_p.h
src/widgets/kernel/qsoftkeymanager_common_p.h

index 3aaf5dd..c6fcb97 100644 (file)
@@ -145,8 +145,8 @@ class ResultReporter<void>
 {
 public:
     inline ResultReporter(ThreadEngine<void> *) { }
-    inline void reserveSpace(int) { };
-    inline void reportResults(int) { };
+    inline void reserveSpace(int) { }
+    inline void reportResults(int) { }
     inline void * getPointer() { return 0; }
 };
 
index f1b517b..627aca2 100644 (file)
@@ -134,7 +134,7 @@ public:
     ResultIteratorBase resultAt(int index) const;
     bool contains(int index) const;
     int count() const;
-    virtual ~ResultStoreBase() { };
+    virtual ~ResultStoreBase() { }
 
 protected:
     int insertResultItem(int index, ResultItem &resultItem);
index 9780c2f..aa52fc1 100644 (file)
@@ -2284,7 +2284,7 @@ struct QForeachContainerBase {};
 template <typename T>
 class QForeachContainer : public QForeachContainerBase {
 public:
-    inline QForeachContainer(const T& t): c(t), brk(0), i(c.begin()), e(c.end()){};
+    inline QForeachContainer(const T& t): c(t), brk(0), i(c.begin()), e(c.end()){}
     const T c;
     mutable int brk;
     mutable typename T::const_iterator i, e;
index 6cf986f..4edcfa8 100644 (file)
@@ -169,9 +169,13 @@ QDragManager *QDragManager::self()
 
 QPixmap QDragManager::dragCursor(Qt::DropAction action) const
 {
-    QDragPrivate * d = dragPrivate();
-    if (d && d->customCursors.contains(action))
-        return d->customCursors[action];
+    typedef QMap<Qt::DropAction, QPixmap>::const_iterator Iterator;
+
+    if (const QDragPrivate *d = dragPrivate()) {
+        const Iterator it = d->customCursors.constFind(action);
+        if (it != d->customCursors.constEnd())
+            return it.value();
+    }
 
     Qt::CursorShape shape = Qt::ForbiddenCursor;
     switch (action) {
@@ -187,8 +191,7 @@ QPixmap QDragManager::dragCursor(Qt::DropAction action) const
     default:
         shape = Qt::ForbiddenCursor;
     }
-
-    return QGuiApplicationPrivate::instance()->getPixmapCursor(Qt::DragMoveCursor);
+    return QGuiApplicationPrivate::instance()->getPixmapCursor(shape);
 }
 
 Qt::DropAction QDragManager::defaultAction(Qt::DropActions possibleActions,
index 76d890b..0b65174 100644 (file)
@@ -60,7 +60,7 @@ public:
 
     virtual QMimeData *platformDropData() = 0;
 
-    virtual void startDrag() {};
+    virtual void startDrag() {}
     virtual void move(const QMouseEvent *me) = 0;
     virtual void drop(const QMouseEvent *me) = 0;
     virtual void cancel() = 0;
index 3dc3452..4d1a8f8 100644 (file)
@@ -513,21 +513,18 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, c
     m_dash_stroker.setMiterLimit(pen.miterLimit());
     m_dash_stroker.setClipRect(clip);
 
-    float curvynessAdd, curvynessMul, roundness = 0;
+    float curvynessAdd, curvynessMul;
 
-    // simplfy pens that are thin in device size (2px wide or less)
+    // simplify pens that are thin in device size (2px wide or less)
     if (width < 2.5 && (cosmetic || m_inv_scale == 1)) {
         curvynessAdd = 0.5;
         curvynessMul = CURVE_FLATNESS / m_inv_scale;
-        roundness = 1;
     } else if (cosmetic) {
         curvynessAdd= width / 2;
         curvynessMul= CURVE_FLATNESS;
-        roundness = qMax<int>(4, width * CURVE_FLATNESS);
     } else {
         curvynessAdd = width * m_inv_scale;
         curvynessMul = CURVE_FLATNESS / m_inv_scale;
-        roundness = qMax<int>(4, width * curvynessMul);
     }
 
     if (count < 2)
index 3528e6f..eb00ec8 100644 (file)
@@ -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;
 
index 1619c9c..8776b92 100644 (file)
@@ -596,6 +596,7 @@ void QTextOdfWriter::writeCharacterFormat(QXmlStreamWriter &writer, QTextCharFor
         case QTextCharFormat::AlignSubScript: value = QString::fromLatin1("sub"); break;
         case QTextCharFormat::AlignTop: value = QString::fromLatin1("100%"); break;
         case QTextCharFormat::AlignBottom : value = QString::fromLatin1("-100%"); break;
+        case QTextCharFormat::AlignBaseline: break;
         }
         writer.writeAttribute(styleNS, QString::fromLatin1("text-position"), value);
     }
index 79a9fe7..29e660f 100644 (file)
@@ -513,21 +513,18 @@ void QDashedStrokeProcessor::process(const QVectorPath &path, const QPen &pen, c
     m_dash_stroker.setMiterLimit(pen.miterLimit());
     m_dash_stroker.setClipRect(clip);
 
-    float curvynessAdd, curvynessMul, roundness = 0;
+    float curvynessAdd, curvynessMul;
 
     // simplfy pens that are thin in device size (2px wide or less)
     if (width < 2.5 && (cosmetic || m_inv_scale == 1)) {
         curvynessAdd = 0.5;
         curvynessMul = CURVE_FLATNESS / m_inv_scale;
-        roundness = 1;
     } else if (cosmetic) {
         curvynessAdd= width / 2;
         curvynessMul= CURVE_FLATNESS;
-        roundness = qMax<int>(4, width * CURVE_FLATNESS);
     } else {
         curvynessAdd = width * m_inv_scale;
         curvynessMul = CURVE_FLATNESS / m_inv_scale;
-        roundness = qMax<int>(4, width * curvynessMul);
     }
 
     if (count < 2)
index d862456..0980f79 100644 (file)
@@ -930,11 +930,8 @@ void QOfonoSmsInterface::sendMessage(const QString &to, const QString &message)
     QDBusReply<QString> reply =  this->call(QLatin1String("SendMessage"),
                                             QVariant::fromValue(to),
                                             QVariant::fromValue(message));
-    bool ok = true;
-    if(reply.error().type() == QDBusError::InvalidArgs) {
-        qWarning() << reply.error().message();
-        ok = false;
-    }
+    if (reply.error().type() == QDBusError::InvalidArgs)
+        qWarning("%s", qPrintable(reply.error().message()));
 }
 
 QT_END_NAMESPACE
index f1c7006..168ea22 100644 (file)
@@ -630,12 +630,6 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i )
     QString qColName = QString::fromUtf8((const char *)colName.constData());
 #endif
     // nullable can be SQL_NO_NULLS, SQL_NULLABLE or SQL_NULLABLE_UNKNOWN
-    int required = -1;
-    if (nullable == SQL_NO_NULLS) {
-        required = 1;
-    } else if (nullable == SQL_NULLABLE) {
-        required = 0;
-    }
     QVariant::Type type = qDecodeODBCType(colType, p, unsignedFlag == SQL_FALSE);
     QSqlField f(qColName, type);
     f.setSqlType(colType);
index e19a05b..53e44fd 100644 (file)
@@ -64,8 +64,8 @@ QT_BEGIN_NAMESPACE
 class QBenchmarkMeasurerBase
 {
 public:
-    virtual ~QBenchmarkMeasurerBase(){};
-    virtual void init() {};
+    virtual ~QBenchmarkMeasurerBase() {}
+    virtual void init() {}
     virtual void start() = 0;
     virtual qint64 checkpoint() = 0;
     virtual qint64 stop() = 0;
index 72da6db..a887719 100644 (file)
@@ -687,11 +687,6 @@ void WriteInitialization::acceptWidget(DomWidget *node)
 
     const QString pageDefaultString = QLatin1String("Page");
 
-    int id = -1;
-    if (const DomProperty *pid = attributes.value(QLatin1String("id"))) {
-        id = pid->elementNumber();
-    }
-
     if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QMainWindow"))) {
         if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QMenuBar"))) {
             m_output << m_indent << parentWidget << "->setMenuBar(" << varName <<");\n";
index 3fae6a5..cb1aebb 100644 (file)
@@ -86,7 +86,7 @@ class Q_WIDGETS_EXPORT QGuiPlatformPlugin : public QObject, public QGuiPlatformP
         explicit QGuiPlatformPlugin(QObject *parent = 0);
         ~QGuiPlatformPlugin();
 
-        virtual QStringList keys() const {  return QStringList() << QLatin1String("default");  };
+        virtual QStringList keys() const {  return QStringList(QStringLiteral("default"));  }
 
         virtual QString styleName();
         virtual QPalette palette();
index bf4c747..fc484dc 100644 (file)
@@ -53,6 +53,8 @@
 // We mean it.
 //
 
+#include <private/qobject_p.h>
+
 QT_BEGIN_HEADER
 
 #ifndef QT_NO_SOFTKEYMANAGER
@@ -64,7 +66,7 @@ class QSoftKeyManagerPrivate : public QObjectPrivate
     Q_DECLARE_PUBLIC(QSoftKeyManager)
 
 public:
-    virtual void updateSoftKeys_sys() {};
+    virtual void updateSoftKeys_sys() {}
 
 protected:
     static QSoftKeyManager *self;