mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: fix SAC calculation for air dives
Commit f5b11daffd changed gasmix
arguments and return values to be passed by value instead of
using pointers.
Notably, get_gasmix() is fed a default-value and returns a
new value. In the old code, NULL was passed in in a first
loop iteration and non-NULL was always returned in the first
iteration. Thus, an equality comparison of passed-in an
returned gasmix would always fail in the first loop iteration.
The new code passed in air as default. Now if air was also
returned, then the matching gases were not calculated in
calculate_sac(). To revert to the old behavior, pass in
an invalid gasmix.
Moreover, give names to the invalid and air gasmixes.
Reported-by: tormento <turment@gmail.com>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c75f53a7a8
commit
6e4a253896
6 changed files with 18 additions and 7 deletions
|
|
@ -76,7 +76,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
|||
struct membuffer icdbuf = { 0 };
|
||||
const char *deco, *segmentsymbol;
|
||||
int lastdepth = 0, lasttime = 0, lastsetpoint = -1, newdepth = 0, lastprintdepth = 0, lastprintsetpoint = -1;
|
||||
struct gasmix lastprintgasmix = {{ -1 }, { -1 }};
|
||||
struct gasmix lastprintgasmix = gasmix_invalid;
|
||||
struct divedatapoint *dp = diveplan->dp;
|
||||
bool plan_verbatim = prefs.verbatim_plan;
|
||||
bool plan_display_runtime = prefs.display_runtime;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue