From 262e994bbcb3c278635f57a7022448e1b22298eb Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 18 May 2018 17:23:51 +0200 Subject: core: removed clang warnings from units.h lbs_to_grams and to_feet returns int but uses a function that returns long, causing clang to warn about conversion loss due to implicit conversion. Adding a cast, shows that it is correct. Signed-off-by: Jan Iversen --- core/units.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/units.h b/core/units.h index 2d6b6f73c..6e9fe50d9 100644 --- a/core/units.h +++ b/core/units.h @@ -146,7 +146,7 @@ static inline double grams_to_lbs(int grams) static inline int lbs_to_grams(double lbs) { - return lrint(lbs * 453.6); + return (int)lrint(lbs * 453.6); } static inline double ml_to_cuft(int ml) @@ -176,7 +176,7 @@ static inline unsigned long feet_to_mm(double feet) static inline int to_feet(depth_t depth) { - return lrint(mm_to_feet(depth.mm)); + return (int)lrint(mm_to_feet(depth.mm)); } static inline double mkelvin_to_C(int mkelvin) @@ -211,7 +211,7 @@ static inline long psi_to_mbar(double psi) static inline int to_PSI(pressure_t pressure) { - return lrint(pressure.mbar * 0.0145037738); + return (int)lrint(pressure.mbar * 0.0145037738); } static inline double bar_to_atm(double bar) -- cgit v1.2.3-70-g09d2