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

@ -591,7 +591,7 @@ void save_dives_buffer(struct membuffer *b, const bool select_only, bool anonymi
put_format(b, "</settings>\n");
/* save the dive sites - to make the output consistent let's sort the table, first */
dive_site_table_sort(&dive_site_table);
sort_dive_site_table(&dive_site_table);
purge_empty_dive_sites(&dive_site_table);
put_format(b, "<divesites>\n");
for (i = 0; i < dive_site_table.nr; i++) {