aboutsummaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-01-15 19:54:41 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 09:34:50 +0700
commit33391a77e9385cf403c2fb1b191b443fcf373294 (patch)
treef6f96b987f90419d4a2d6cfdec2f633d09252a07 /libdivecomputer.c
parentdca59f06d70bd36d10704a08f8444152a82e99b8 (diff)
downloadsubsurface-33391a77e9385cf403c2fb1b191b443fcf373294.tar.gz
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>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 48b8151d2..69fa38c5c 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -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;
}