From 373c26cf007bedbe8d9d8d9bccd3bb536b9f3a64 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Tue, 12 Nov 2013 23:09:58 +0100 Subject: [PATCH] Remove the special handling of ndl < 3m This changes the special handling of ndl calculations when we deem that we are too shallow for doing them. Previously we just set ndl to -1 and printed a "-", now we return and print max_ndl, just as how most divecomputers work. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- profile.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/profile.c b/profile.c index 303da6998..d32363be9 100644 --- a/profile.c +++ b/profile.c @@ -1076,7 +1076,7 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d /* FIXME: This should be configurable */ const int time_stepsize = 60; const int max_ndl = 7200; - entry->ndl = -1; + entry->ndl = max_ndl; pi->has_ndl = TRUE; /* don't try to calculate a ndl for lower values than 3m @@ -1253,10 +1253,7 @@ static void plot_string(struct plot_data *entry, char *buf, int bufsize, snprintf(buf, bufsize, translate("gettextFromC","%s\nIn deco"), buf2); } else if (has_ndl) { memcpy(buf2, buf, bufsize); - if (entry->ndl == -1) - snprintf(buf, bufsize, translate("gettextFromC","%s\nNDL:-"), buf2); - else - snprintf(buf, bufsize, translate("gettextFromC","%s\nNDL:%umin"), buf2, DIV_UP(entry->ndl, 60)); + snprintf(buf, bufsize, translate("gettextFromC","%s\nNDL:%umin"), buf2, DIV_UP(entry->ndl, 60)); } if (entry->sac && prefs.show_sac) { memcpy(buf2, buf, bufsize);