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>
This commit is contained in:
Berthold Stoeger 2018-10-14 19:48:07 +02:00 committed by Dirk Hohndel
parent 08827cc5f6
commit 253510c555

View file

@ -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);
}