Coverity cleanups

2015-10-03 Thread Dirk Hohndel
As usual before a release I spent a day trying to clean out all their warnings. A lot of them were clearly false positives, a lot of them were somewhat questionable but I could see at least the theoretical point and added some more checks. And a few real bugs were found. I ignored this last time

[PATCH] Clean up Divesoft Freedome time parsing

2015-10-03 Thread Linus Torvalds
From: Linus Torvalds Date: Sat, 3 Oct 2015 10:29:40 -0400 Subject: [PATCH] Clean up Divesoft Freedome time parsing So Anton Lundin says that the 32-bit timestamp for the Divesoft Freedom is indeed a signed offset from Jan 1, 2000. This does that, but also

Re: [PATCH] Clean up Divesoft Freedome time parsing

2015-10-03 Thread Linus Torvalds
On Oct 3, 2015 11:06, "Anton Lundin" wrote: > > I looked at the wrong typedef and its a uint32_t. Sorry for the mess. Christ. Oh well, fixing up the comment and removing the cast to (signed char) would just fix that. Dirk, did you already apply it? Just edit the patch if not.

Re: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling

2015-10-03 Thread Dirk Hohndel
On Sat, Oct 03, 2015 at 09:38:10AM +0200, Anton Lundin wrote: > On 02 October, 2015 - Linus Torvalds wrote: > > > Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the > > problem when a "unsigned char" is shifted 24 bits left, and becomes a > > "signed int". By casting the result to

Re: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling

2015-10-03 Thread Linus Torvalds
On Oct 3, 2015 7:03 AM, "Dirk Hohndel" wrote: > > Which then means that the old code was actually correct and the fix and > the fix of the fix were actually wrong? Well, the final add (to convert from 2000-based numbers to 1970-based ones) should still be done in timestamp_t.

Re: [PATCH] Clean up Divesoft Freedome time parsing

2015-10-03 Thread Linus Torvalds
On Oct 3, 2015 11:38 AM, "Anton Lundin" wrote: > > It ain't that easy trying to read code and write email while being a > human climbing tree and trying to keep the little one from eating all > every cable. Well, it's unlikely to be a problem. At least for a while. If it's

Re: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling

2015-10-03 Thread Anton Lundin
On 03 October, 2015 - Anton Lundin wrote: > On 02 October, 2015 - Linus Torvalds wrote: > > > Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the > > problem when a "unsigned char" is shifted 24 bits left, and becomes a > > "signed int". By casting the result to uint32_t, that

Re: [PATCH] Clean up Divesoft Freedome time parsing

2015-10-03 Thread Dirk Hohndel
On Sat, Oct 03, 2015 at 10:36:11AM -0400, Linus Torvalds wrote: > > This is a bigger patch than required (it could have just changed the > "uint32_t" into "int32_t"), but I think the code ends up being easier to > read, and it should be as efficient (although because we compile with >

Re: [PATCH] Clean up Divesoft Freedome time parsing

2015-10-03 Thread Anton Lundin
On 03 October, 2015 - Linus Torvalds wrote: > On Oct 3, 2015 11:06, "Anton Lundin" wrote: > > > > I looked at the wrong typedef and its a uint32_t. Sorry for the mess. > > Christ. Don't involve your imaginary friends in this =) It ain't that easy trying to read code and

Re: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling

2015-10-03 Thread Thiago Macieira
On Saturday 03 October 2015 09:38:10 Anton Lundin wrote: > The root bug was mine. Another one of C's wonderful things that i didn't > know about. Yeah... unsigned short us = 0x; unsigned u = 0x; us * us;// this is undefined behaviour u *

Re: [PATCH] Clean up Divesoft Freedome time parsing

2015-10-03 Thread Anton Lundin
On 03 October, 2015 - Linus Torvalds wrote: > > From: Linus Torvalds > Date: Sat, 3 Oct 2015 10:29:40 -0400 > Subject: [PATCH] Clean up Divesoft Freedome time parsing > > So Anton Lundin says that the 32-bit timestamp for the Divesoft Freedom > is indeed a signed

[PATCH 1/2] Revert "VPM-B restore deco state before calculating next gradient"

2015-10-03 Thread Rick Walsh
This reverts commit 3d8e5b638ad4c1fbb43f6dd5f535bf0b33a51f0b. Calculating the next gradient should be based on the tissue loading at the end of the previous iteration, so it was wrong to restore the deco state first. This has a tiny affect on the calculated profile, and makes one of the tests

[PATCH 2/2] VPM-B: Adjust Subsurface conservatism

2015-10-03 Thread Rick Walsh
Reverting commit 3d8e5b638ad4c1fbb43f6dd5f535bf0b33a51f0b makes the CVA calculation marginally less conservative, and one of the tests fails as a result. This tiny adjustment to the conservatism fixes that. Signed-off-by: Rick Walsh --- deco.c | 4 ++-- 1 file changed, 2

Re: [PATCH] Fix 32-bit overflow in Divesoft Freedom time handling

2015-10-03 Thread Anton Lundin
On 02 October, 2015 - Linus Torvalds wrote: > Commit 31fb2e4c62ab ("Avoid possible sign extension") handled the > problem when a "unsigned char" is shifted 24 bits left, and becomes a > "signed int". By casting the result to uint32_t, that signed case won't > happen. > The root bug was mine.