Core: replace tripflag by notrip boolean

The only remaining use of the tripflag was to mark dives that
were removed explicitly from a trip, i.e. shouldn't be autogrouped.
Therefore replace the enum by a simple boolean.

Currently, there is no way of unsetting the notrip flag. But this
shouldn't result in a user-visible change.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-18 11:15:32 +01:00 committed by Dirk Hohndel
parent 3b9e0b5931
commit 6bf4120dbb
9 changed files with 13 additions and 28 deletions

View file

@ -278,13 +278,6 @@ struct divecomputer {
#define W_IDX_PRIMARY 0
#define W_IDX_SECONDARY 1
typedef enum {
TF_NONE,
NO_TRIP,
IN_TRIP,
NUM_TRIPFLAGS
} tripflag_t;
struct dive_table {
int nr, allocated;
struct dive **dives;
@ -307,7 +300,7 @@ extern dive_trip_t *dive_trip_list;
struct picture;
struct dive {
int number;
tripflag_t tripflag;
bool notrip; /* Don't autogroup this dive to a trip */
dive_trip_t *divetrip;
bool selected;
bool hidden_by_filter;
@ -418,8 +411,6 @@ extern bool autogroup;
* regularly dive at a local facility; this is why trips are an optional feature */
#define TRIP_THRESHOLD 3600 * 24 * 3
#define DIVE_NEEDS_TRIP(_dive) ((_dive)->tripflag == TF_NONE)
extern void add_dive_to_trip(struct dive *, dive_trip_t *);
struct dive *unregister_dive(int idx);