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 /statistics.c | |
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 'statistics.c')
-rw-r--r-- | statistics.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/statistics.c b/statistics.c index 71150159c..5da48f225 100644 --- a/statistics.c +++ b/statistics.c @@ -337,7 +337,6 @@ char *get_gaslist(struct dive *dive) { int idx, offset = 0; static char buf[MAXBUF]; - int o2, he; buf[0] = '\0'; for (idx = 0; idx < MAX_CYLINDERS; idx++) { @@ -345,20 +344,11 @@ char *get_gaslist(struct dive *dive) if (!is_gas_used(dive, idx)) continue; cyl = &dive->cylinder[idx]; - o2 = get_o2(&cyl->gasmix); - he = get_he(&cyl->gasmix); if (offset > 0) { strncpy(buf + offset, "\n", MAXBUF - offset); offset = strlen(buf); } - if (is_air(o2, he)) - strncpy(buf + offset, translate("gettextFromC", "air"), MAXBUF - offset); - else if (he == 0) - snprintf(buf + offset, MAXBUF - offset, - translate("gettextFromC", "EAN%d"), (o2 + 5) / 10); - else - snprintf(buf + offset, MAXBUF - offset, - "%d/%d", (o2 + 5) / 10, (he + 5) / 10); + strncpy(buf + offset, gasname(&cyl->gasmix), MAXBUF - offset); offset = strlen(buf); } if (*buf == '\0') |