diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-07-18 07:48:45 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-18 09:04:47 -0700 |
commit | 3a933637dab9aa4fee55198623a6f9235727cfde (patch) | |
tree | 6d30cad6e31718872e45dfcf2c97a72d36f1e04a /core | |
parent | b7bb9b417775b6ef69c7c865144d857fd00bb506 (diff) | |
download | subsurface-3a933637dab9aa4fee55198623a6f9235727cfde.tar.gz |
Cleanup: removed unused functions in divelist.h
find_trip_by_idx() and find_matching_trip() weren't used anywhere.
The trip index actually is only misused as a "trip saved"-flag.
trip_has_selected_dives() only existed as a comment.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/divelist.c | 44 | ||||
-rw-r--r-- | core/divelist.h | 3 |
2 files changed, 0 insertions, 47 deletions
diff --git a/core/divelist.c b/core/divelist.c index 6986c5a80..7291de23e 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -6,15 +6,12 @@ * dive_trip_t *dive_trip_list; * unsigned int amount_selected; * void dump_selection(void) - * dive_trip_t *find_trip_by_idx(int idx) - * int trip_has_selected_dives(dive_trip_t *trip) * void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p) * int total_weight(struct dive *dive) * int get_divenr(struct dive *dive) * int init_decompression(struct dive *dive) * void update_cylinder_related_info(struct dive *dive) * void dump_trip_list(void) - * dive_trip_t *find_matching_trip(timestamp_t when) * void insert_trip(dive_trip_t **dive_trip_p) * void remove_dive_from_trip(struct dive *dive) * void add_dive_to_trip(struct dive *dive, dive_trip_t *trip) @@ -81,21 +78,6 @@ void set_autogroup(bool value) autogroup = value; } -dive_trip_t *find_trip_by_idx(int idx) -{ - dive_trip_t *trip = dive_trip_list; - - if (idx >= 0) - return NULL; - idx = -idx; - while (trip) { - if (trip->index == idx) - return trip; - trip = trip->next; - } - return NULL; -} - /* * Get "maximal" dive gas for a dive. * Rules: @@ -711,32 +693,6 @@ void dump_trip_list(void) } #endif -/* this finds the last trip that at or before the time given */ -dive_trip_t *find_matching_trip(timestamp_t when) -{ - dive_trip_t *trip = dive_trip_list; - - if (!trip || trip->when > when) { -#ifdef DEBUG_TRIP - printf("no matching trip\n"); -#endif - return NULL; - } - while (trip->next && trip->next->when <= when) - trip = trip->next; -#ifdef DEBUG_TRIP - { - struct tm tm; - utc_mkdate(trip->when, &tm); - printf("found trip %p @ %04d-%02d-%02d %02d:%02d:%02d\n", - trip, - tm.tm_year, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); - } -#endif - return trip; -} - /* insert the trip into the dive_trip_list - but ensure you don't have * two trips for the same date; but if you have, make sure you don't * keep the one with less information */ diff --git a/core/divelist.h b/core/divelist.h index 84e680ab4..d014b4df1 100644 --- a/core/divelist.h +++ b/core/divelist.h @@ -21,13 +21,10 @@ extern int init_decompression(struct deco_state *ds, struct dive *dive); extern void process_dives(bool imported, bool prefer_imported); extern char *get_dive_gas_string(struct dive *dive); -extern dive_trip_t *find_trip_by_idx(int idx); - struct dive **grow_dive_table(struct dive_table *table); extern void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p); extern int get_divenr(struct dive *dive); extern int get_divesite_idx(struct dive_site *ds); -extern dive_trip_t *find_matching_trip(timestamp_t when); extern void remove_dive_from_trip(struct dive *dive, short was_autogen); extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive); extern void autogroup_dives(void); |