Cleanup: macroize dive site table functions, keep table sorted

Turn the table functions of the dive site handling into macros
as was already used for dives and dive trips. This has the effect
that the table is kept sorted by UUID.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-10 22:28:14 +01:00 committed by Dirk Hohndel
parent a6f65d744f
commit 84f7179367
3 changed files with 25 additions and 47 deletions

View file

@ -46,9 +46,8 @@ static inline struct dive_site *get_dive_site(int nr, struct dive_site_table *ds
int get_divesite_idx(const struct dive_site *ds, struct dive_site_table *ds_table);
struct dive_site *get_dive_site_by_uuid(uint32_t uuid, struct dive_site_table *ds_table);
void dive_site_table_sort(struct dive_site_table *ds_table);
void sort_dive_site_table(struct dive_site_table *ds_table);
void add_dive_site_to_table(struct dive_site *ds, struct dive_site_table *ds_table);
void remove_dive_site_from_table(struct dive_site *ds, struct dive_site_table *ds_table);
void register_dive_site(struct dive_site *ds);
void unregister_dive_site(struct dive_site *ds);
struct dive_site *alloc_or_get_dive_site(uint32_t uuid, struct dive_site_table *ds_table);