[PATCH] Don't ignore actual diveable mixes

Jef Driesen jef at libdivecomputer.org
Wed Jun 11 04:29:56 PDT 2014


On 2014-06-11 12:01, Anton Lundin wrote:
> On 11 June, 2014 - Jef Driesen wrote:
> 
>> On 2014-06-10 23:00, Anton Lundin wrote:
>> > 		/* Ignore bogus data - libdivecomputer does some crazy stuff */
>> >-		if (o2 + he <= O2_IN_AIR || o2 >= 1000)
>> >+		if (o2 + he <= O2_IN_AIR || o2 > 1000)
>> > 			o2 = 0;
>> >-		if (he < 0 || he >= 800 || o2 + he >= 1000)
>> >+		if (he < 0 || o2 + he > 1000)
>> > 			he = 0;
>> 
>> If you encounter some bogus data, please report this as a 
>> libdivecomputer
>> bug. It's much better to fix the underlying problem (a bug in the
>> libdivecomputer parser), rather than trying to workaround the symptoms 
>> in
>> subsurface.
> 
> This was Linus code that i just make not ignoring real data.
> 
> He might be able to provide you with some clue where this bogus data
> came from.
> 
> CC'ing him here so he might be able to answer, but he is probably quite
> busy at the moment.

I know. That code is already there for quite some time. Seeing your 
commit just reminded me again about it. My only concern here is that if 
subsurface hides such errors, no one will notice, and the underlying bug 
will never get fixed. Anyway, my comment was meant as general advice, 
and not really targeted at you personally.

Jef


More information about the subsurface mailing list