summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-03-22 09:39:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-14 11:31:23 +0200
commitc0387812954819286543a8bba70dd0f1c4796c12 (patch)
treebb6b16e1f9eabd3e6fba9a9e964afea629ac5ea9 /src
parenta489612b023b9bd4fca0a111ae88d819f99a04dd (diff)
iOS: remove unneeded void pointer casting in private headers
The headers in use for the sensor backend are private, and should never be directly included in any .cpp files. As such, we don't need to be careful using obj-c features in the header files. Change-Id: If16a84c88a7e7afc45afe00e668e4582337e4907 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/sensors/ios/iosgyroscope.h4
-rw-r--r--src/plugins/sensors/ios/iosgyroscope.mm5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/sensors/ios/iosgyroscope.h b/src/plugins/sensors/ios/iosgyroscope.h
index 358a7c83..ed46241c 100644
--- a/src/plugins/sensors/ios/iosgyroscope.h
+++ b/src/plugins/sensors/ios/iosgyroscope.h
@@ -42,6 +42,8 @@
#ifndef IOSGYROSCOPE_H
#define IOSGYROSCOPE_H
+#include <Foundation/Foundation.h>
+
#include <qsensorbackend.h>
#include <qgyroscope.h>
@@ -59,7 +61,7 @@ public:
void stop();
private:
- void *m_updateQueue;
+ NSOperationQueue *m_updateQueue;
QGyroscopeReading m_reading;
};
QT_END_NAMESPACE
diff --git a/src/plugins/sensors/ios/iosgyroscope.mm b/src/plugins/sensors/ios/iosgyroscope.mm
index 03289913..700755de 100644
--- a/src/plugins/sensors/ios/iosgyroscope.mm
+++ b/src/plugins/sensors/ios/iosgyroscope.mm
@@ -60,7 +60,7 @@ IOSGyroscope::IOSGyroscope(QSensor *sensor)
IOSGyroscope::~IOSGyroscope()
{
- [static_cast<NSOperationQueue *>(m_updateQueue) release];
+ [m_updateQueue release];
}
void IOSGyroscope::start()
@@ -71,8 +71,7 @@ void IOSGyroscope::start()
motionManager.gyroUpdateInterval = (hz == 0) ? 0 : 1. / hz;
QPointer<QObject> self = this;
- NSOperationQueue *queue = static_cast<NSOperationQueue *>(m_updateQueue);
- [motionManager startGyroUpdatesToQueue:queue withHandler:^(CMGyroData *data, NSError *error) {
+ [motionManager startGyroUpdatesToQueue:m_updateQueue withHandler:^(CMGyroData *data, NSError *error) {
// NSOperationQueue is multi-threaded, so we process the data by queuing a callback to
// the main application queue. By the time the callback executes, IOSAccelerometer might
// have been deleted, so we need an extra QPointer check for that: