diff options
Diffstat (limited to 'core/dive.c')
-rw-r--r-- | core/dive.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/core/dive.c b/core/dive.c index ffdf91ae3..c97c229f6 100644 --- a/core/dive.c +++ b/core/dive.c @@ -14,6 +14,7 @@ #include "qthelper.h" #include "metadata.h" #include "membuffer.h" +#include "picture.h" #include "tag.h" #include "trip.h" #include "structured_list.h" @@ -2697,14 +2698,6 @@ static void free_dc(struct divecomputer *dc) free(dc); } -void free_picture(struct picture *picture) -{ - if (picture) { - free(picture->filename); - free(picture); - } -} - static int same_sample(struct sample *a, struct sample *b) { if (a->time.seconds != b->time.seconds) @@ -3410,15 +3403,6 @@ void set_git_prefs(const char *prefs) git_prefs.pp_graphs.po2 = 1; } -struct picture *alloc_picture() -{ - struct picture *pic = malloc(sizeof(struct picture)); - if (!pic) - exit(1); - memset(pic, 0, sizeof(struct picture)); - return pic; -} - static bool new_picture_for_dive(struct dive *d, const char *filename) { FOR_EACH_PICTURE (d) { @@ -3538,22 +3522,6 @@ void dive_add_picture(struct dive *dive, struct picture *newpic) return; } -unsigned int dive_get_picture_count(struct dive *dive) -{ - unsigned int i = 0; - FOR_EACH_PICTURE (dive) - i++; - return i; -} - -void picture_free(struct picture *picture) -{ - if (!picture) - return; - free(picture->filename); - free(picture); -} - // Return true if picture was found and deleted bool dive_remove_picture(struct dive *d, const char *filename) { @@ -3562,7 +3530,7 @@ bool dive_remove_picture(struct dive *d, const char *filename) picture = &(*picture)->next; if (*picture) { struct picture *temp = (*picture)->next; - picture_free(*picture); + free_picture(*picture); *picture = temp; invalidate_dive_cache(current_dive); return true; |