summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-14 19:48:07 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-15 21:00:17 -0400
commit253510c55586c06e42b26e480db3b19a5f1a4a3a (patch)
tree87add3b177a21d9bb5cf946b3b2545d42904ec16
parent08827cc5f6063a2e3720b9d821c9146fac74a0bd (diff)
downloadsubsurface-253510c55586c06e42b26e480db3b19a5f1a4a3a.tar.gz
Cleanup: remove apparently dead code in sanitize_cylinder_type()
sanitize_cylinder_type(), which is indirectly called from fixup_dive(), had ft^3 -> mliter conversion code, which was executed on the condition "xml_parsing_units.volume == CUFT". But nowhere in the code base would xml_parsing_units.volume ever be set to non-metric. Moreover, xml_parsing_units reflects the units of the latest parsed XML file, but fixup_dive() is called in numerous contexts not related to XML parsing. Therefore, the whole piece of code seems highly questionable. Remove this code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/dive.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/core/dive.c b/core/dive.c
index c1cc2e11a..1fe3eccf4 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -1212,7 +1212,6 @@ static void match_standard_cylinder(cylinder_type_t *type)
type->description = p;
}
-
/*
* There are two ways to give cylinder size information:
* - total amount of gas in cuft (depends on working pressure and physical size)
@@ -1225,8 +1224,6 @@ static void match_standard_cylinder(cylinder_type_t *type)
*/
static void sanitize_cylinder_type(cylinder_type_t *type)
{
- double volume_of_air, volume;
-
/* If we have no working pressure, it had *better* be just a physical size! */
if (!type->workingpressure.mbar)
return;
@@ -1235,15 +1232,6 @@ static void sanitize_cylinder_type(cylinder_type_t *type)
if (!type->size.mliter)
return;
- if (xml_parsing_units.volume == CUFT) {
- double bar = type->workingpressure.mbar / 1000.0;
- /* confusing - we don't really start from ml but millicuft !*/
- volume_of_air = cuft_to_l(type->size.mliter);
- /* milliliters at 1 atm: not corrected for compressibility! */
- volume = volume_of_air / bar_to_atm(bar);
- type->size.mliter = lrint(volume);
- }
-
/* Ok, we have both size and pressure: try to match a description */
match_standard_cylinder(type);
}