mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
acd44467c1
commit
724055f0af
28 changed files with 181 additions and 169 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue