summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-12-09 09:52:59 -0800
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-12-09 09:52:59 -0800
commit9b1ea2ae6d6998aaaa842dabf1182c279f7d19f5 (patch)
tree5f41c0bfa1c471fd86b691c5f004c1d9d4b666d5 /statistics.c
parentfe532a585cb0c1250cca5994a78394aadc3e14dd (diff)
downloadsubsurface-9b1ea2ae6d6998aaaa842dabf1182c279f7d19f5.tar.gz
Use common helper function for the "no cylinder info" case
Miika fixed the statistics code that didn't properly check for the "no cylinder info" case - this cleans it up and just uses the helper function in equipment.c. Rename the helper to be slightly better named while at it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/statistics.c b/statistics.c
index 5cb242e90..f8f9d0e24 100644
--- a/statistics.c
+++ b/statistics.c
@@ -169,10 +169,7 @@ void show_dive_stats(struct dive *dive)
start = cyl->start.mbar ? : cyl->sample_start.mbar;
end = cyl->end.mbar ? : cyl->sample_end.mbar;
- /* we assume that every valid cylinder has either a working pressure
- * or a size; but for good measure let's also accept cylinders with
- * a starting or ending pressure*/
- if (cyl->type.workingpressure.mbar || cyl->type.size.mliter || cyl->gasmix.o2.permille || start || 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 ? : 209;
if (offset > 0) {