From 6b283e598a3a08c6133d66b5d5617370296e7d0e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 8 Nov 2018 16:58:33 +0100 Subject: Dive list: replace dive-list of trips by a table The dives of each trip were kept in a list. Replace this by a struct dive_table. This will make it significantly easier to keep the dives of a trip in sorted state. Signed-off-by: Berthold Stoeger --- core/dive.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'core/dive.h') diff --git a/core/dive.h b/core/dive.h index 07223322f..790d39d7f 100644 --- a/core/dive.h +++ b/core/dive.h @@ -286,13 +286,18 @@ typedef enum { NUM_TRIPFLAGS } tripflag_t; +struct dive_table { + int nr, allocated; + struct dive **dives; +}; + typedef struct dive_trip { timestamp_t when; char *location; char *notes; - struct dive *dives; - int nrdives, showndives; + struct dive_table dives; + int showndives; /* Used by the io-routines to mark trips that have already been written. */ bool saved; bool autogen; @@ -306,7 +311,6 @@ struct dive { int number; tripflag_t tripflag; dive_trip_t *divetrip; - struct dive *next, **pprev; bool selected; bool hidden_by_filter; timestamp_t when; @@ -428,11 +432,6 @@ extern const struct units SI_units, IMPERIAL_units; extern const struct units *get_units(void); extern int run_survey, verbose, quit, force_root; -struct dive_table { - int nr, allocated; - struct dive **dives; -}; - extern struct dive_table dive_table, downloadTable; extern struct dive displayed_dive; extern unsigned int dc_number; -- cgit v1.2.3-70-g09d2