From 253510c55586c06e42b26e480db3b19a5f1a4a3a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 14 Oct 2018 19:48:07 +0200 Subject: 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 --- core/dive.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'core') 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); } -- cgit v1.2.3-70-g09d2