From c835cb7b0ee63b664a387af8dd059bccd8ab60e9 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Thu, 27 Aug 2015 14:27:45 +0200
Subject: [PATCH] Rename variable to better reflect what it does

The pressure for the Boyle compensation is of the first ceiling,
i.e. the ceiling seen from the bottom rather than the first
stop.

Signed-off-by: Robert C. Helling <[email protected]>
---
 deco.c    | 8 ++++----
 planner.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/deco.c b/deco.c
index 20d8b04..7a9f33e 100644
--- a/deco.c
+++ b/deco.c
@@ -23,7 +23,7 @@
 
 extern bool in_planner();
 
-extern pressure_t first_stop_pressure;
+extern pressure_t first_ceiling_pressure;
 
 //! Option structure for Buehlmann decompression.
 struct buehlmann_config {
@@ -367,7 +367,7 @@ double solve_cubic2(double B, double C)
 
 double update_gradient(double next_stop_pressure, double first_gradient)
 {
-       double B = cube(first_gradient) / (first_stop_pressure.mbar / 1000.0 + 
first_gradient);
+       double B = cube(first_gradient) / (first_ceiling_pressure.mbar / 1000.0 
+ first_gradient);
        double C = next_stop_pressure * B;
 
        double new_gradient = solve_cubic2(B, C);
@@ -385,10 +385,10 @@ void boyles_law(double next_stop_pressure)
                return;
 
        // This should be a tautology but prevents a numerical instability.
-       if (IS_FP_SAME(next_stop_pressure, first_stop_pressure.mbar / 1000.0))
+       if (IS_FP_SAME(next_stop_pressure, first_ceiling_pressure.mbar / 
1000.0))
                return;
 
-       if (!first_stop_pressure.mbar)
+       if (!first_ceiling_pressure.mbar)
                return;
        for (ci = 0; ci < 16; ++ci) {
                allowable_n2_gradient[ci] = update_gradient(next_stop_pressure, 
bottom_n2_gradient[ci]);
diff --git a/planner.c b/planner.c
index 1dda2f4..ae90938 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;
 
-pressure_t first_stop_pressure;
+pressure_t first_ceiling_pressure;
 
 const char *disclaimer;
 
@@ -1119,9 +1119,9 @@ bool plan(struct diveplan *diveplan, char **cached_datap, 
bool is_planner, bool
                        stopidx++;
                        vpmb_first_stop = stoplevels[stopidx];
                }
-               first_stop_pressure.mbar = depth_to_mbar(vpmb_first_stop, 
&displayed_dive);
+               first_ceiling_pressure.mbar = depth_to_mbar(vpmb_first_stop, 
&displayed_dive);
        } else {
-               first_stop_pressure.mbar = 0;
+               first_ceiling_pressure.mbar = 0;
        }
 
        //CVA
@@ -1143,7 +1143,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, 
bool is_planner, bool
                breaktime = -1;
                breakcylinder = 0;
                o2time = 0;
-               first_stop_pressure.mbar = 
depth_to_mbar(deco_allowed_depth(tissue_tolerance,
+               first_ceiling_pressure.mbar = 
depth_to_mbar(deco_allowed_depth(tissue_tolerance,
                                                                            
diveplan->surface_pressure / 1000.0,
                                                                            
&displayed_dive,
                                                                            1),
-- 
1.9.5 (Apple Git-50.3)


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to