core: make round_to parameter of gas_mod() and gas_mnd() a depth_t

Simplifies practically all the callers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-12-14 10:35:56 +01:00 committed by Michael Keller
parent bd2f7e72f1
commit 6b57b3b745
6 changed files with 34 additions and 34 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).mm);
cyl.depth = dive->gas_mod(cyl.gasmix, decopo2, m_or_ft(3, 10));
if (track_gas)
cyl.start.mbar = cyl.end.mbar = cyl.type.workingpressure.mbar;
cyl.gas_used = 0_l;
@ -364,7 +364,7 @@ void fill_default_cylinder(const struct dive *dive, cylinder_t *cyl)
cyl->type.size.mliter = lrint(cuft_to_l(ti.cuft) * 1000 / bar_to_atm(psi_to_bar(ti.psi)));
}
// MOD of air
cyl->depth = dive->gas_mod(cyl->gasmix, pO2, 1);
cyl->depth = dive->gas_mod(cyl->gasmix, pO2, 1_mm);
return;
}
}