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

@ -1003,7 +1003,7 @@ static void divinglog_place(char *place, struct dive *d, struct parser_state *st
static int divinglog_dive_match(struct dive *dive, const char *name, char *buf, struct parser_state *state)
{
/* For cylinder related fields, we might have to create a cylinder first. */
cylinder_t cyl = { 0 };
cylinder_t cyl = empty_cylinder;
if (MATCH("tanktype", utf8_string, &cyl.type.description)) {
cylinder_t *cyl0 = get_or_create_cylinder(dive, 0);
free((void *)cyl0->type.description);