From a5f894d1d3b53a3a99580d2da467a46d04c65266 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 29 Aug 2012 17:24:15 -0700 Subject: Clean up macros and auxiliary functions In preparation for the next stage of the trips handling this commit makes the macros used to access trips (and some frequently used variables for the tree and list models) more consistent. This also changes the way we display un-grouped dives in the dive list, i.e. dives that are not part of a dive trip. Their dive number is now printed bold. Signed-off-by: Dirk Hohndel --- save-xml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'save-xml.c') diff --git a/save-xml.c b/save-xml.c index b797475e5..3bea2adfa 100644 --- a/save-xml.c +++ b/save-xml.c @@ -291,6 +291,8 @@ static void save_trip(FILE *f, struct dive *trip) fprintf(f, "tm_year+1900, tm->tm_mon+1, tm->tm_mday); + fprintf(f, " time='%02u:%02u:%02u'", + tm->tm_hour, tm->tm_min, tm->tm_sec); if (trip->location) show_utf8(f, trip->location, " location=\'","\'", 1); fprintf(f, " />\n"); @@ -341,7 +343,7 @@ void save_dives(const char *filename) fprintf(f, "\n\n", VERSION); /* save the trips */ - while ((trip = NEXT_TRIP(trip, dive_trip_list)) != 0) + while ((trip = NEXT_TRIP(trip)) != NULL) save_trip(f, trip->data); /* save the dives */ -- cgit v1.2.3-70-g09d2