summaryrefslogtreecommitdiffstats
path: root/subsurface-core/deco.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-23 09:53:44 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-23 09:53:44 -0700
commit22c94a3e6596f04c86d102098e542a88502410a9 (patch)
tree0f75bc7b44a7fe249c3bf4a359d3c91cb179d4aa /subsurface-core/deco.c
parente93c99c8bc9c7ebcc39aa8be16476a794a845636 (diff)
downloadsubsurface-22c94a3e6596f04c86d102098e542a88502410a9.tar.gz
Don't try to force depth to be unsigned
Trying to clean up the signed vs. unsigned issues it becomes clear that forcing depth to be unsigned causes way too many problems in the code. So this commit goes the opposite direction; since we clearly aren't limited INT_MAX vs UINT_MAX, simply make more of the depth related variables signed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/deco.c')
-rw-r--r--subsurface-core/deco.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/subsurface-core/deco.c b/subsurface-core/deco.c
index dff88d338..3cd8c4a16 100644
--- a/subsurface-core/deco.c
+++ b/subsurface-core/deco.c
@@ -34,13 +34,13 @@ extern pressure_t first_ceiling_pressure;
//! Option structure for Buehlmann decompression.
struct buehlmann_config {
- double satmult; //! safety at inert gas accumulation as percentage of effect (more than 100).
- double desatmult; //! safety at inert gas depletion as percentage of effect (less than 100).
- unsigned int last_deco_stop_in_mtr; //! depth of last_deco_stop.
- double gf_high; //! gradient factor high (at surface).
- double gf_low; //! gradient factor low (at bottom/start of deco calculation).
- double gf_low_position_min; //! gf_low_position below surface_min_shallow.
- bool gf_low_at_maxdepth; //! if true, gf_low applies at max depth instead of at deepest ceiling.
+ double satmult; //! safety at inert gas accumulation as percentage of effect (more than 100).
+ double desatmult; //! safety at inert gas depletion as percentage of effect (less than 100).
+ int last_deco_stop_in_mtr; //! depth of last_deco_stop.
+ double gf_high; //! gradient factor high (at surface).
+ double gf_low; //! gradient factor low (at bottom/start of deco calculation).
+ double gf_low_position_min; //! gf_low_position below surface_min_shallow.
+ bool gf_low_at_maxdepth; //! if true, gf_low applies at max depth instead of at deepest ceiling.
};
struct buehlmann_config buehlmann_config = {
@@ -572,9 +572,9 @@ void restore_deco_state(char *data)
memcpy(&ci_pointing_to_guiding_tissue, data, sizeof(int));
}
-unsigned int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct dive *dive, bool smooth)
+int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct dive *dive, bool smooth)
{
- unsigned int depth;
+ int depth;
double pressure_delta;
/* Avoid negative depths */