[PATCH 1/3] gas pressures: do some initial cleanup

Linus Torvalds torvalds at linux-foundation.org
Wed Feb 24 13:27:01 PST 2016


From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Wed, 24 Feb 2016 11:08:50 -0800
Subject: [PATCH 1/3] gas pressures: do some initial cleanup

This marks "surface_volume_multiplier()" static in preparation for
changing it to use an actual honest-to-goodness compressibility
estimation.  Without that, it wasn't obvious that the function wasn't
used in other random places.

Also, remove the "wet_volume()" function.  It was unused, but more
importantly, it was wrong.  Yes, it was the inverse of "gas_volume()",
but when you calculate wet volumes from the imperial sizes, you don't
actually use the "real" gas volume, you use the idealized one.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
 subsurface-core/dive.c | 7 +------
 subsurface-core/dive.h | 1 -
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/subsurface-core/dive.c b/subsurface-core/dive.c
index 85ad3f597fb4..b7beadce5765 100644
--- a/subsurface-core/dive.c
+++ b/subsurface-core/dive.c
@@ -856,7 +856,7 @@ static void update_min_max_temperatures(struct dive *dive, temperature_t tempera
  * THIS IS A ROUGH APPROXIMATION! The real numbers will
  * depend on the exact gas mix and temperature.
  */
-double surface_volume_multiplier(pressure_t pressure)
+static double surface_volume_multiplier(pressure_t pressure)
 {
 	double bar = pressure.mbar / 1000.0;
 
@@ -870,11 +870,6 @@ int gas_volume(cylinder_t *cyl, pressure_t p)
 	return cyl->type.size.mliter * surface_volume_multiplier(p);
 }
 
-int wet_volume(double cuft, pressure_t p)
-{
-	return cuft_to_l(cuft) * 1000 / surface_volume_multiplier(p);
-}
-
 /*
  * If the cylinder tank pressures are within half a bar
  * (about 8 PSI) of the sample pressures, we consider it
diff --git a/subsurface-core/dive.h b/subsurface-core/dive.h
index e96806d23cad..08100a27051d 100644
--- a/subsurface-core/dive.h
+++ b/subsurface-core/dive.h
@@ -129,7 +129,6 @@ extern int units_to_sac(double volume);
 
 /* Volume in mliter of a cylinder at pressure 'p' */
 extern int gas_volume(cylinder_t *cyl, pressure_t p);
-extern int wet_volume(double cuft, pressure_t p);
 
 
 static inline int get_o2(const struct gasmix *mix)
-- 
2.7.2.334.g7c0da37



More information about the subsurface mailing list