core: pass depth_t to depth_to_* functions

This is a drop in the ocean. Make the usage of the unit-types a
bit more consistent throughout the code base.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-12-13 18:20:05 +01:00 committed by Michael Keller
parent 661ce3f9c7
commit da17f6a08c
13 changed files with 216 additions and 212 deletions

View file

@ -280,9 +280,9 @@ static void fill_missing_tank_pressures(const struct dive *dive, struct plot_inf
static inline int calc_pressure_time(const struct dive *dive, const struct plot_data &a, const struct plot_data &b)
{
int time = b.sec - a.sec;
int depth = (a.depth + b.depth) / 2;
depth_t depth { .mm = (a.depth + b.depth) / 2 };
if (depth <= SURFACE_THRESHOLD)
if (depth.mm <= SURFACE_THRESHOLD)
return 0;
return dive->depth_to_mbar(depth) * time;