mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: remove picture_free()
There is the free_picture() function with the same functionality. The compiler/linker should recognize that and remove the duplicate code, but still... Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
aa8cadbcdd
commit
34657f62ae
2 changed files with 1 additions and 10 deletions
10
core/dive.c
10
core/dive.c
|
@ -3538,14 +3538,6 @@ void dive_add_picture(struct dive *dive, struct picture *newpic)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void picture_free(struct picture *picture)
|
|
||||||
{
|
|
||||||
if (!picture)
|
|
||||||
return;
|
|
||||||
free(picture->filename);
|
|
||||||
free(picture);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return true if picture was found and deleted
|
// Return true if picture was found and deleted
|
||||||
bool dive_remove_picture(struct dive *d, const char *filename)
|
bool dive_remove_picture(struct dive *d, const char *filename)
|
||||||
{
|
{
|
||||||
|
@ -3554,7 +3546,7 @@ bool dive_remove_picture(struct dive *d, const char *filename)
|
||||||
picture = &(*picture)->next;
|
picture = &(*picture)->next;
|
||||||
if (*picture) {
|
if (*picture) {
|
||||||
struct picture *temp = (*picture)->next;
|
struct picture *temp = (*picture)->next;
|
||||||
picture_free(*picture);
|
free_picture(*picture);
|
||||||
*picture = temp;
|
*picture = temp;
|
||||||
invalidate_dive_cache(current_dive);
|
invalidate_dive_cache(current_dive);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -228,7 +228,6 @@ extern void create_picture(const char *filename, int shift_time, bool match_all)
|
||||||
extern void dive_add_picture(struct dive *d, struct picture *newpic);
|
extern void dive_add_picture(struct dive *d, struct picture *newpic);
|
||||||
extern bool dive_remove_picture(struct dive *d, const char *filename);
|
extern bool dive_remove_picture(struct dive *d, const char *filename);
|
||||||
extern bool picture_check_valid_time(timestamp_t timestamp, int shift_time);
|
extern bool picture_check_valid_time(timestamp_t timestamp, int shift_time);
|
||||||
extern void picture_free(struct picture *picture);
|
|
||||||
|
|
||||||
extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx);
|
extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx);
|
||||||
extern int explicit_first_cylinder(const struct dive *dive, const struct divecomputer *dc);
|
extern int explicit_first_cylinder(const struct dive *dive, const struct divecomputer *dc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue