mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
cleanup: fix enum in profile.c
There are two enums related to the type of dive. There is the global enum divemode_t {OC, CCR, PSCR, FREEDIVE, NUM_DIVEMODE, UNDEF_COMP_TYPE}; and the anonymous enum {AIR, NITROX, TRIMIX, FREEDIVING} dive_type; in struct plot_info. In profile.c FREEDIVE (of divemode_t) is assigned to dive_type. This only works because by chance(?) FREEDIVE and FREEDIVING are the fourth element of each enum. Fix this. C truly is a bad language when it comes to types (very weak) and namespaces (non existing). Contains whitespace fix. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1b7daeee22
commit
798e426926
1 changed files with 3 additions and 3 deletions
|
@ -1302,8 +1302,8 @@ void create_plot_info_new(const struct dive *dive, const struct divecomputer *dc
|
||||||
free_plot_info_data(pi);
|
free_plot_info_data(pi);
|
||||||
calculate_max_limits_new(dive, dc, pi, in_planner);
|
calculate_max_limits_new(dive, dc, pi, in_planner);
|
||||||
get_dive_gas(dive, &o2, &he, &o2max);
|
get_dive_gas(dive, &o2, &he, &o2max);
|
||||||
if (dc->divemode == FREEDIVE){
|
if (dc->divemode == FREEDIVE) {
|
||||||
pi->dive_type = FREEDIVE;
|
pi->dive_type = FREEDIVING;
|
||||||
} else if (he > 0) {
|
} else if (he > 0) {
|
||||||
pi->dive_type = TRIMIX;
|
pi->dive_type = TRIMIX;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue