[PATCH] Was Re: Question about ostc code

Salvador Cuñat salvador.cunat at gmail.com
Wed Sep 9 15:58:42 PDT 2015


Good night again, Dirk and Miika.  Good night Guido.

2015-09-09 17:29 GMT+02:00 Miika Turkia <miika.turkia at gmail.com>:
> I am looking at ostc_prepare_data function and do not fully understand
> the code. It looks like in successful case ldc_dat memory allocation
> is freed and we end up pointing to unallocated data in our data
> structures. However, the failure case ends up leaking memory.
>
> Is the attached patch correct or am I missing something? (I have
> nothing to test the code with.)

The patch works, although it changes leak on failure with leak on success.
In fact the full ldc_dat pointer is useless and can be safely removed, it
was a remnant of initial work.  This was the reason you didn't understand
the code.
If you want to test, there are two .dive files included in dives directory.

Please, Dirk, apply the attached patch instead of Miika's one.

2015-09-09 18:54 GMT+02:00 Dirk Hohndel <dirk at hohndel.org>:

> On Wed, Sep 09, 2015 at 07:48:03PM +0300, Guido Lerch wrote:
> >
> > Hi Miika
> > I might have some time to test tomorrow. I have an OSTC 3.
> > Need to figure out first how to apply the patch my testing branch,
> Google will help I suppose.
>
>
Guido, please note that this  has nothing to do with OSTC devices
downloads, it is a tool intended to import dives which have been previously
downloaded from DC using OSTCTools software.  If you want to try the
import, you have to have the .dive files made with said program.
BTW, if you have OSTCTools files of your own, you may find that some dives
from OSTC3 fail in the middle of the profile.  It is due to a problem in
some OSTC 3 firmware versions that H&W corrected some time ago.  OSTCTools
reads the full profile data, but libdivecomputer aborts as it does sanity
checks and detects inconsistent data  (e.g.  216% O2 in the mix).  The
profile needs, in these cases, to be manually fixed changing the damaged
bytes in the .dive file.


> It's pretty easy. Save the email to a file.
>
> git am < file
>
> am literally stands for "apply mail" :-)
>
>
Although Dirk knows light years more about git than I will ever do,  I have
to say that git am /path/to/file.patch  without "<"  works exactly the
same  ;-)

Regards.

Salva.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150910/7e50cf1e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-OSTCTools-remove-useless-pointer-ldc_dat.patch
Type: text/x-diff
Size: 1618 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150910/7e50cf1e/attachment.patch>


More information about the subsurface mailing list