Re: [Kicad-developers] bug in numeric_evaluator?

2018-03-13 Thread Jeff Young
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. >

Re: [Kicad-developers] bug in numeric_evaluator?

2018-03-13 Thread Michael Geselbracht
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

Re: [Kicad-developers] bug in numeric_evaluator?

2018-03-13 Thread Jeff Young
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

Re: [Kicad-developers] bug in numeric_evaluator?

2018-03-12 Thread Jon Evans
+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

[Kicad-developers] bug in numeric_evaluator?

2018-03-12 Thread Mark Roszko
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 {