mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use the new get_o2()/get_he() helper functions more widely
They do the "02=0 means air" thing autmatically, and make for less typing. So use them more widely in places that looked up the o2 and he permille values of a gasmix. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
99070c49e2
commit
1b05d28944
4 changed files with 12 additions and 13 deletions
|
|
@ -610,13 +610,13 @@ static void show_single_dive_stats(struct dive *dive)
|
|||
end = cyl->end.mbar ?cyl->sample_end : cyl->sample_end;
|
||||
if (!cylinder_none(cyl)) {
|
||||
/* 0% O2 strangely means air, so 21% - I don't like that at all */
|
||||
int o2 = cyl->gasmix.o2.permille ? : O2_IN_AIR;
|
||||
int o2 = get_o2(&cyl->gasmix);
|
||||
int he = get_he(&cyl->gasmix);
|
||||
if (offset > 0) {
|
||||
snprintf(buf+offset, 80-offset, ", ");
|
||||
offset += 2;
|
||||
}
|
||||
snprintf(buf+offset, 80-offset, "%d/%d", (o2 + 5) / 10,
|
||||
(cyl->gasmix.he.permille + 5) / 10);
|
||||
snprintf(buf+offset, 80-offset, "%d/%d", (o2 + 5) / 10, (he + 5) / 10);
|
||||
offset = strlen(buf);
|
||||
}
|
||||
/* and if we have size, start and end pressure, we can
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue