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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-08 16:58:33 +01:00 committed by Dirk Hohndel
parent bc7afebc23
commit 6b283e598a
9 changed files with 63 additions and 80 deletions

View file

@ -408,7 +408,8 @@ void write_trip(struct membuffer *b, dive_trip_t *trip, int *dive_no, bool selec
char *separator = "";
bool found_sel_dive = 0;
for (dive = trip->dives; dive != NULL; dive = dive->next) {
for (int i = 0; i < trip->dives.nr; i++) {
dive = trip->dives.dives[i];
if (!dive->selected && selected_only)
continue;