core: move get_dive_salinity() to struct dive

Feels natural in a C++ code base.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-30 18:31:43 +02:00 committed by bstoeger
parent 0aa4efb3d9
commit 718523e01d
3 changed files with 4 additions and 4 deletions

View file

@ -704,9 +704,9 @@ static void fixup_water_salinity(struct dive &dive)
dive.salinity = (sum + nr / 2) / nr;
}
int get_dive_salinity(const struct dive *dive)
int dive::get_salinity() const
{
return dive->user_salinity ? dive->user_salinity : dive->salinity;
return user_salinity ? user_salinity : salinity;
}
static void fixup_meandepth(struct dive &dive)