summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-11-26 14:52:07 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-26 21:44:51 -0700
commit6fe52ee19e5e9cd33bd1ceab4609f31829ff2f08 (patch)
tree1374e09c1eebcb44c4066345fd0f8411e3ca14b9 /parse-xml.c
parent3f197336aa3aa1485bd1fdc38d21050006857909 (diff)
downloadsubsurface-6fe52ee19e5e9cd33bd1ceab4609f31829ff2f08.tar.gz
Simplify tripflags: remove tripflag_names[]
This removes the tripflag name array, since it's not actually useful. The only information we ever save in the XML file is whether a dive is explicitly not supposed to ever be grouped with a trip ("NOTRIP"), and everything else is implicit. I'm going to simplify the trip flags further (possibly removing it entirely - like I did for dive trips already), and don't like having to maintain the tripflag_names[] array logic. 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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 1d08ca009..35e87a2d5 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -533,14 +533,8 @@ static void hex_value(char *buffer, void *_i)
static void get_tripflag(char *buffer, void *_tf)
{
tripflag_t *tf = _tf;
- tripflag_t i;
-
- *tf = TF_NONE;
- for (i = NO_TRIP; i < NUM_TRIPFLAGS; i++)
- if(! strcmp(buffer, tripflag_names[i])) {
- *tf = i;
- break;
- }
+ *tf = strcmp(buffer, "NOTRIP") ? TF_NONE : NO_TRIP;
+ free(buffer);
}
static void centibar(char *buffer, void *_pressure)