code cleanup: introduce empty_cylinder constant

This deals with the issue of initializing structs in C++.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-01-06 19:00:20 -08:00
parent 4e419f7445
commit cef30619d0
12 changed files with 18 additions and 16 deletions

View file

@ -1103,7 +1103,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
if (prefs.surface_segment != 0) {
// Switch to an empty air cylinder for breathing air at the surface
// If no empty cylinder is found, keep using last deco gas
cylinder_t cyl = { 0 };
cylinder_t cyl = empty_cylinder;
cyl.cylinder_use = NOT_USED;
add_to_cylinder_table(&dive->cylinders, dive->cylinders.nr, cyl);
current_cylinder = dive->cylinders.nr - 1;