From b949bad026c8bab7611998fb0fcf9f6008dbd7e9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 28 Apr 2020 14:50:40 +0200 Subject: core: always keep an empty cylinder at the end of the cylinder array This will be temporarilly used by the planner to mark consumption of air at the surface. Do this by creating a new function add_cylinder, which replaces add_to_cylinder_table() and takes care of always adding a dummy cylinder at the end of the table. Make the original add_to_cylinder_table() local, so that it cannot be accessed anymore. Signed-off-by: Berthold Stoeger --- core/equipment.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/equipment.h') diff --git a/core/equipment.h b/core/equipment.h index 081a13835..c5a0db6d6 100644 --- a/core/equipment.h +++ b/core/equipment.h @@ -39,7 +39,7 @@ static const cylinder_t empty_cylinder = { { { 0 }, { 0 }, (const char *)0}, { { * *not* pointers to cylinders. This has two crucial consequences: * 1) Pointers to cylinders are not stable. They may be * invalidated if the table is reallocated. - * 2) add_to_cylinder_table(), etc. take ownership of the + * 2) add_cylinder(), etc. take ownership of the * cylinder. Notably of the description string. */ struct cylinder_table { int nr, allocated; @@ -102,7 +102,7 @@ extern void add_to_weightsystem_table(struct weightsystem_table *, int idx, weig /* Cylinder table functions */ extern void clear_cylinder_table(struct cylinder_table *); -extern void add_to_cylinder_table(struct cylinder_table *, int idx, cylinder_t cyl); +extern void add_cylinder(struct cylinder_table *, int idx, cylinder_t cyl); void get_gas_string(struct gasmix gasmix, char *text, int len); const char *gasname(struct gasmix gasmix); -- cgit v1.2.3-70-g09d2