diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-08-04 14:42:21 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-11-09 19:19:04 +0100 |
commit | 4355ce3924943eb22a6e3296372710953ff0b99d (patch) | |
tree | 45a0c04cad9eed9a5645c58aafb17cd265f1b4cb /core/dive.c | |
parent | 860807bf922f6fa08260def906df4d864353c90f (diff) | |
download | subsurface-4355ce3924943eb22a6e3296372710953ff0b99d.tar.gz |
Cleanup: move copy_cylinder_types() from dive.c to equipment.c
Thus, future callers will not have to include the monster dive.h
include if they just want to copy cylinders.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.c')
-rw-r--r-- | core/dive.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/core/dive.c b/core/dive.c index 241125f61..6043845f6 100644 --- a/core/dive.c +++ b/core/dive.c @@ -440,7 +440,6 @@ struct dive *move_dive(struct dive *s) d->_component = copy_string(s->_component) // copy elements, depending on bits in what that are set -static void copy_cylinder_types(const struct dive *s, struct dive *d); void selective_copy_dive(const struct dive *s, struct dive *d, struct dive_components what, bool clear) { if (clear) @@ -517,28 +516,6 @@ int nr_weightsystems(const struct dive *dive) return dive->weightsystems.nr; } -static void copy_cylinder_type(const cylinder_t *s, cylinder_t *d) -{ - free(d->type.description); - d->type = s->type; - d->type.description = s->type.description ? strdup(s->type.description) : NULL; - d->gasmix = s->gasmix; - d->depth = s->depth; - d->cylinder_use = s->cylinder_use; - d->manually_added = true; -} - -/* copy the equipment data part of the cylinders but keep pressures */ -static void copy_cylinder_types(const struct dive *s, struct dive *d) -{ - int i; - if (!s || !d) - return; - - for (i = 0; i < MAX_CYLINDERS; i++) - copy_cylinder_type(s->cylinder + i, d->cylinder + i); -} - void copy_cylinders(const struct dive *s, struct dive *d, bool used_only) { int i, j; |