mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: move clear_table() to divesite.c
There were two declaration of clear_table(), one in dive.h and one in parse.h. The definition was in parse.c. Since the parser doesn't even use the function, move the function and its declaration to divelist.[ch] and remove the redundant declaration in dive.h. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b01cba13c5
commit
0b57b8d59f
5 changed files with 13 additions and 13 deletions
|
@ -42,6 +42,8 @@
|
|||
* bool is_trip_before_after(const struct dive *dive, bool before)
|
||||
* void delete_dive_from_table(struct dive_table *table, int idx)
|
||||
* int find_next_visible_dive(timestamp_t when);
|
||||
* void clear_dive_file_data()
|
||||
* void clear_table(struct dive_table *table)
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1683,6 +1685,16 @@ void clear_dive_file_data()
|
|||
saved_git_id = "";
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear a dive_table
|
||||
*/
|
||||
void clear_table(struct dive_table *table)
|
||||
{
|
||||
for (int i = 0; i < table->nr; i++)
|
||||
free(table->dives[i]);
|
||||
table->nr = 0;
|
||||
}
|
||||
|
||||
/* This function defines the sort ordering of dives. The core
|
||||
* and the UI models should use the same sort function, which
|
||||
* should be stable. This is not crucial at the moment, as the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue