diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-08-31 23:25:28 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-31 15:17:39 -0700 |
commit | bd8126a709f81631f949c374f4236861b519ea48 (patch) | |
tree | 78a4e4912b845f7b0b47832b66c77b5064982f67 /dive.h | |
parent | d9306125d97a90b3e589fe263ae08e12b7327773 (diff) | |
download | subsurface-bd8126a709f81631f949c374f4236861b519ea48.tar.gz |
Calculate ceiling only when it is needed
So far, add_segment() returned a tissue tolerance (i.e. ceiling)
computed just in its return statement. This tissue_tolerance
needed to be dragged around until it was needed or be dropped
if not needed at all.
As for VPM-B, this ceiling computation is a bit expensive, this patch
calls the computation function tissue_tolerance_calc() when the
value is actually needed and not before.
This changes the signature of some functions.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -790,16 +790,17 @@ extern void subsurface_command_line_exit(int *, char ***); #define FRACTION(n, x) ((unsigned)(n) / (x)), ((unsigned)(n) % (x)) -extern double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive, int sac); +extern void add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive, int sac); extern void clear_deco(double surface_pressure); extern void dump_tissues(void); extern unsigned int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct dive *dive, bool smooth); extern void set_gf(short gflow, short gfhigh, bool gf_low_at_maxdepth); -extern void cache_deco_state(double, char **datap); -extern double restore_deco_state(char *data); +extern void cache_deco_state(char **datap); +extern void restore_deco_state(char *data); extern void nuclear_regeneration(double time); extern void vpmb_start_gradient(); extern void vpmb_next_gradient(double deco_time, double surface_pressure); +extern double tissue_tolerance_calc(const struct dive *dive, double pressure); /* this should be converted to use our types */ struct divedatapoint { |