From 3249439b203123ca277b931a34814f383715b0e8 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 20 Nov 2012 14:57:16 +0100 Subject: [PATCH] Remove warnings from qtbase. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit geometryengine.cpp: In member function 'void GeometryEngine::drawCubeGeometry(QGLShaderProgram*)': geometryengine.cpp:159:93: warning: cast to pointer from integer of different sie [-Wint-to-pointer-cast] geometryengine.cpp:167:95: warning: cast to pointer f rom integer ofdifferent size [-Wint-to-pointer-cast] benchmarking.cpp: In member function 'void TestBenchmark::multiple()': benchmarking.cpp:85:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] benchmarking.cpp: In member function 'void TestBenchmark::series()': benchmarking.cpp:120:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] qstandarditemmodel.cpp:2717:45: warning: unused variable 'd' [-Wunused-variable] qxcbconnection.cpp: In member function 'xcb_timestamp_t QXcbConnection::getTimestamp()': qxcbconnection.cpp:930:40: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qguiapplication.cpp: In constructor 'BlockableWindow::BlockableWindow()': tst_qguiapplication.cpp:340:9: warning:'BlockableWindow::enters' will be initialized after [-Wreorder] tst_qguia pplication.cpp:339:9: warning 'int BlockableWindow::leaves' [-Wreorder] tst_qguiapplication.cpp:342:12: waring: when initialized here [-Wreorder] tst_qsqltablemodel.cpp:570:10: warning: unused parameter 'value' [-Wunused-parameter] tst_qabstractitemview.cpp:1546:8: warning: unused parameter 'index' [-Wunused-parameter] Change-Id: I49c88547182e4669cfde2c2536403fc5573ca2da Reviewed-by: Jędrzej Nowacki Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- examples/opengl/cube/geometryengine.cpp | 2 +- examples/qtestlib/tutorial5/benchmarking.cpp | 2 ++ src/gui/itemmodels/qstandarditemmodel.cpp | 1 - src/plugins/platforms/xcb/qxcbconnection.cpp | 2 +- tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp | 2 +- tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp | 1 + .../itemviews/qabstractitemview/tst_qabstractitemview.cpp | 1 + 7 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/opengl/cube/geometryengine.cpp b/examples/opengl/cube/geometryengine.cpp index e3d14d95de8..d8dfeab8222 100644 --- a/examples/opengl/cube/geometryengine.cpp +++ b/examples/opengl/cube/geometryengine.cpp @@ -151,7 +151,7 @@ void GeometryEngine::drawCubeGeometry(QGLShaderProgram *program) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIds[1]); // Offset for position - int offset = 0; + quintptr offset = 0; // Tell OpenGL programmable pipeline how to locate vertex position data int vertexLocation = program->attributeLocation("a_position"); diff --git a/examples/qtestlib/tutorial5/benchmarking.cpp b/examples/qtestlib/tutorial5/benchmarking.cpp index c731677c1ba..3a245f22cb1 100644 --- a/examples/qtestlib/tutorial5/benchmarking.cpp +++ b/examples/qtestlib/tutorial5/benchmarking.cpp @@ -92,6 +92,7 @@ void TestBenchmark::multiple() result = (str1 == str2); } } + Q_UNUSED(result); } //! [2] @@ -127,6 +128,7 @@ void TestBenchmark::series() result = (str1 == str2); } } + Q_UNUSED(result); } //! [5] diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 13d7a5c7a7e..079be121d5f 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -2714,7 +2714,6 @@ bool QStandardItemModel::hasChildren(const QModelIndex &parent) const */ QModelIndex QStandardItemModel::sibling(int row, int column, const QModelIndex &idx) const { - Q_D(const QStandardItemModel); return createIndex(row, column, idx.internalPointer()); } diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 405a16d488b..b5756bd06c0 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -927,7 +927,7 @@ xcb_timestamp_t QXcbConnection::getTimestamp() // to add the new set of events to its event queue while (true) { connection()->sync(); - if (event = checkEvent(checker)) + if ((event = checkEvent(checker))) break; } diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index 3417e18b7f4..4c64d0f58aa 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -340,7 +340,7 @@ public: int enters; inline BlockableWindow() - : QWindow(), blocked(false), enters(0), leaves(0) {} + : QWindow(), blocked(false), leaves(0), enters(0) {} bool event(QEvent *e) { diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp index 0e9420fcbeb..b6a0a7b1faa 100644 --- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp @@ -569,6 +569,7 @@ public: SetRecordReimplModel(QObject *parent, QSqlDatabase db):QSqlTableModel(parent, db) {} bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) { + Q_UNUSED(value); return QSqlTableModel::setData(index, QString("Qt"), role); } }; diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 8ccd13ff3e3..b0684136326 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -1544,6 +1544,7 @@ public: {} void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE { + Q_UNUSED(index); static bool w = true; editor->setEnabled(w); w = !w;