Deal with some of the whitespace issues in planner.c

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-02-03 03:10:57 -08:00
parent fbaeeec807
commit 414d7f2632

View file

@ -411,7 +411,7 @@ struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration,
struct divedatapoint *dp = create_dp(duration, depth, cylinderid, po2); struct divedatapoint *dp = create_dp(duration, depth, cylinderid, po2);
dp->entered = entered; dp->entered = entered;
add_to_end_of_diveplan(diveplan, dp); add_to_end_of_diveplan(diveplan, dp);
return (dp); return dp;
} }
struct gaschanges { struct gaschanges {
@ -808,7 +808,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
temp_len = snprintf(temp, sz_temp, "%s", translate("gettextFromC", "Deco model: VPM-B at nominal conservatism")); temp_len = snprintf(temp, sz_temp, "%s", translate("gettextFromC", "Deco model: VPM-B at nominal conservatism"));
else else
temp_len = snprintf(temp, sz_temp, translate("gettextFromC", "Deco model: VPM-B at +%d conservatism"), diveplan->vpmb_conservatism); temp_len = snprintf(temp, sz_temp, translate("gettextFromC", "Deco model: VPM-B at +%d conservatism"), diveplan->vpmb_conservatism);
if(diveplan->eff_gflow) if (diveplan->eff_gflow)
temp_len += snprintf(temp + temp_len, sz_temp - temp_len, translate("gettextFromC", ", effective GF=%d/%d"), diveplan->eff_gflow temp_len += snprintf(temp + temp_len, sz_temp - temp_len, translate("gettextFromC", ", effective GF=%d/%d"), diveplan->eff_gflow
, diveplan->eff_gfhigh); , diveplan->eff_gfhigh);
@ -1006,7 +1006,7 @@ bool enough_gas(int current_cylinder)
if (!cyl->start.mbar) if (!cyl->start.mbar)
return true; return true;
if (cyl->type.size.mliter) if (cyl->type.size.mliter)
return (float) (cyl->end.mbar - prefs.reserve_gas) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter; return (float)(cyl->end.mbar - prefs.reserve_gas) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter;
else else
return true; return true;
} }
@ -1089,7 +1089,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
transitiontime = depth / 75; /* this still needs to be made configurable */ transitiontime = depth / 75; /* this still needs to be made configurable */
plan_add_segment(diveplan, transitiontime, 0, current_cylinder, po2, false); plan_add_segment(diveplan, transitiontime, 0, current_cylinder, po2, false);
create_dive_from_plan(diveplan, is_planner); create_dive_from_plan(diveplan, is_planner);
return(false); return false;
} }
#if DEBUG_PLAN & 4 #if DEBUG_PLAN & 4
@ -1126,7 +1126,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
nuclear_regeneration(clock); nuclear_regeneration(clock);
vpmb_start_gradient(); vpmb_start_gradient();
if(decoMode() == RECREATIONAL) { if (decoMode() == RECREATIONAL) {
bool safety_stop = prefs.safetystop && max_depth >= 10000; bool safety_stop = prefs.safetystop && max_depth >= 10000;
track_ascent_gas(depth, &displayed_dive.cylinder[current_cylinder], avg_depth, bottom_time, safety_stop); track_ascent_gas(depth, &displayed_dive.cylinder[current_cylinder], avg_depth, bottom_time, safety_stop);
// How long can we stay at the current depth and still directly ascent to the surface? // How long can we stay at the current depth and still directly ascent to the surface?
@ -1177,7 +1177,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
free(stoplevels); free(stoplevels);
free(gaschanges); free(gaschanges);
return(false); return false;
} }
if (best_first_ascend_cylinder != current_cylinder) { if (best_first_ascend_cylinder != current_cylinder) {
@ -1354,7 +1354,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
this_decotimestep, po2, &displayed_dive, prefs.decosac); this_decotimestep, po2, &displayed_dive, prefs.decosac);
clock += this_decotimestep; clock += this_decotimestep;
/* Finish infinite deco */ /* Finish infinite deco */
if(clock >= 48 * 3600 && depth >= 6000) { if (clock >= 48 * 3600 && depth >= 6000) {
error = LONGDECO; error = LONGDECO;
break; break;
} }
@ -1402,9 +1402,9 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
} while (!is_final_plan); } while (!is_final_plan);
plan_add_segment(diveplan, clock - previous_point_time, 0, current_cylinder, po2, false); plan_add_segment(diveplan, clock - previous_point_time, 0, current_cylinder, po2, false);
if(decoMode() == VPMB) { if (decoMode() == VPMB) {
diveplan->eff_gfhigh = rint(100.0 * regressionb()); diveplan->eff_gfhigh = rint(100.0 * regressionb());
diveplan->eff_gflow = rint(100*(regressiona() * first_stop_depth + regressionb())); diveplan->eff_gflow = rint(100.0 * (regressiona() * first_stop_depth + regressionb()));
} }
create_dive_from_plan(diveplan, is_planner); create_dive_from_plan(diveplan, is_planner);