summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-02-18 16:22:34 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-03-05 18:04:57 +0200
commitbdc470a80e0260011e3dfc4d949df8f9e222f73f (patch)
tree625c26f2f754a56929d2f8880170c38b8f7d779b /core/dive.c
parente5dcd9fc161891a4e70364e1dcdf232590eb49c6 (diff)
downloadsubsurface-bdc470a80e0260011e3dfc4d949df8f9e222f73f.tar.gz
Cleanup: Remove hash field from picture-structure
The hash field in the picture-structure was in principle non-operational. It was set on loading, but never actually changed. The authoritative hash comes from the filename->hash map. Therefore, make this explicit by removing the hash field from the picture structure. Instead of filling the picture structure on loading, add the hash directly to the filename->hash map. This is done in the register_hash() function, which does not overwrite old entries. I.e. the local hash has priority over the save-file. This policy might be refined in the future. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/dive.c b/core/dive.c
index c4a903eec..9ba180c6f 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -455,7 +455,6 @@ static void copy_pl(struct picture *sp, struct picture *dp)
{
*dp = *sp;
dp->filename = copy_string(sp->filename);
- dp->hash = copy_string(sp->hash);
}
/* copy an element in a list of tags */
@@ -3804,7 +3803,6 @@ void picture_free(struct picture *picture)
if (!picture)
return;
free(picture->filename);
- free(picture->hash);
free(picture);
}