diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-01 20:56:29 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-01 20:57:11 -0700 |
commit | 28093ae957548d5fc1e4d373ca0a345cc1be5069 (patch) | |
tree | f8899ae3e24033781bf707ceac959636be063917 /dive.h | |
parent | ee36bf8bf34013c35120b6c3cc4ae5edcf74b235 (diff) | |
download | subsurface-28093ae957548d5fc1e4d373ca0a345cc1be5069.tar.gz |
Remove is_air() and convert its users to gasmix
Also make gasname() and get_gas_string() global functions (which allows us
to delete code elsewhere).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -108,14 +108,11 @@ extern void sanitize_gasmix(struct gasmix *mix); extern int gasmix_distance(const struct gasmix *a, const struct gasmix *b); extern struct gasmix *get_gasmix_from_event(struct event *ev); -static inline bool is_air(int o2, int he) -{ - return (he == 0) && (o2 == 0 || ((o2 >= O2_IN_AIR - 1) && (o2 <= O2_IN_AIR + 1))); -} - static inline bool gasmix_is_air(const struct gasmix *gasmix) { - return is_air(gasmix->o2.permille, gasmix->he.permille); + int o2 = gasmix->o2.permille; + int he = gasmix->he.permille; + return (he == 0) && (o2 == 0 || ((o2 >= O2_IN_AIR - 1) && (o2 <= O2_IN_AIR + 1))); } /* in the planner we use a null gasmix to indicate that we keep using the gas as before @@ -140,6 +137,9 @@ static inline depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit) { return depth; } +void get_gas_string(const struct gasmix *gasmix, char *text, int len); +const char *gasname(const struct gasmix *gasmix); + struct sample { duration_t time; depth_t depth; |