summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-05 09:12:54 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-05 09:12:54 -0700
commit5f79a804b925a8ffbcf933bb6fae4f764b518c8e (patch)
tree43e5d9dd7c7434966038789c0b2d0e28a7650e30 /parse-xml.c
parent0f832f15d1a5c4a9877fa4d568daa6e87241ca97 (diff)
downloadsubsurface-5f79a804b925a8ffbcf933bb6fae4f764b518c8e.tar.gz
Sanitize and fix cylinder pressure overview
Doing per-dive cylinder start/end pressures is insane, when we can have up to eight cylinders. The cylinder start/end pressure cannot be per dive, it needs to be per cylinder. This makes the save format cleaner too, we have all the cylinder data in just one place. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c
index b123bb39f..f68aae67e 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -645,9 +645,9 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
return;
if (MATCH(".watertemp", temperature, &dive->watertemp))
return;
- if (MATCH(".cylinderstartpressure", pressure, &dive->beginning_pressure))
+ if (MATCH(".cylinderstartpressure", pressure, &dive->cylinder[0].start))
return;
- if (MATCH(".cylinderendpressure", pressure, &dive->end_pressure))
+ if (MATCH(".cylinderendpressure", pressure, &dive->cylinder[0].end))
return;
if (MATCH(".location", utf8_string, &dive->location))
return;
@@ -660,6 +660,10 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
return;
if (MATCH(".cylinder.description", utf8_string, &dive->cylinder[cylinder_index].type.description))
return;
+ if (MATCH(".cylinder.start", pressure, &dive->cylinder[cylinder_index].start))
+ return;
+ if (MATCH(".cylinder.end", pressure, &dive->cylinder[cylinder_index].end))
+ return;
if (MATCH(".o2", gasmix, &dive->cylinder[cylinder_index].gasmix.o2))
return;