aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-11 15:00:15 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-06 13:58:09 -0700
commit2c4975f2ed728543d59300a622aa146fd94b4bd1 (patch)
tree5658d15b70690a7bc66bd213e32ad181d16717f1 /core
parentfdca1303870ebeb0ea846984e0a9eb8804000390 (diff)
downloadsubsurface-2c4975f2ed728543d59300a622aa146fd94b4bd1.tar.gz
cleanup: move copy_cylinders from dive.c to equipment.c
Since this doesn't touch struct dive, dive.c is not an appropriate place for this function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c8
-rw-r--r--core/dive.h1
-rw-r--r--core/equipment.c8
-rw-r--r--core/equipment.h1
4 files changed, 9 insertions, 9 deletions
diff --git a/core/dive.c b/core/dive.c
index 00add41e6..defead0a1 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -619,14 +619,6 @@ int nr_weightsystems(const struct dive *dive)
return dive->weightsystems.nr;
}
-void copy_cylinders(const struct cylinder_table *s, struct cylinder_table *d)
-{
- int i;
- clear_cylinder_table(d);
- for (i = 0; i < s->nr; i++)
- add_cloned_cylinder(d, s->cylinders[i]);
-}
-
void copy_used_cylinders(const struct dive *s, struct dive *d, bool used_only)
{
int i;
diff --git a/core/dive.h b/core/dive.h
index 7daf74293..12b2a102a 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -345,7 +345,6 @@ extern struct event *clone_event(const struct event *src_ev);
extern void copy_events(const struct divecomputer *s, struct divecomputer *d);
extern void copy_events_until(const struct dive *sd, struct dive *dd, int time);
extern void free_events(struct event *ev);
-extern void copy_cylinders(const struct cylinder_table *s, struct cylinder_table *d);
extern void copy_used_cylinders(const struct dive *s, struct dive *d, bool used_only);
extern void copy_samples(const struct divecomputer *s, struct divecomputer *d);
extern bool is_cylinder_used(const struct dive *dive, int idx);
diff --git a/core/equipment.c b/core/equipment.c
index 1d701ae81..16d6185c1 100644
--- a/core/equipment.c
+++ b/core/equipment.c
@@ -42,6 +42,14 @@ void copy_weights(const struct weightsystem_table *s, struct weightsystem_table
add_cloned_weightsystem(d, s->weightsystems[i]);
}
+void copy_cylinders(const struct cylinder_table *s, struct cylinder_table *d)
+{
+ int i;
+ clear_cylinder_table(d);
+ for (i = 0; i < s->nr; i++)
+ add_cloned_cylinder(d, s->cylinders[i]);
+}
+
/* weightsystem table functions */
//static MAKE_GET_IDX(weightsystem_table, weightsystem_t, weightsystems)
static MAKE_GROW_TABLE(weightsystem_table, weightsystem_t, weightsystems)
diff --git a/core/equipment.h b/core/equipment.h
index c5a0db6d6..7df54ad50 100644
--- a/core/equipment.h
+++ b/core/equipment.h
@@ -71,6 +71,7 @@ struct weightsystem_table {
extern int cylinderuse_from_text(const char *text);
extern void copy_weights(const struct weightsystem_table *s, struct weightsystem_table *d);
+extern void copy_cylinders(const struct cylinder_table *s, struct cylinder_table *d);
extern weightsystem_t clone_weightsystem(weightsystem_t ws);
extern void free_weightsystem(weightsystem_t ws);
extern void copy_cylinder_types(const struct dive *s, struct dive *d);