diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-10 17:26:10 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-10 20:30:32 -0800 |
commit | 868a2cc0905b719cb5f3eaf15f0550d6ce82dbeb (patch) | |
tree | f7cca241ff73a2ae6c38c975911b3beae5cc1406 /parse-xml.c | |
parent | 4c13f1f6b4ad7deb2071fb4848ddf43be0af4db7 (diff) | |
download | subsurface-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 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/parse-xml.c b/parse-xml.c index 6de518d02..9280b9852 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -128,7 +128,7 @@ static int match(const char *pattern, int plen, } -struct units input_units; +struct units xml_parsing_units; const struct units SI_units = SI_UNITS; const struct units IMPERIAL_units = IMPERIAL_UNITS; @@ -267,7 +267,7 @@ static void pressure(char *buffer, void *_press) /* Just ignore zero values */ if (!val.fp) break; - switch (input_units.pressure) { + switch (xml_parsing_units.pressure) { case PASCAL: mbar = val.fp / 100; break; @@ -311,7 +311,7 @@ static void depth(char *buffer, void *_depth) switch (integer_or_float(buffer, &val)) { case FLOAT: - switch (input_units.length) { + switch (xml_parsing_units.length) { case METERS: depth->mm = val.fp * 1000 + 0.5; break; @@ -332,7 +332,7 @@ static void weight(char *buffer, void *_weight) switch (integer_or_float(buffer, &val)) { case FLOAT: - switch (input_units.weight) { + switch (xml_parsing_units.weight) { case KG: weight->grams = val.fp * 1000 + 0.5; break; @@ -357,7 +357,7 @@ static void temperature(char *buffer, void *_temperature) if (!val.fp) break; /* Celsius */ - switch (input_units.temperature) { + switch (xml_parsing_units.temperature) { case KELVIN: temperature->mkelvin = val.fp * 1000; break; @@ -1364,15 +1364,15 @@ static void DivingLog_importer(void) * * Crazy f*%^ morons. */ - input_units = SI_units; + xml_parsing_units = SI_units; } static void uddf_importer(void) { import_source = UDDF; - input_units = SI_units; - input_units.pressure = PASCAL; - input_units.temperature = KELVIN; + xml_parsing_units = SI_units; + xml_parsing_units.pressure = PASCAL; + xml_parsing_units.temperature = KELVIN; } /* @@ -1437,7 +1437,7 @@ static void reset_all(void) * data within one file, we might have to reset it per * dive for that format. */ - input_units = SI_units; + xml_parsing_units = SI_units; import_source = UNKNOWN; } |