core: move *_surface_pressure() functions into struct dive

Seems 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-22 20:08:47 +02:00 committed by bstoeger
parent 4a165980e7
commit d81ca005ab
6 changed files with 14 additions and 15 deletions

View file

@ -228,13 +228,13 @@ const char *monthname(int mon)
int gettimezoneoffset()
{
time_t now = time(nullptr);
#ifdef WIN32
// Somewhat surprisingly, Windows doesn't have localtime_r (I thought this was POSIX?).
// Let's use the global timezone variable.
// Ultimately, use the portable C++20 API.
return static_cast<int>(-timezone);
#else
time_t now = time(nullptr);
struct tm local;
localtime_r(&now, &local);
return local.tm_gmtoff;