mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8df3705152
commit
c26e922802
4 changed files with 5 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue