diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-01-06 19:00:20 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-10 02:37:03 +0900 |
commit | cef30619d0d7296e1730d87dae1c9712ac5cd822 (patch) | |
tree | 655e9c94f0272b38480b6fc6e5734388c5bc9408 /core/cochran.c | |
parent | 4e419f74456bc3ac04e8d8c7550153434e36f475 (diff) | |
download | subsurface-cef30619d0d7296e1730d87dae1c9712ac5cd822.tar.gz |
code cleanup: introduce empty_cylinder constant
This deals with the issue of initializing structs in C++.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/cochran.c')
-rw-r--r-- | core/cochran.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 |