From 67bc52239aba6daa7f9b7659cc05074635fde7e2 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sat, 28 Mar 2015 17:20:44 +0000 Subject: Fix QNX 6.6 build, use the q* version of math functions genericrotationsensor.cpp:85:37: error: 'sqrt' was not declared in this scope Change-Id: I871b88130debdfd0a64421e4da8a451b586e7ba6 Reviewed-by: Rafael Roquetto --- src/plugins/sensors/generic/genericrotationsensor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/sensors/generic/genericrotationsensor.cpp') diff --git a/src/plugins/sensors/generic/genericrotationsensor.cpp b/src/plugins/sensors/generic/genericrotationsensor.cpp index af2800c8..af2c3cfb 100644 --- a/src/plugins/sensors/generic/genericrotationsensor.cpp +++ b/src/plugins/sensors/generic/genericrotationsensor.cpp @@ -82,8 +82,8 @@ bool genericrotationsensor::filter(QSensorReading *reading) // Note that the formula used come from this document: // http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf - pitch = qAtan(y / sqrt(x*x + z*z)) * RADIANS_TO_DEGREES; - roll = qAtan(x / sqrt(y*y + z*z)) * RADIANS_TO_DEGREES; + pitch = qAtan(y / qSqrt(x*x + z*z)) * RADIANS_TO_DEGREES; + roll = qAtan(x / qSqrt(y*y + z*z)) * RADIANS_TO_DEGREES; // Roll is a left-handed rotation but we need right-handed rotation roll = -roll; @@ -92,7 +92,7 @@ bool genericrotationsensor::filter(QSensorReading *reading) // Note that theta is defined as the angle of the Z axis relative // to gravity (see referenced document). It's negative when the // face of the device points downward. - qreal theta = qAtan(sqrt(x*x + y*y) / z) * RADIANS_TO_DEGREES; + qreal theta = qAtan(qSqrt(x*x + y*y) / z) * RADIANS_TO_DEGREES; if (theta < 0) { if (roll > 0) roll = 180 - roll; -- cgit v1.2.3