[PATCH] Survive CCR dive logs w/o marked DILUENT/OXYGEN cylinders

Robert C. Helling helling at atdotde.de
Sat Nov 22 12:15:04 PST 2014


On 22 Nov 2014, at 16:54, Giuseppe Bilotta <giuseppe.bilotta at gmail.com> wrote:

Hi,

> Some broken CCR dive logs might not have DILUENT and/or OXYGEN cylinders
> marked as such (see e.g. dives/Poseidon_MkVILog.xml in the repository).
> 
> However, the recent set of CCR patches (and fixes on top of it) caused a
> number of places in the code to break by trying to use negative cylinder
> index.
> 
> Fix this by making sure that a CCR dive has both a DILUENT and an
> OXYGEN cylinder, during the dive computer mixup.


I doubt that this is the correct approach (designate roles to random cylinders). Is is almost always not the correct thing to do.

Better do propper error checking and e.g. simply don’t attempt to plot an o2 pressure line if we don’t have an o2 cylinder. Here is a patch that adds error checking for get_cylinder_idx_by_use() in all places where it is used.

Best
Robert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-error-code-of-get_cylider_idx_by_use.patch
Type: application/octet-stream
Size: 3652 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141122/56c37e47/attachment.obj>
-------------- next part --------------


--                                                                              
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO 
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics  
                      Scientific Coordinator                                   
                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik    
print "Just another   Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339       
    stupid .sig\n";   http://www.atdotde.de 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141122/56c37e47/attachment.sig>


More information about the subsurface mailing list