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:
Berthold Stoeger 2024-12-14 10:10:19 +01:00 committed by Michael Keller
parent 0e77dd9a68
commit bd2f7e72f1
11 changed files with 105 additions and 97 deletions

View file

@ -314,7 +314,7 @@ void reset_cylinders(struct dive *dive, bool track_gas)
for (cylinder_t &cyl: dive->cylinders) {
if (cyl.depth.mm == 0) /* if the gas doesn't give a mod, calculate based on prefs */
cyl.depth = dive->gas_mod(cyl.gasmix, decopo2, M_OR_FT(3,10));
cyl.depth = dive->gas_mod(cyl.gasmix, decopo2, m_or_ft(3, 10).mm);
if (track_gas)
cyl.start.mbar = cyl.end.mbar = cyl.type.workingpressure.mbar;
cyl.gas_used = 0_l;