[PATCH] Print nice names for nitrox mixes in the divelist
Anton Lundin
glance at acc.umu.se
Sat Aug 16 06:47:05 PDT 2014
On 16 August, 2014 - Joakim Bygdell wrote:
> Since we changed the name of the O2 column to gas lets print common names for nitrox mixes instead of just the %O2.
>
>diff --git a/divelist.c b/divelist.c
>index 75ad42f..10ce066 100644
>--- a/divelist.c
>+++ b/divelist.c
>@@ -1,3 +1,4 @@
>+
Stray newline.
> /* divelist.c */
> /* core logic for the dive list -
> * accessed through the following interfaces:
>@@ -453,9 +454,9 @@ char *get_dive_gas_string(struct dive *dive)
> snprintf(buffer, MAX_GAS_STRING, "%d/%d", o2, he);
> else if (o2)
> if (o2 == o2low)
>- snprintf(buffer, MAX_GAS_STRING, "%d", o2);
>+ snprintf(buffer, MAX_GAS_STRING, "EAN%d", o2);
> else
>- snprintf(buffer, MAX_GAS_STRING, "%d" UTF8_ELLIPSIS "%d", o2low, o2);
>+ snprintf(buffer, MAX_GAS_STRING, "EAn%d" UTF8_ELLIPSIS "EAN%d", o2low, o2);
EAn typo.
> else
> strcpy(buffer, translate("gettextFromC", "air"));
> }
Shouldn't there be possible to do something nicer with
const char *gasname(const struct gasmix *gasmix) ?
//Anton
--
Anton Lundin +46702-161604
More information about the subsurface
mailing list