mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_surface_pressure() to struct dive
Feel natural in a C++ code base. Remove the second parameter, because all callers where passing `true` anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6e29c00f35
commit
c812dd140b
5 changed files with 9 additions and 12 deletions
|
@ -2382,12 +2382,10 @@ bool dive::cache_is_valid() const
|
|||
return git_id != null_id;
|
||||
}
|
||||
|
||||
int get_surface_pressure_in_mbar(const struct dive *dive, bool non_null)
|
||||
pressure_t dive::get_surface_pressure() const
|
||||
{
|
||||
int mbar = dive->surface_pressure.mbar;
|
||||
if (!mbar && non_null)
|
||||
mbar = SURFACE_PRESSURE;
|
||||
return mbar;
|
||||
return surface_pressure.mbar > 0 ? surface_pressure
|
||||
: pressure_t { SURFACE_PRESSURE };
|
||||
}
|
||||
|
||||
/* This returns the conversion factor that you need to multiply
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue