diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-26 17:03:54 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | 724055f0af4fb7cdb9f1570967fe4b34797f3419 (patch) | |
tree | 6aab8c34e7d0a6df1d6fe84bc5794e8eb5404b7d /core/save-git.c | |
parent | acd44467c1100a1a774cc644921b1dc33dca1266 (diff) | |
download | subsurface-724055f0af4fb7cdb9f1570967fe4b34797f3419.tar.gz |
Dive site: replace dive->dive_site_uuid by dive_site
Replace the UUID reference of struct dive by a pointer to dive_site.
This commit is rather large in lines, but nevertheless quite simple
since most of the UUID->pointer work was done in previous commits.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/save-git.c')
-rw-r--r-- | core/save-git.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/save-git.c b/core/save-git.c index b118cff3d..413c66211 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -431,17 +431,15 @@ static void create_dive_buffer(struct dive *dive, struct membuffer *b) SAVE("visibility", visibility); cond_put_format(dive->tripflag == NO_TRIP, b, "notrip\n"); save_tags(b, dive->tag_list); - cond_put_format(dive->dive_site_uuid && get_dive_site_by_uuid(dive->dive_site_uuid), - b, "divesiteid %08x\n", dive->dive_site_uuid); - if (verbose && dive->dive_site_uuid && !get_dive_site_by_uuid(dive->dive_site_uuid)) - fprintf(stderr, "removed reference to non-existant dive site with uuid %08x\n", dive->dive_site_uuid); + cond_put_format(!!dive->dive_site, b, "divesiteid %08x\n", dive->dive_site->uuid); + if (verbose && dive->dive_site) + fprintf(stderr, "removed reference to non-existant dive site with uuid %08x\n", dive->dive_site->uuid); save_overview(b, dive); save_cylinder_info(b, dive); save_weightsystem_info(b, dive); save_dive_temperature(b, dive); } - /* * libgit2 has a "git_treebuilder" concept, but it's broken, and can not * be used to do a flat tree (like the git "index") nor a recursive tree. @@ -887,8 +885,8 @@ static void save_divesites(git_repository *repo, struct dir *tree) int j; struct dive *d; for_each_dive(j, d) { - if (d->dive_site_uuid == ds->uuid) - d->dive_site_uuid = 0; + if (d->dive_site == ds) + d->dive_site = NULL; } delete_dive_site(ds); i--; // since we just deleted that one |