mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn M_OR_FT macro into a function
No point in this being a macro. Make it return a depth_t - it was unclear that this returns a depth in mm. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0e77dd9a68
commit
bd2f7e72f1
11 changed files with 105 additions and 97 deletions
|
@ -19,8 +19,6 @@
|
|||
#define HE_DENSITY 166
|
||||
#define ZERO_C_IN_MKELVIN 273150 // mKelvin
|
||||
|
||||
#define M_OR_FT(_m, _f) ((prefs.units.length == units::METERS) ? ((_m) * 1000) : (feet_to_mm(_f)))
|
||||
|
||||
/* Salinity is expressed in weight in grams per 10l */
|
||||
#define SEAWATER_SALINITY 10300
|
||||
#define EN13319_SALINITY 10200
|
||||
|
@ -193,6 +191,10 @@ static inline depth_t operator""_ft(unsigned long long ft)
|
|||
return depth_t { .mm = static_cast<int32_t>(round(ft * 304.8)) };
|
||||
}
|
||||
|
||||
// Return either the first argument in meters or the second argument in
|
||||
// feet, depending on use settings.
|
||||
depth_t m_or_ft(int m, int ft);
|
||||
|
||||
struct pressure_t : public unit_base<pressure_t>
|
||||
{
|
||||
int32_t mbar = 0; // pressure up to 2000 bar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue