[PATCH]: Centralising and redefining values as integers (was: centralised definition for surface pressure)
dirk at hohndel.org
Mon Jan 14 20:12:32 PST 2013
Jan Schubert <Jan.Schubert at GMX.li> writes:
> This patch centralizes the definition for surface pressure, oxygen in
> air, (re)defines all such values as plain integers and adapts calculations.
> It eliminates 11 (!) occurrences of definitions for surface pressure and
> also a few for oxygen in air.
> It also rewrites the calculation for EAD, END and EADD using the new
> definitons, harmonizing it for OC and CC and fixes a bug for EADD OC
> And finally it removes the unneeded variable entry_ead in gtk-gui.c.
Thanks for your patience with us :-)
I did make a small midification. This was just too annoying to me:
> diff --git a/planner.c b/planner.c
> index dc5e534..cafaa82 100644
> --- a/planner.c
> +++ b/planner.c
> @@ -909,7 +909,8 @@ void input_plan()
> GtkWidget *planner, *content, *vbox, *hbox, *outervbox, *add_row, *deltat, *label, *surfpres;
> char starttimebuf = "+60:00";
> - char pressurebuf = "1013";
> + char pressurebuf;
> + sprintf(pressurebuf, "%d", SURFACE_PRESSURE);
> if (diveplan.dp)
I instead added another #define for SURFACE_PRESSURE_STRING and
initialied pressurebuf with that.
Finally, I think this is my fault, I may at some point have asked for a
Signed-off-by: line asking for something like "name / email". That was a
rather unfortunate shorthand, as the desired format is actually
First Middle Last <email at domain.tld>
So for you it would be
Signed-off-by: Jan Schubert <Jan.Schubert at GMX.li>
I fixed that in the patch and pushed it.
More information about the subsurface