mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
4e419f7445
commit
cef30619d0
12 changed files with 18 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue