From 414d7f2632273420aea8e6cb5291a40ea2111d13 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 3 Feb 2017 03:10:57 -0800 Subject: Deal with some of the whitespace issues in planner.c Signed-off-by: Dirk Hohndel --- core/planner.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/core/planner.c b/core/planner.c index 7aea24120..ee8809a89 100644 --- a/core/planner.c +++ b/core/planner.c @@ -411,7 +411,7 @@ struct divedatapoint *plan_add_segment(struct diveplan *diveplan, int duration, struct divedatapoint *dp = create_dp(duration, depth, cylinderid, po2); dp->entered = entered; add_to_end_of_diveplan(diveplan, dp); - return (dp); + return dp; } struct gaschanges { @@ -589,7 +589,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool len += snprintf(buffer + len, sz_buffer - len, "
%s
", translate("gettextFromC", "Subsurface dive plan")); } - + len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "
Runtime: %dmin

"), diveplan_duration(diveplan)); @@ -788,7 +788,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool } while ((dp = nextdp) != NULL); if (!plan_verbatim) len += snprintf(buffer + len, sz_buffer - len, ""); - + /* Print the CNS and OTU next.*/ dive->cns = 0; dive->maxcns = 0; @@ -796,8 +796,8 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool snprintf(temp, sz_temp, "%s", translate("gettextFromC", "CNS")); len += snprintf(buffer + len, sz_buffer - len, "

%s: %i%%", temp, dive->cns); snprintf(temp, sz_temp, "%s", translate("gettextFromC", "OTU")); - len += snprintf(buffer + len, sz_buffer - len, "
%s: %i
", temp, dive->otu); - + len += snprintf(buffer + len, sz_buffer - len, "
%s: %i", temp, dive->otu); + /* Print the settings for the diveplan next. */ if (decoMode() == BUEHLMANN){ snprintf(temp, sz_temp, translate("gettextFromC", "Deco model: Bühlmann ZHL-16C with GFlow = %d and GFhigh = %d"), @@ -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")); else 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 , diveplan->eff_gfhigh); @@ -817,10 +817,10 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool diveplan->gflow, diveplan->gfhigh); } len += snprintf(buffer + len, sz_buffer - len, "

%s
",temp); - + const char *depth_unit; int altitude = (int) get_depth_units((int) (log(1013.0 / diveplan->surface_pressure) * 7800000), NULL, &depth_unit); - + len += snprintf(buffer + len, sz_buffer - len, translate("gettextFromC", "
ATM pressure: %dmbar (%d%s)
"), diveplan->surface_pressure, altitude, @@ -833,11 +833,11 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool bottomsacvalue = get_volume_units(prefs.bottomsac, &sacdecimals, &sacunit); decosacvalue = get_volume_units(prefs.decosac, NULL, NULL); - + /* Reduce number of decimals from 1 to 0 for bar/min, keep 2 for cuft/min */ if (sacdecimals==1) sacdecimals--; - - /* Print the gas consumption next.*/ + + /* Print the gas consumption next.*/ if (dive->dc.divemode == CCR) snprintf(temp, sz_temp, "%s", translate("gettextFromC", "Gas consumption (CCR legs excluded):")); else @@ -1006,7 +1006,7 @@ bool enough_gas(int current_cylinder) if (!cyl->start.mbar) return true; 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 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 */ plan_add_segment(diveplan, transitiontime, 0, current_cylinder, po2, false); create_dive_from_plan(diveplan, is_planner); - return(false); + return false; } #if DEBUG_PLAN & 4 @@ -1126,7 +1126,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool nuclear_regeneration(clock); vpmb_start_gradient(); - if(decoMode() == RECREATIONAL) { + if (decoMode() == RECREATIONAL) { bool safety_stop = prefs.safetystop && max_depth >= 10000; 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? @@ -1177,7 +1177,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool free(stoplevels); free(gaschanges); - return(false); + return false; } 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); clock += this_decotimestep; /* Finish infinite deco */ - if(clock >= 48 * 3600 && depth >= 6000) { + if (clock >= 48 * 3600 && depth >= 6000) { error = LONGDECO; break; } @@ -1402,9 +1402,9 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool } while (!is_final_plan); 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_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); @@ -1474,9 +1474,9 @@ int validate_gas(const char *text, struct gasmix *gas) he = 0; text += strlen(translate("gettextFromC", "air")); } else if (!strcasecmp(text, translate("gettextFromC", "oxygen"))) { - o2 = 1000; - he = 0; - text += strlen(translate("gettextFromC", "oxygen")); + o2 = 1000; + he = 0; + text += strlen(translate("gettextFromC", "oxygen")); } else if (!strncasecmp(text, translate("gettextFromC", "ean"), 3)) { o2 = get_permille(text + 3, &text); he = 0; -- cgit v1.2.3-70-g09d2