diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-06 11:19:32 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-08-08 16:26:31 -0700 |
commit | 00944f7a02c98bd281778218bccc592896386f14 (patch) | |
tree | ff0ac130a72c9e1be48d28aafc9afa5a21b022ab /core/liquivision.c | |
parent | 6ce4aeb04ee4a01af43f18ef8b76224402cb5c3b (diff) | |
download | subsurface-00944f7a02c98bd281778218bccc592896386f14.tar.gz |
Core: pass dive, cylinder-id to fill_default_cylinder
The fill_default_cylinder() function calculated the MOD based
on the currently displayed dive. This does not seem to make sense:
- When importing dives, why would we care about the altitude and
salinity of the currently displayed dive, possibly from a different
trip.
- The planner is supposed to be thread-safe and should not touch
global variables.
Of course this means that the importing-functions have to fill
out altitude and salinity before creating the default cylinder,
but this is their problem. For a freshly created dive they will
get the default values, which still seems less random than the
values from the displayed dive.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/liquivision.c')
-rw-r--r-- | core/liquivision.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/liquivision.c b/core/liquivision.c index e5b3ea48b..1e430bcf1 100644 --- a/core/liquivision.c +++ b/core/liquivision.c @@ -149,7 +149,7 @@ static void parse_dives(int log_version, const unsigned char *buf, unsigned int /* Just the main cylinder until we can handle the buddy cylinder porperly */ for (i = 0; i < 1; i++) - fill_default_cylinder(&dive->cylinder[i]); + fill_default_cylinder(dive, i); // Model 0=Xen, 1,2=Xeo, 4=Lynx, other=Liquivision model = *(buf + ptr); |