From cef30619d0d7296e1730d87dae1c9712ac5cd822 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 6 Jan 2020 19:00:20 -0800 Subject: code cleanup: introduce empty_cylinder constant This deals with the issue of initializing structs in C++. Signed-off-by: Dirk Hohndel --- core/cochran.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/cochran.c') diff --git a/core/cochran.c b/core/cochran.c index 632ba5bff..5955ddb69 100644 --- a/core/cochran.c +++ b/core/cochran.c @@ -675,7 +675,7 @@ static void cochran_parse_dive(const unsigned char *decode, unsigned mod, case TYPE_GEMINI: case TYPE_COMMANDER: if (config.type == TYPE_GEMINI) { - cylinder_t cyl = { 0 }; + cylinder_t cyl = empty_cylinder; dc->model = "Gemini"; dc->deviceid = buf[0x18c] * 256 + buf[0x18d]; // serial no fill_default_cylinder(dive, &cyl); @@ -687,7 +687,7 @@ static void cochran_parse_dive(const unsigned char *decode, unsigned mod, dc->model = "Commander"; dc->deviceid = array_uint32_le(buf + 0x31e); // serial no for (g = 0; g < 2; g++) { - cylinder_t cyl = { 0 }; + cylinder_t cyl = empty_cylinder; fill_default_cylinder(dive, &cyl); cyl.gasmix.o2.permille = (log[CMD_O2_PERCENT + g * 2] / 256 + log[CMD_O2_PERCENT + g * 2 + 1]) * 10; @@ -731,7 +731,7 @@ static void cochran_parse_dive(const unsigned char *decode, unsigned mod, dc->model = "EMC"; dc->deviceid = array_uint32_le(buf + 0x31e); // serial no for (g = 0; g < 4; g++) { - cylinder_t cyl = { 0 }; + cylinder_t cyl = empty_cylinder; fill_default_cylinder(dive, &cyl); cyl.gasmix.o2.permille = (log[EMC_O2_PERCENT + g * 2] / 256 -- cgit v1.2.3-70-g09d2