dive planner fixes [was: Re: source code may be getting a bit intimidating]

Linus Torvalds torvalds at linux-foundation.org
Mon Jan 7 11:52:53 PST 2013


On Mon, Jan 7, 2013 at 11:28 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Sorry, Linus. Please take your drugs. I'm not going of on some totally
> irrelevant tangent. I am pointing out that there is once again an issue
> where I think things get harder because 0/0 is not "unset" but is "gas".

"0/0" is actually disallowed by the parsing (no oxygen). "" would be
unset (and the parsing would consider it 'air', but I agree that the
planning phase should just consider it "same as last gas"). And the
gas parsing actually uses O2_AIR_PERMILLE, not zero *anyway*.

So I don't understand your argument.

The fact that you may not even have parsed anything (or the parse
failed - the validate_gas() function returns a success/error), and
then used the resulting 0 as a gas is just a bug. And I repeat: it has
NOTHING to do with the fact that we consider zero oxygen to be air.

You are totally hung up on the wrong issue, and barking up the wrong
tree. You are using an uninitialized gas value, it's that simple. The
bug is *not* that we assume that a zero oxygen content is air.

This patch kind of shows what *could* be done. Something like it, at
least. But it doesn't populate the gas change events during planning
(again, only after "ok"). It seems to just always use the first gas
for that phase.

          Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 1088 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130107/48c28812/attachment.obj>


More information about the subsurface mailing list