From bbdcb8b83bd7d418f0b39933194fd01636b45fc4 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 10 Aug 2023 12:15:38 -0700 Subject: [PATCH] Scripting: Fix rounding warning --- src/core/scripting.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/scripting.c b/src/core/scripting.c index a90be776a..0bb361005 100644 --- a/src/core/scripting.c +++ b/src/core/scripting.c @@ -1110,7 +1110,7 @@ static int32_t _rotationReadTiltX(struct mRotationSource* rotation) { struct mScriptValue out; if (_callRotationCb(adapter, "readTiltX", &out)) { - return out.value.f32 * INT32_MAX; + return out.value.f32 * (double) INT32_MAX; } if (adapter->oldRotation && adapter->oldRotation->readTiltX) { @@ -1124,7 +1124,7 @@ static int32_t _rotationReadTiltY(struct mRotationSource* rotation) { struct mScriptValue out; if (_callRotationCb(adapter, "readTiltY", &out)) { - return out.value.f32 * INT32_MAX; + return out.value.f32 * (double) INT32_MAX; } if (adapter->oldRotation && adapter->oldRotation->readTiltY) { @@ -1138,7 +1138,7 @@ static int32_t _rotationReadGyroZ(struct mRotationSource* rotation) { struct mScriptValue out; if (_callRotationCb(adapter, "readGyroZ", &out)) { - return out.value.f32 * INT32_MAX; + return out.value.f32 * (double) INT32_MAX; } if (adapter->oldRotation && adapter->oldRotation->readGyroZ) {