Re: Suspicious if/else constructs

2017-11-19 Thread Stefan Fuchs
Hallo Berthold,


Am 19.11.2017 um 13:20 schrieb Berthold Stoeger:
> There is another one that might be of interest to you:
> In core/planner.c, the variable o2break_done is initialized and set, but 
> never 
> actually used.
Thanks again. I - not long ago - changed there s.th. together with
Robert and thought I removed all unused variables but missed this one.

Currently we promised Robert to not touch planner.c and a few other
planner files because he is preparing a larger change there.
So let's try to keep this in mind and fix it later...

Best regards
Stefan

-- 

Stefan Fuchs
E-Mail: sfu...@gmx.de 

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Suspicious if/else constructs

2017-11-19 Thread Dirk Hohndel

> On Nov 19, 2017, at 4:20 AM, Berthold Stoeger  
> wrote:
> 
> The few remaining gcc/g++ -Wall warnings seem all to be either style 
> (operator 
> precedence) or irrelevant precision (weight certainly does not need more than 
> float precision) issues.

Feel free to send patches for the operator precedence issues. I tend to clean 
those
up every now and then, but I'm happy to see others do that as well

/D
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Suspicious if/else constructs

2017-11-19 Thread Berthold Stoeger
Hi Stefan,

On Samstag, 18. November 2017 22:05:59 CET Stefan Fuchs wrote:
> Am 18.11.2017 um 21:50 schrieb Berthold Stoeger:
> > In qt-models/diveplannermodel.cpp:341, the if is indented as if it was
> > part of the outer if. But it isn't owing to missing braces. Since I don't
> > know the meaning of "value", I can't decide in this case...
> 
> Ups, that is a mistake introduced by me - thanks for catching it!
> Correct would be to unindent line 340-342.
> 
> Fell free to correct this otherwise I also can do it (tomorrow)...

There is another one that might be of interest to you:
In core/planner.c, the variable o2break_done is initialized and set, but never 
actually used.

The few remaining gcc/g++ -Wall warnings seem all to be either style (operator 
precedence) or irrelevant precision (weight certainly does not need more than 
float precision) issues.

Berthold
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Suspicious if/else constructs

2017-11-18 Thread Lubomir I. Ivanov
On 18 November 2017 at 23:05, Stefan Fuchs  wrote:
> Hallo Berthold,
>
> Am 18.11.2017 um 21:50 schrieb Berthold Stoeger:
>
> In qt-models/diveplannermodel.cpp:341, the if is indented as if it was part
> of
> the outer if. But it isn't owing to missing braces. Since I don't know the
> meaning of "value", I can't decide in this case...
>
> Ups, that is a mistake introduced by me - thanks for catching it!
> Correct would be to unindent line 340-342.
>
> Fell free to correct this otherwise I also can do it (tomorrow)...
>

Berthold, please add a commit to this PR instead of creating a new one:
https://github.com/Subsurface-divelog/subsurface/pull/836

thanks
lubomir
--
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Re: Suspicious if/else constructs

2017-11-18 Thread Stefan Fuchs
Hallo Berthold,

Am 18.11.2017 um 21:50 schrieb Berthold Stoeger:
> In qt-models/diveplannermodel.cpp:341, the if is indented as if it was part 
> of 
> the outer if. But it isn't owing to missing braces. Since I don't know the 
> meaning of "value", I can't decide in this case...
Ups, that is a mistake introduced by me - thanks for catching it!
Correct would be to unindent line 340-342.

Fell free to correct this otherwise I also can do it (tomorrow)...

Best regards
Stefan

-- 

Stefan Fuchs
E-Mail: sfu...@gmx.de 

___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


Suspicious if/else constructs

2017-11-18 Thread Berthold Stoeger
Dear all,

at the suggestion of Lubomir I compiled with -Wall and I got two g++ warnings, 
which indeed point to two highly suspicious if/else constructs. The first one 
is trivial (PR submited).

For the second one, I simply don't understand the intent of the indent (heh):
In qt-models/diveplannermodel.cpp:341, the if is indented as if it was part of 
the outer if. But it isn't owing to missing braces. Since I don't know the 
meaning of "value", I can't decide in this case...

Berthold
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface