summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-21 10:15:31 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-21 10:16:06 -0700
commitc7d8e72607870fee24fd03df3b54877a80c55102 (patch)
tree939a839df7a5d8441edc278c32b6c1a4dbef9450 /planner.c
parent652f7e9864b5a28ba03bdaa641139230364dae0e (diff)
downloadsubsurface-c7d8e72607870fee24fd03df3b54877a80c55102.tar.gz
Use our pressure type to avoid bar / mbar confusion
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/planner.c b/planner.c
index 0c3d3dc4a..aca5a0594 100644
--- a/planner.c
+++ b/planner.c
@@ -33,7 +33,7 @@ int decostoplevels_imperial[] = { 0, 3048, 6096, 9144, 12192, 15240, 18288, 2133
double plangflow, plangfhigh;
bool plan_verbatim, plan_display_runtime, plan_display_duration, plan_display_transitions;
-int first_stop_pressure;
+pressure_t first_stop_pressure;
const char *disclaimer;
@@ -1119,7 +1119,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
breaktime = -1;
breakcylinder = 0;
o2time = 0;
- first_stop_pressure = 0;
+ first_stop_pressure.mbar = 0;
last_ascend_rate = ascent_velocity(depth, avg_depth, bottom_time);
if ((current_cylinder = get_gasidx(&displayed_dive, &gas)) == -1) {
report_error(translate("gettextFromC", "Can't find gas %s"), gasname(&gas));
@@ -1160,8 +1160,8 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
stopping = true;
// Boyles Law compensation
- if (first_stop_pressure == 0)
- first_stop_pressure = depth_to_mbar(depth, &displayed_dive);
+ if (first_stop_pressure.mbar == 0)
+ first_stop_pressure.mbar = depth_to_mbar(depth, &displayed_dive);
boyles_law(depth_to_mbar(stoplevels[stopidx], &displayed_dive) / 1000.0);
/* Check we need to change cylinder.
@@ -1215,8 +1215,8 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
stopping = true;
// Boyles Law compensation
- if (first_stop_pressure == 0)
- first_stop_pressure = depth_to_mbar(depth, &displayed_dive);
+ if (first_stop_pressure.mbar == 0)
+ first_stop_pressure.mbar = depth_to_mbar(depth, &displayed_dive);
boyles_law(depth_to_mbar(stoplevels[stopidx], &displayed_dive) / 1000.0);
}