diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-01-15 19:54:41 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-16 09:34:50 +0700 |
commit | 33391a77e9385cf403c2fb1b191b443fcf373294 (patch) | |
tree | f6f96b987f90419d4a2d6cfdec2f633d09252a07 /statistics.c | |
parent | dca59f06d70bd36d10704a08f8444152a82e99b8 (diff) | |
download | subsurface-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 'statistics.c')
-rw-r--r-- | statistics.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/statistics.c b/statistics.c index fbb739791..8277b6469 100644 --- a/statistics.c +++ b/statistics.c @@ -126,7 +126,7 @@ void process_all_dives(struct dive *dive, struct dive **prev_dive) memset(stats_yearly, 0, size); memset(stats_monthly, 0, size); memset(stats_by_trip, 0, size); - stats_yearly[0].is_year = TRUE; + stats_yearly[0].is_year = true; /* this relies on the fact that the dives in the dive_table * are in chronological order */ @@ -147,7 +147,7 @@ void process_all_dives(struct dive *dive, struct dive **prev_dive) if (current_year != tm.tm_year + 1900) { current_year = tm.tm_year + 1900; process_dive(dp, &(stats_yearly[++year_iter])); - stats_yearly[year_iter].is_year = TRUE; + stats_yearly[year_iter].is_year = true; } else { process_dive(dp, &(stats_yearly[year_iter])); } @@ -163,12 +163,12 @@ void process_all_dives(struct dive *dive, struct dive **prev_dive) /* stats_by_trip[0] is all the dives combined */ stats_by_trip[0].selection_size++; process_dive(dp, &(stats_by_trip[0])); - stats_by_trip[0].is_trip = TRUE; + stats_by_trip[0].is_trip = true; stats_by_trip[0].location = strdup("All (by trip stats)"); process_dive(dp, &(stats_by_trip[trip_iter])); stats_by_trip[trip_iter].selection_size++; - stats_by_trip[trip_iter].is_trip = TRUE; + stats_by_trip[trip_iter].is_trip = true; stats_by_trip[trip_iter].location = dp->divetrip->location; } @@ -295,24 +295,24 @@ void get_selected_dives_text(char *buffer, int size) static bool is_gas_used(struct dive *dive, int idx) { struct divecomputer *dc = &dive->dc; - bool firstGasExplicit = FALSE; + bool firstGasExplicit = false; if (cylinder_none(&dive->cylinder[idx])) - return FALSE; + return false; while (dc) { struct event *event = get_next_event(dc->events, "gaschange"); while (event) { if (event->time.seconds < 30) - firstGasExplicit = TRUE; + firstGasExplicit = true; if (get_cylinder_index(dive, event) == idx) - return TRUE; + return true; event = get_next_event(event->next, "gaschange"); } dc = dc->next; } if (idx == 0 && !firstGasExplicit) - return TRUE; - return FALSE; + return true; + return false; } void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]) |