aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-12-16 16:45:04 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-12-17 07:33:45 -0800
commit6184f5d2761b559edf85063eca61389bb82ad343 (patch)
treee4745ec739b98cbcf20a160d5d3ba89f837cb577 /core/dive.c
parentf0164e97a2d769aa63263756e53ccbf37e9bd0e5 (diff)
downloadsubsurface-6184f5d2761b559edf85063eca61389bb82ad343.tar.gz
Core: remove count_dives_with_*() functions
The simplified filter-widget doesn't present lists of existing values with counts. Thus, a whole slew of count_dives_with_*() functions can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/core/dive.c b/core/dive.c
index 30a552a33..49431bffe 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -3357,70 +3357,6 @@ void dump_taglist(const char *intro, struct tag_entry *tl)
fprintf(stderr, "\n");
}
-// count the dives where the tag list contains the given tag
-int count_dives_with_tag(const char *tag)
-{
- int i, counter = 0;
- struct dive *d;
-
- for_each_dive (i, d) {
- if (empty_string(tag)) {
- // count dives with no tags
- if (d->tag_list == NULL)
- counter++;
- } else if (taglist_contains(d->tag_list, tag)) {
- counter++;
- }
- }
- return counter;
-}
-
-extern bool string_sequence_contains(const char *string_sequence, const char *text);
-
-// count the dives where the person is included in the comma separated string sequences of buddies or divemasters
-int count_dives_with_person(const char *person)
-{
- int i, counter = 0;
- struct dive *d;
-
- for_each_dive (i, d) {
- if (empty_string(person)) {
- // solo dive
- if (empty_string(d->buddy) && empty_string(d->divemaster))
- counter++;
- } else if (string_sequence_contains(d->buddy, person) || string_sequence_contains(d->divemaster, person)) {
- counter++;
- }
- }
- return counter;
-}
-
-// count the dives with exactly the location
-int count_dives_with_location(const char *location)
-{
- int i, counter = 0;
- struct dive *d;
-
- for_each_dive (i, d) {
- if (same_string(get_dive_location(d), location))
- counter++;
- }
- return counter;
-}
-
-// count the dives with exactly the suit
-int count_dives_with_suit(const char *suit)
-{
- int i, counter = 0;
- struct dive *d;
-
- for_each_dive (i, d) {
- if (same_string(d->suit, suit))
- counter++;
- }
- return counter;
-}
-
/*
* Merging two dives can be subtle, because there's two different ways
* of merging: