summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-10 17:26:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-10 20:30:32 -0800
commit868a2cc0905b719cb5f3eaf15f0550d6ce82dbeb (patch)
treef7cca241ff73a2ae6c38c975911b3beae5cc1406 /dive.c
parent4c13f1f6b4ad7deb2071fb4848ddf43be0af4db7 (diff)
downloadsubsurface-868a2cc0905b719cb5f3eaf15f0550d6ce82dbeb.tar.gz
Split up preference data structure definition into 'pref.h'
.. and rename the badly named 'output_units/input_units' variables. We used to have this confusing thing where we had two different units (input vs output) that *look* like they are mirror images, but in fact "output_units" was the user units, and "input_units" are the XML parsing units. So this renames them to be clearer. "output_units" is now just "units" (it's the units a user would ever see), and "input_units" is now "xml_parsing_units" and set by the XML file parsers to reflect the units of the parsed file. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/dive.c b/dive.c
index 7457cc5fc..4fc6f7551 100644
--- a/dive.c
+++ b/dive.c
@@ -34,9 +34,9 @@ int get_pressure_units(unsigned int mb, const char **units)
{
int pressure;
const char* unit;
- struct units *output_units_p = get_output_units();
+ struct units *units_p = get_units();
- switch (output_units_p->pressure) {
+ switch (units_p->pressure) {
case PASCAL:
pressure = mb * 100;
unit = _("pascal");
@@ -59,9 +59,9 @@ double get_temp_units(unsigned int mk, const char **units)
{
double deg;
const char *unit;
- struct units *output_units_p = get_output_units();
+ struct units *units_p = get_units();
- if (output_units_p->temperature == FAHRENHEIT) {
+ if (units_p->temperature == FAHRENHEIT) {
deg = mkelvin_to_F(mk);
unit = UTF8_DEGREE "F";
} else {
@@ -78,9 +78,9 @@ double get_volume_units(unsigned int ml, int *frac, const char **units)
int decimals;
double vol;
const char *unit;
- struct units *output_units_p = get_output_units();
+ struct units *units_p = get_units();
- switch (output_units_p->volume) {
+ switch (units_p->volume) {
case LITER:
vol = ml / 1000.0;
unit = _("l");
@@ -104,9 +104,9 @@ double get_depth_units(unsigned int mm, int *frac, const char **units)
int decimals;
double d;
const char *unit;
- struct units *output_units_p = get_output_units();
+ struct units *units_p = get_units();
- switch (output_units_p->length) {
+ switch (units_p->length) {
case METERS:
d = mm / 1000.0;
unit = _("m");
@@ -130,9 +130,9 @@ double get_weight_units(unsigned int grams, int *frac, const char **units)
int decimals;
double value;
const char* unit;
- struct units *output_units_p = get_output_units();
+ struct units *units_p = get_units();
- if (output_units_p->weight == LBS) {
+ if (units_p->weight == LBS) {
value = grams_to_lbs(grams);
unit = _("lbs");
decimals = 0;
@@ -352,7 +352,7 @@ static void sanitize_cylinder_type(cylinder_type_t *type)
if (!type->size.mliter)
return;
- if (input_units.volume == CUFT) {
+ if (xml_parsing_units.volume == CUFT) {
/* confusing - we don't really start from ml but millicuft !*/
volume_of_air = cuft_to_l(type->size.mliter);
atm = to_ATM(type->workingpressure); /* working pressure in atm */