diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-16 17:11:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-23 05:16:38 -0700 |
commit | 5c4569247a31cf9f52238bd2b3f9c87b8f79933a (patch) | |
tree | 2e6216fafc0b42fb6eac368e58b01136e4f2bcc7 /core/dive.h | |
parent | f5b11daffd6f240268ce78d72c64be43670988ea (diff) | |
download | subsurface-5c4569247a31cf9f52238bd2b3f9c87b8f79933a.tar.gz |
Cleanup: unify get_gas_at_time() and get_gasmix()
There were two functions for getting gas-mixes at a certain timestamp:
- get_gasmix() for repeated queries.
- get_gas_at_time() for a single query.
Since the latter is a special case of the former, simply call
the former in the latter. Moreover, rename to get_gasmix_at_time()
for consistency.
Replace on get_gasmix() call, which was outside of a loop by the
corresponding get_gasmix_at_time() call.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/dive.h b/core/dive.h index 7e62262d9..a1cc3ab6d 100644 --- a/core/dive.h +++ b/core/dive.h @@ -718,12 +718,15 @@ extern void printdecotable(struct decostop *table); extern struct event *get_next_event(struct event *event, const char *name); -/* Get gasmix at increasing timestamps. +/* Get gasmixes at increasing timestamps. * In "evp", pass a pointer to a "struct event *" which is NULL-initialized on first invocation. * On subsequent calls, pass the same "evp" and the "gasmix" from previous calls. */ extern struct gasmix get_gasmix(struct dive *dive, struct divecomputer *dc, int time, struct event **evp, struct gasmix *gasmix); +/* Get gasmix at a given time */ +extern struct gasmix get_gasmix_at_time(struct dive *dive, struct divecomputer *dc, duration_t time); + /* these structs holds the information that * describes the cylinders / weight systems. * they are global variables initialized in equipment.c |