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>
This commit is contained in:
Dirk Hohndel 2013-11-07 17:25:42 +09:00
parent f2035bcd79
commit 460aa4c1bd
3 changed files with 15 additions and 2 deletions

11
dive.c
View file

@ -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 */