From 0b2421ba758d06f39e05f963c144c42b1d204e54 Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Tue, 17 Dec 2024 08:59:07 -0800 Subject: [PATCH] AP_Math: Add float cast to float version of fabsF to get rid of compiler warnings about demoting doubles to floats --- libraries/AP_Math/ftype.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/AP_Math/ftype.h b/libraries/AP_Math/ftype.h index d2095df104..c43a6d21ed 100644 --- a/libraries/AP_Math/ftype.h +++ b/libraries/AP_Math/ftype.h @@ -28,7 +28,6 @@ typedef double ftype; #define ceilF(x) ceil(x) #define fminF(x,y) fmin(x,y) #define fmodF(x,y) fmod(x,y) -#define fabsF(x) fabs(x) #define toftype todouble #else typedef float ftype; @@ -43,11 +42,10 @@ typedef float ftype; #define fmaxF(x,y) fmaxf(x,y) #define powF(x,y) powf(x,y) #define logF(x) logf(x) -#define fabsF(x) fabsf(x) +#define fabsF(x) fabsf((float)(x)) #define ceilF(x) ceilf(x) #define fminF(x,y) fminf(x,y) #define fmodF(x,y) fmodf(x,y) -#define fabsF(x) fabsf(x) #define toftype tofloat #endif