summaryrefslogtreecommitdiffstats
path: root/core/equipment.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-04 19:17:11 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-09 19:19:04 +0100
commitc26e922802826dc9e2f044312cc33d5a037f6a10 (patch)
treea1fc9c98acd90261b1d3bca46932d438d7fd7f7e /core/equipment.c
parent8df3705152aa32d8551b5fb7db08e0c8e442b480 (diff)
downloadsubsurface-c26e922802826dc9e2f044312cc33d5a037f6a10.tar.gz
Cleanup: return cylinder from add_empty_cylinder()
As a convenience, return the cylinder from add_empty_cylinder() to spare the caller from the nasty expression to fetch the last cylinder. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/equipment.c')
-rw-r--r--core/equipment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/equipment.c b/core/equipment.c
index 13e4a0486..3a2e6db4b 100644
--- a/core/equipment.c
+++ b/core/equipment.c
@@ -314,11 +314,12 @@ void copy_cylinder_types(const struct dive *s, struct dive *d)
add_cloned_cylinder(&d->cylinders, s->cylinders.cylinders[i]);
}
-void add_empty_cylinder(struct cylinder_table *t)
+cylinder_t *add_empty_cylinder(struct cylinder_table *t)
{
cylinder_t cyl = { 0 };
cyl.type.description = strdup("");
add_to_cylinder_table(t, t->nr, cyl);
+ return &t->cylinders[t->nr - 1];
}
/* access to cylinders is controlled by two functions: