summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-04-01 23:08:54 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-03 20:19:45 +0200
commit4c011aad53026775e25668e0fc1c2fedf2f181d8 (patch)
tree24dcccc5b8e6144c9abfdd9f57a2d6003d4640e5
parenta30762eacb5a813c36b5b87a04dca076e096f7a0 (diff)
downloadqtsensors-4c011aad53026775e25668e0fc1c2fedf2f181d8.tar.gz
Fix warnings in qtsensors
qtapsensor.h:110:34: error: extra ";" [-pedantic] qsensor.cpp:147:12: error: ‘qrange_id’ defined but not used [-Werror=unused-variable] dummycommon.cpp:151:9: error: variable ‘ok’ set but not used [-Werror=unused-but-set-variable] Change-Id: Ief3b4841bae7c255a40ad8f19f3f8733a613db48 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
-rw-r--r--src/plugins/sensors/dummy/dummycommon.cpp1
-rw-r--r--src/sensors/qsensor.cpp11
-rw-r--r--src/sensors/qtapsensor.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/sensors/dummy/dummycommon.cpp b/src/plugins/sensors/dummy/dummycommon.cpp
index 33e7111..675e54b 100644
--- a/src/plugins/sensors/dummy/dummycommon.cpp
+++ b/src/plugins/sensors/dummy/dummycommon.cpp
@@ -151,6 +151,7 @@ quint64 dummycommon::getTimestamp()
int ok;
ok = clock_gettime(CLOCK_MONOTONIC, &tv);
Q_ASSERT(ok == 0);
+ Q_UNUSED(ok);
quint64 result = (tv.tv_sec * 1000000ULL) + (tv.tv_nsec * 0.001); // scale to microseconds
return result;
diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp
index 01a4f7b..c058964 100644
--- a/src/sensors/qsensor.cpp
+++ b/src/sensors/qsensor.cpp
@@ -143,10 +143,13 @@ QT_BEGIN_NAMESPACE
\sa QList, qoutputrange, QSensor::outputRanges
*/
-// A bit of a hack to call qRegisterMetaType when the library is loaded.
-static int qrange_id = qRegisterMetaType<qrange>("qrange");
-static int qrangelist_id = qRegisterMetaType<qrangelist>("qrangelist");
-static int qoutputrangelist_id = qRegisterMetaType<qoutputrangelist>("qoutputrangelist");
+static void registerTypes()
+{
+ qRegisterMetaType<qrange>("qrange");
+ qRegisterMetaType<qrangelist>("qrangelist");
+ qRegisterMetaType<qoutputrangelist>("qoutputrangelist");
+}
+Q_CONSTRUCTOR_FUNCTION(registerTypes)
// =====================================================================
diff --git a/src/sensors/qtapsensor.h b/src/sensors/qtapsensor.h
index 74ca40c..b870411 100644
--- a/src/sensors/qtapsensor.h
+++ b/src/sensors/qtapsensor.h
@@ -107,7 +107,7 @@ Q_SIGNALS:
void returnDoubleTapEventsChanged(bool returnDoubleTapEvents);
private:
- Q_DECLARE_PRIVATE(QTapSensor);
+ Q_DECLARE_PRIVATE(QTapSensor)
Q_DISABLE_COPY(QTapSensor)
};