summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-11-02 14:20:28 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-11-02 14:20:28 -0700
commit3c69c9b935ea43402bafd2918e2e71e561b4484d (patch)
tree8edb8aad639d0e1e9b8dc350684e472b6ced268b
parent55352a051cfa7ac519e397cd3d18851e5050517b (diff)
parentb9179aabd5429892ac5853b5f5fe993a007bd3ad (diff)
downloadsubsurface-3c69c9b935ea43402bafd2918e2e71e561b4484d.tar.gz
Merge branch 'add-info-stats-page' of git://github.com/dirkhh/subsurface
* 'add-info-stats-page' of git://github.com/dirkhh/subsurface: Fix typo that broke min SAC calculation Surface interval is calculated from the END of previous dive
-rw-r--r--statistics.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/statistics.c b/statistics.c
index 845bc2a03..351f2d150 100644
--- a/statistics.c
+++ b/statistics.c
@@ -83,7 +83,7 @@ static void process_all_dives(struct dive *dive, struct dive **prev_dive)
dp->duration.seconds * dp->sac) / sac_time ;
if (dp->sac > info_stat.max_sac.mliter)
info_stat.max_sac.mliter = dp->sac;
- if (info_stat.min_sac.mliter == 0 || dp->sac < info_stat.max_sac.mliter)
+ if (info_stat.min_sac.mliter == 0 || dp->sac < info_stat.min_sac.mliter)
info_stat.min_sac.mliter = dp->sac;
}
}
@@ -132,7 +132,8 @@ void show_dive_stats(struct dive *dive)
set_label(info_stat_w.date, buf);
set_label(info_stat_w.dive_time, "%d min", (dive->duration.seconds + 30) / 60);
if (prev_dive)
- set_label(info_stat_w.surf_intv, get_time_string(dive->when - prev_dive->when, 4));
+ set_label(info_stat_w.surf_intv,
+ get_time_string(dive->when - (prev_dive->when + prev_dive->duration.seconds), 4));
else
set_label(info_stat_w.surf_intv, "unknown");
value = get_depth_units(dive->maxdepth.mm, &decimals, &unit);