[PATCH] Wrong maxdepth when splitting dives (WAS Re: 4.5 Beta 3)

Dirk Hohndel dirk at hohndel.org
Mon Oct 5 08:34:13 PDT 2015


On Mon, Oct 05, 2015 at 05:19:35PM +0200, Giorgio Marzano wrote:
> Dirk,
> 
> this patch should fix the wrong values in the max depth field for splitted
> dives.

It does - I already have a more complete patch in my tree but haven't had
a chance to push that out, yet. Sorry about that.

I'll take your patch and refactor mine on top of it :-)

Patch looks good - maybe except for the two consecutive empty lines.
The commit message - I prefer the commit title to be in present tense (but
don't always catch it when people write it in past tense).

Thanks

/D

> 2015-10-04 20:05 GMT+02:00 Dirk Hohndel <dirk at hohndel.org>:
> 
> > On Sun, Oct 04, 2015 at 07:30:39PM +0200, Giorgio Marzano wrote:
> > > Just noticed that split dives seems to have max depth (and i guess some
> > > other field) inherited from original dives.
> >
> > I clearly didn't look closely enough. But that's easy enough to fix.
> >
> > > If the original dive max depth is 20m, then all the resulting "subdives"
> > > seems to be 20m deep in the list and in the "Info" tab, while the plot is
> > > correct.
> >
> > Yeah, we are not clearing some fields that we should clear...
> >
> > /D
> >

> From 0b447d84e58b754594c48efbfa3b30f00a4d3ee0 Mon Sep 17 00:00:00 2001
> From: Giorgio Marzano <marzano.giorgio at gmail.com>
> Date: Mon, 5 Oct 2015 17:13:06 +0200
> Subject: [PATCH 2/2] Fixed wrong max depth value in split dives
> 
> Signed-off-by: Giorgio Marzano <marzano.giorgio at gmail.com>
> ---
>  dive.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/dive.c b/dive.c
> index ea97833..dafc91f 100644
> --- a/dive.c
> +++ b/dive.c
> @@ -2912,6 +2912,12 @@ static int split_dive_at(struct dive *dive, int a, int b)
>  		}
>  	}
>  
> +	dc1->maxdepth.mm=0;
> +	dc2->maxdepth.mm=0;
> +	d1->maxdepth.mm=0;
> +	d2->maxdepth.mm=0;
> +
> +
>  	fixup_dive(d1);
>  	fixup_dive(d2);
>  	if (dive->divetrip) {
> -- 
> 1.9.1
> 



More information about the subsurface mailing list