[PATCH 1/2] The 'gasmix' argument to add_segment() is read-only

Linus Torvalds torvalds at linux-foundation.org
Fri Feb 8 00:38:20 PST 2013


From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Fri, 8 Feb 2013 17:15:50 +1100
Subject: [PATCH 1/2] The 'gasmix' argument to add_segment() is read-only

We'll want to use a 'static const' gasmix for the upcoming no-fly-time
code, so prepare for it by just marking the read-only gasmix argument as
'const'.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

This is just a trivial preparatory patch.

 deco.c | 2 +-
 dive.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/deco.c b/deco.c
index 6e73c50cbccf..023a20f72e20 100644
--- a/deco.c
+++ b/deco.c
@@ -126,7 +126,7 @@ static double tissue_tolerance_calc(const struct dive *dive)
 }
 
 /* add period_in_seconds at the given pressure and gas to the deco calculation */
-double add_segment(double pressure, struct gasmix *gasmix, int period_in_seconds, int ccpo2, const struct dive *dive)
+double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, const struct dive *dive)
 {
 	int ci;
 	int fo2 = gasmix->o2.permille ? gasmix->o2.permille : O2_IN_AIR;
diff --git a/dive.h b/dive.h
index 54c4fd47070b..fcbaca7137f2 100644
--- a/dive.h
+++ b/dive.h
@@ -598,7 +598,7 @@ extern void subsurface_command_line_exit(gint *, gchar ***);
 
 #define FRACTION(n,x) ((unsigned)(n)/(x)),((unsigned)(n)%(x))
 
-extern double add_segment(double pressure, struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive);
+extern double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive);
 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, gboolean smooth);
-- 
1.8.1.3.535.ga923c31



More information about the subsurface mailing list