aboutsummaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 87e4f8645..35ebf0446 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -648,6 +648,15 @@ static void try_to_fill_event(const char *name, char *buf)
nonmatch("event", name, buf);
}
+/*
+ * If we don't have an explicit dive computer,
+ * we use the implicit one that every dive has..
+ */
+static struct divecomputer *get_dc(void)
+{
+ return cur_dc ? : &cur_dive->dc;
+}
+
/* We're in the top-level dive xml. Try to convert whatever value to a dive value */
static void try_to_fill_dc(struct divecomputer *dc, const char *name, char *buf)
{
@@ -690,7 +699,7 @@ static void get_cylinderindex(char *buffer, void *_i)
int *i = _i;
*i = atoi(buffer);
if (lastcylinderindex != *i) {
- add_gas_switch_event(cur_dive, cur_dc, cur_sample->time.seconds, *i);
+ add_gas_switch_event(cur_dive, get_dc(), cur_sample->time.seconds, *i);
lastcylinderindex = *i;
}
}
@@ -1159,15 +1168,6 @@ static void event_start(void)
cur_event.active = 1;
}
-/*
- * If we don't have an explicit dive computer,
- * we use the implicit one that every dive has..
- */
-static struct divecomputer *get_dc(void)
-{
- return cur_dc ? : &cur_dive->dc;
-}
-
static void event_end(void)
{
struct divecomputer *dc = get_dc();