From 0c0521a555f111a4b21b3b5746ab6053c62dfb33 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 15 Jul 2014 10:55:51 +0900 Subject: [PATCH] AC_Fence: append f to floating point constants --- libraries/AC_Fence/AC_Fence.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/AC_Fence/AC_Fence.cpp b/libraries/AC_Fence/AC_Fence.cpp index 014bfa3e1d..035c774988 100644 --- a/libraries/AC_Fence/AC_Fence.cpp +++ b/libraries/AC_Fence/AC_Fence.cpp @@ -70,7 +70,7 @@ AC_Fence::AC_Fence(const AP_InertialNav* inav) : AP_Param::setup_object_defaults(this, var_info); // check for silly fence values - if (_alt_max < 0) { + if (_alt_max < 0.0f) { _alt_max.set_and_save(AC_FENCE_ALT_MAX_DEFAULT); } if (_circle_radius < 0) { @@ -144,7 +144,7 @@ uint8_t AC_Fence::check_fence() _alt_max_breach_distance = curr_alt - _alt_max; // check for a new breach or a breach of the backup fence - if ((_breached_fences & AC_FENCE_TYPE_ALT_MAX) == 0 || (_alt_max_backup != 0 && curr_alt >= _alt_max_backup)) { + if ((_breached_fences & AC_FENCE_TYPE_ALT_MAX) == 0 || (_alt_max_backup != 0.0f && curr_alt >= _alt_max_backup)) { // record that we have breached the upper limit record_breach(AC_FENCE_TYPE_ALT_MAX); @@ -157,8 +157,8 @@ uint8_t AC_Fence::check_fence() // clear alt breach if present if ((_breached_fences & AC_FENCE_TYPE_ALT_MAX) != 0) { clear_breach(AC_FENCE_TYPE_ALT_MAX); - _alt_max_backup = 0; - _alt_max_breach_distance = 0; + _alt_max_backup = 0.0f; + _alt_max_breach_distance = 0.0f; } } } @@ -173,7 +173,7 @@ uint8_t AC_Fence::check_fence() _circle_breach_distance = _home_distance - _circle_radius; // check for a new breach or a breach of the backup fence - if ((_breached_fences & AC_FENCE_TYPE_CIRCLE) == 0 || (_circle_radius_backup != 0 && _home_distance >= _circle_radius_backup)) { + if ((_breached_fences & AC_FENCE_TYPE_CIRCLE) == 0 || (_circle_radius_backup != 0.0f && _home_distance >= _circle_radius_backup)) { // record that we have breached the circular distance limit record_breach(AC_FENCE_TYPE_CIRCLE); @@ -186,8 +186,8 @@ uint8_t AC_Fence::check_fence() // clear circle breach if present if ((_breached_fences & AC_FENCE_TYPE_CIRCLE) != 0) { clear_breach(AC_FENCE_TYPE_CIRCLE); - _circle_radius_backup = 0; - _circle_breach_distance = 0; + _circle_radius_backup = 0.0f; + _circle_breach_distance = 0.0f; } } }