diff options
author | BogDan Vatra <bogdan@kdab.com> | 2016-05-06 11:16:16 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2016-05-06 08:22:19 +0000 |
commit | 742cb1e3566f259781e6871686332f256bbc575b (patch) | |
tree | 49c8ac7c065b55dc55f086378e96f2a5fa145536 | |
parent | e29435d0d6ea48b5ba4c6a90e6807b5a877ad145 (diff) |
Fix compile
use qAbs instead of fabs
Change-Id: Ic0426fd105c45dd09aad31bea74012fa4f5d6699
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | src/plugins/gamepads/evdev/qevdevgamepadbackend.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/gamepads/evdev/qevdevgamepadbackend.cpp b/src/plugins/gamepads/evdev/qevdevgamepadbackend.cpp index 4ba299c..825a2ea 100644 --- a/src/plugins/gamepads/evdev/qevdevgamepadbackend.cpp +++ b/src/plugins/gamepads/evdev/qevdevgamepadbackend.cpp @@ -76,7 +76,7 @@ void QEvdevGamepadDevice::EvdevAxisInfo::setAbsInfo(int fd, int abs) minValue = absInfo.minimum; maxValue = absInfo.maximum; if (maxValue - minValue) - flat = fabs(absInfo.flat / double(maxValue - minValue)); + flat = qAbs(absInfo.flat / double(maxValue - minValue)); } } @@ -443,7 +443,7 @@ void QEvdevGamepadDevice::processInputEvent(input_event *e) } else if (e->type == EV_ABS) { if (m_configureAxis != QGamepadManager::AxisInvalid) { EvdevAxisInfo inf(m_fd, e->code, -32768, 32767, m_configureAxis); - if (fabs(inf.normalized(e->value)) == 1) { + if (qAbs(inf.normalized(e->value)) == 1) { m_axisMap.insert(e->code, EvdevAxisInfo(m_fd, e->code, -32768, 32767, m_configureAxis)); QGamepadManager::GamepadAxis axis = m_configureAxis; @@ -503,7 +503,7 @@ void QEvdevGamepadDevice::processInputEvent(input_event *e) if (info.gamepadMaxButton == info.gamepadMinButton && info.gamepadMaxButton != QGamepadManager::ButtonInvalid) { if (val) - emit m_backend->gamepadButtonPressed(m_productId, info.gamepadMaxButton, fabs(val)); + emit m_backend->gamepadButtonPressed(m_productId, info.gamepadMaxButton, qAbs(val)); else emit m_backend->gamepadButtonReleased(m_productId, info.gamepadMaxButton); } else { |