mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
fixup_dive(): move the add_* calls before a possible return
In dive.c:fixup_dive() it would be better to call functions like add_people() and add_location() before the possible return in the "if (end < 0)" branch. This prevents a partial auto-complete list in "Dive Info" combo boxes. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fa5afc697e
commit
f2adb0cea6
1 changed files with 4 additions and 4 deletions
8
dive.c
8
dive.c
|
@ -384,6 +384,10 @@ struct dive *fixup_dive(struct dive *dive)
|
|||
int lasttemp = 0, lastpressure = 0;
|
||||
int pressure_delta[MAX_CYLINDERS] = {INT_MAX, };
|
||||
|
||||
add_people(dive->buddy);
|
||||
add_people(dive->divemaster);
|
||||
add_location(dive->location);
|
||||
add_suit(dive->suit);
|
||||
sanitize_cylinder_info(dive);
|
||||
for (i = 0; i < dive->samples; i++) {
|
||||
struct sample *sample = dive->sample + i;
|
||||
|
@ -496,10 +500,6 @@ struct dive *fixup_dive(struct dive *dive)
|
|||
update_temperature(&dive->watertemp, mintemp);
|
||||
update_depth(&dive->maxdepth, maxdepth);
|
||||
|
||||
add_people(dive->buddy);
|
||||
add_people(dive->divemaster);
|
||||
add_location(dive->location);
|
||||
add_suit(dive->suit);
|
||||
for (i = 0; i < MAX_CYLINDERS; i++) {
|
||||
cylinder_t *cyl = dive->cylinder + i;
|
||||
add_cylinder_description(&cyl->type);
|
||||
|
|
Loading…
Reference in a new issue