Ah, right, I misread it. In the while condition isdigit() and isDecSep() will
both return false for \0 and thereby exit the loop. It’s just a typo
introduced when the new isDecSep() was implemented.
That’s pretty funny that it works.
Thanks for the clarification, Michael.
Cheers,
Jeff.
>
It is a bug/typo that just happens to work. There is no need to check for
\0. There used to be a comparison like "ch == clDecSep". Ugly but it should
be safe for now.
if( isDecSep( ch ) && sepCount )
break;
should do the trick.
- Michael
On Tue, Mar 13, 2018 at 11:10 AM, Jeff Young wrote:
Yuck. It’s clever code all right. The “correct” version would be:
if( !ch || ( isDecSep( ch ) && sepCount ) )
break;
but it’s a whole 3 characters longer. ;)
I’ll fix this in my 6.0 tree (which already has libeval re-formatted to Kicad
standards), but I suggest we leave it sleeping for 5.0
+Michael
This looks like "clever" code so I can't tell if this is a bug or not
without running through a bunch of test cases which I'm not going to do
right now.
Do you see any issues with the operation of the code, Mark, or just the
warning?
-Jon
On Mon, Mar 12, 2018 at 9:28 PM, Mark Roszko wr
Not sure where to even begin looking at libeval since it looks scary but
MSVC complains:
D:\kicad-source-mirror\common\libeval\numeric_evaluator.cpp(216): warning
C4805: '==': unsafe mix of type 'char' and type 'bool' in operation
which is:
auto ch = clToken.input[clToken.pos];
do {
5 matches
Mail list logo