Small temperature import bug

Linus Torvalds torvalds at linux-foundation.org
Sun Feb 17 12:05:08 PST 2013


On Sun, Feb 17, 2013 at 11:47 AM, Henrik Brautaset Aronsen
<subsurface at henrik.synth.no> wrote:
> When I import dives from my Suunto HelO2, temperatures doesn't show up in
> the list of dives.  But if I save and quit, and restart Subsurface again,
> the temperatures show up in the list.

Ahhah!

This might be the cause of the "dives don't merge directly out of the
dive computer" bug too.

We have this oddity in "fixup_dive()" that we fix up the dive water
temperates and durations by looking over all the dive computer data.

But we actually call that *before* we've fixed-up the dive computer
data. So the water temperature is there in the samples, but hasn't
made it to the generic dive computer water temperature yet, so then it
doesn't make it into the dive structure either.

Until the *second* time, when we have load the (partially fixed-up) data.

Anyway, if I'm right, something like the attached (BUT TOTALLY
UNTESTED) patch that simply moves the fixup_dive_dc() code up migth
fix it.

But maybe the fixup_dive_dc() code already relies on some of the
values having been fixed up. That's why I say "totally untested",
there might be some other ordering dependency that I didn't notice.

Dirk? Not-signed-off-yet-due-to-lack-of-testing, but if Henrik acks
it, feel free to add my sign-off.

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


More information about the subsurface mailing list