From b78255cc25a07a06a37698446cc641300bec35fc Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Mon, 11 Jul 2016 12:21:55 -0700 Subject: [PATCH] AP_Common: avoid using AP_Math is_zero() because it is classless - because it is classless it can not be called like AP_Math::is_zero() and will then conflict with local definition of is_zero() --- libraries/AP_Common/Location.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Common/Location.cpp b/libraries/AP_Common/Location.cpp index ad4e95c0cb..6ae3f758a3 100644 --- a/libraries/AP_Common/Location.cpp +++ b/libraries/AP_Common/Location.cpp @@ -234,7 +234,8 @@ float Location_Class::get_distance(const struct Location &loc2) const // extrapolate latitude/longitude given distances (in meters) north and east void Location_Class::offset(float ofs_north, float ofs_east) { - if (!is_zero(ofs_north) || !is_zero(ofs_east)) { + // use is_equal() because is_zero() is a local class conflict and is_zero() in AP_Math does not belong to a class + if (!is_equal(ofs_north, 0.0f) || !is_equal(ofs_east, 0.0f)) { int32_t dlat = ofs_north * LOCATION_SCALING_FACTOR_INV; int32_t dlng = (ofs_east * LOCATION_SCALING_FACTOR_INV) / longitude_scale(*this); lat += dlat;