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/uemis-downloader.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/uemis-downloader.c')
-rw-r--r-- | core/uemis-downloader.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c index 2b44a9852..5caa10498 100644 --- a/core/uemis-downloader.c +++ b/core/uemis-downloader.c @@ -993,11 +993,11 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char * int divespot_id = atoi(val); if (divespot_id != -1) { struct dive_site *ds = create_dive_site("from Uemis", dive->when); - dive->dive_site_uuid = ds->uuid; + dive->dive_site = ds; uemis_mark_divelocation(dive->dc.diveid, divespot_id, ds); } #if UEMIS_DEBUG & 2 - fprintf(debugfile, "Created divesite %d for diveid : %d\n", dive->dive_site_uuid, dive->dc.diveid); + fprintf(debugfile, "Created divesite %d for diveid : %d\n", dive->dive_site->uuid, dive->dc.diveid); #endif } else if (dive) { parse_tag(dive, tag, val); @@ -1175,11 +1175,11 @@ static bool load_uemis_divespot(const char *mountpath, int divespot_id) static void get_uemis_divespot(const char *mountpath, int divespot_id, struct dive *dive) { - struct dive_site *nds = get_dive_site_by_uuid(dive->dive_site_uuid); + struct dive_site *nds = dive->dive_site; if (is_divespot_mappable(divespot_id)) { struct dive_site *ds = get_dive_site_by_divespot_id(divespot_id); - dive->dive_site_uuid = ds ? ds->uuid : 0; + dive->dive_site = ds; } else if (nds && nds->name && strstr(nds->name,"from Uemis")) { if (load_uemis_divespot(mountpath, divespot_id)) { /* get the divesite based on the diveid, this should give us @@ -1195,15 +1195,15 @@ static void get_uemis_divespot(const char *mountpath, int divespot_id, struct di /* if the uuid's are the same, the new site is a duplicate and can be deleted */ if (nds->uuid != ods->uuid) { delete_dive_site(nds); - dive->dive_site_uuid = ods->uuid; + dive->dive_site = ods; } } - add_to_divespot_mapping(divespot_id, get_dive_site_by_uuid(dive->dive_site_uuid)); + add_to_divespot_mapping(divespot_id, dive->dive_site); } else { /* if we can't load the dive site details, delete the site we * created in process_raw_buffer */ - delete_dive_site(get_dive_site_by_uuid(dive->dive_site_uuid)); + delete_dive_site(dive->dive_site); } } } |