mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_or_create_cylinder() to struct dive
Other cylinder-creation functions were already there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
777e7f32a5
commit
9bb2255ba8
12 changed files with 83 additions and 83 deletions
|
@ -369,17 +369,6 @@ cylinder_t *add_empty_cylinder(struct cylinder_table *t)
|
|||
return &t->back();
|
||||
}
|
||||
|
||||
cylinder_t *get_or_create_cylinder(struct dive *d, int idx)
|
||||
{
|
||||
if (idx < 0) {
|
||||
report_info("Warning: accessing invalid cylinder %d", idx);
|
||||
return NULL;
|
||||
}
|
||||
while (static_cast<size_t>(idx) >= d->cylinders.size())
|
||||
add_empty_cylinder(&d->cylinders);
|
||||
return &d->cylinders[idx];
|
||||
}
|
||||
|
||||
/* if a default cylinder is set, use that */
|
||||
void fill_default_cylinder(const struct dive *dive, cylinder_t *cyl)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue