[PATCH] Planner notes - revise logic for gasmix output
Robert C. Helling
helling at atdotde.de
Mon Jun 22 22:50:10 PDT 2015
Hi Dirk,
> On 23 Jun 2015, at 02:53, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> I tried to close a few dozen Coverity issues and
> ended up changing some of those very same conditional statements since
> Coverity convinced me that it was possible for nextdp to be NULL...
looks good to me. But I think those tests you inserted are not needed: In particular in the very long in clause, there is early in the long list of ||’s a !dp->next and as there is logic short circuit and the standard says || is evaluated left to right it should be safe to evaluate dp->next right of that statement and it does not have to be tested again.
In my experience with that part of the code, forgetting to test dp->next leads very reliably to crashes (I had forgotten some before) so the fact it does not immediately crash makes me quite confident the above is true ;-)
Best
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150623/2e7a52f3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150623/2e7a52f3/attachment-0001.sig>
More information about the subsurface
mailing list