mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: remove remove_event() function
No user left. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0bd821183d
commit
7081674b67
2 changed files with 0 additions and 19 deletions
18
core/dive.c
18
core/dive.c
|
@ -267,24 +267,6 @@ void remove_event_from_dc(struct divecomputer *dc, struct event *event)
|
|||
}
|
||||
}
|
||||
|
||||
/* Remove an event from current dive computer that is identical to the passed in event.
|
||||
* Frees the event. */
|
||||
void remove_event(const struct event *event)
|
||||
{
|
||||
struct event **ep = ¤t_dc->events;
|
||||
while (ep && !same_event(*ep, event))
|
||||
ep = &(*ep)->next;
|
||||
if (ep) {
|
||||
/* we can't link directly with event->next
|
||||
* because 'event' can be a copy from another
|
||||
* dive (for instance the displayed_dive
|
||||
* that we use on the interface to show things). */
|
||||
struct event *temp = (*ep)->next;
|
||||
free(*ep);
|
||||
*ep = temp;
|
||||
}
|
||||
}
|
||||
|
||||
/* since the name is an array as part of the structure (how silly is that?) we
|
||||
* have to actually remove the existing event and replace it with a new one.
|
||||
* WARNING, WARNING... this may end up freeing event in case that event is indeed
|
||||
|
|
|
@ -385,7 +385,6 @@ extern void swap_event(struct divecomputer *dc, struct event *from, struct event
|
|||
extern bool same_event(const struct event *a, const struct event *b);
|
||||
extern struct event *add_event(struct divecomputer *dc, unsigned int time, int type, int flags, int value, const char *name);
|
||||
extern void remove_event_from_dc(struct divecomputer *dc, struct event *event);
|
||||
extern void remove_event(const struct event *event);
|
||||
extern void update_event_name(struct dive *d, struct event *event, const char *name);
|
||||
extern void add_extra_data(struct divecomputer *dc, const char *key, const char *value);
|
||||
extern void per_cylinder_mean_depth(const struct dive *dive, struct divecomputer *dc, int *mean, int *duration);
|
||||
|
|
Loading…
Add table
Reference in a new issue