summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-07 17:25:42 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-07 18:07:10 +0900
commit460aa4c1bdee64f25e1c846ac9a6182e4e8e9820 (patch)
tree0e651be7983f0728dff52c963448dd5ac7982b58 /dive.c
parentf2035bcd797cab0b6be180b160bca3e768ccb652 (diff)
downloadsubsurface-460aa4c1bdee64f25e1c846ac9a6182e4e8e9820.tar.gz
Include the cylinder information in a dive added with "Add Dive"
We only copied the samples, but not the related cylinder data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index 4bf5f2742..030dfa410 100644
--- a/dive.c
+++ b/dive.c
@@ -195,7 +195,16 @@ struct dive *alloc_dive(void)
return dive;
}
-void copy_samples(struct dive* s, struct dive* d)
+void copy_cylinders(struct dive *s, struct dive *d)
+{
+ int i;
+ if (!s || !d)
+ return;
+ for (i = 0; i < MAX_CYLINDERS; i++)
+ d->cylinder[i] = s->cylinder[i];
+}
+
+void copy_samples(struct dive *s, struct dive *d)
{
/* instead of carefully copying them one by one and calling add_sample
* over and over again, let's just copy the whole blob */