diff options
author | jan Iversen <jani@libreoffice.org> | 2018-05-18 17:23:51 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-05-18 21:27:37 +0300 |
commit | 262e994bbcb3c278635f57a7022448e1b22298eb (patch) | |
tree | 6c43b4318cc83fbcfd5c758fe0ff518bf264f971 /core/units.h | |
parent | 10cabcdb6996d98073d16f7476c6057c3fb70dc7 (diff) | |
download | subsurface-262e994bbcb3c278635f57a7022448e1b22298eb.tar.gz |
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 <jani@apache.org>
Diffstat (limited to 'core/units.h')
-rw-r--r-- | core/units.h | 6 |
1 files 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) |