mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Convert the C code to using stdbool and true/false
Earlier we converted the C++ code to using true/false, and this converts the C code to using the same style. We already depended on stdbool.h in subsurfacestartup.[ch], and we build with -std=gnu99 so nobody could build subsurface without a c99 compiler. [Dirk Hohndel: small change suggested by Thiago Macieira: don't include stdbool.h for C++] Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dca59f06d7
commit
33391a77e9
14 changed files with 131 additions and 147 deletions
|
@ -70,7 +70,7 @@ static bool get_tanksize(device_data_t *devdata, const unsigned char *data, cyli
|
|||
* right data */
|
||||
if (*(uint32_t *)data != 0xFFFEFFFE) {
|
||||
printf("incorrect header for Atomics dive\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
atomics_gas_info = (void*)(data + COBALT_HEADER);
|
||||
switch (atomics_gas_info[idx].tankspecmethod) {
|
||||
|
@ -90,9 +90,9 @@ static bool get_tanksize(device_data_t *devdata, const unsigned char *data, cyli
|
|||
cyl[idx].type.size.mliter = atomics_gas_info[idx].tanksize * 100;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t *parser, int ngases,
|
||||
|
@ -247,15 +247,15 @@ sample_cb(dc_sample_type_t type, dc_sample_value_t value, void *userdata)
|
|||
if (value.deco.type == DC_DECO_NDL) {
|
||||
sample->ndl.seconds = ndl = value.deco.time;
|
||||
sample->stopdepth.mm = stopdepth = value.deco.depth * 1000.0 + 0.5;
|
||||
sample->in_deco = in_deco = FALSE;
|
||||
sample->in_deco = in_deco = false;
|
||||
} else if (value.deco.type == DC_DECO_DECOSTOP ||
|
||||
value.deco.type == DC_DECO_DEEPSTOP) {
|
||||
sample->in_deco = in_deco = TRUE;
|
||||
sample->in_deco = in_deco = true;
|
||||
sample->stopdepth.mm = stopdepth = value.deco.depth * 1000.0 + 0.5;
|
||||
sample->stoptime.seconds = stoptime = value.deco.time;
|
||||
ndl = 0;
|
||||
} else if (value.deco.type == DC_DECO_SAFETYSTOP) {
|
||||
sample->in_deco = in_deco = FALSE;
|
||||
sample->in_deco = in_deco = false;
|
||||
sample->stopdepth.mm = stopdepth = value.deco.depth * 1000.0 + 0.5;
|
||||
sample->stoptime.seconds = stoptime = value.deco.time;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
|
|||
|
||||
/* reset the deco / ndl data */
|
||||
ndl = stoptime = stopdepth = 0;
|
||||
in_deco = FALSE;
|
||||
in_deco = false;
|
||||
|
||||
rc = create_parser(devdata, &parser);
|
||||
if (rc != DC_STATUS_SUCCESS) {
|
||||
|
@ -511,9 +511,9 @@ static int dive_cb(const unsigned char *data, unsigned int size,
|
|||
dive->dc.sample[0].temperature.mkelvin = 0;
|
||||
}
|
||||
|
||||
dive->downloaded = TRUE;
|
||||
dive->downloaded = true;
|
||||
record_dive(dive);
|
||||
mark_divelist_changed(TRUE);
|
||||
mark_divelist_changed(true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue