← Back to team overview

kicad-developers team mailing list archive

Re: Rev 6350, abs vs std::abs

 

Le 07/12/2015 14:28, Chris Pavlina a écrit :
> It is indeed difficult to test an issue that doesn't appear on your
> computer, but from a quick look around, it looks like the correct way
> is to leave std::abs, but add #include <cstdlib>. Unlike stdlib.h,
> cstdlib defines overloads for all the integer widths, reducing the
> possibility of a bad mistake when using it with something longer than
> an int:
> 
> http://www.cplusplus.com/reference/cstdlib/abs/
> 
> Perhaps an oversight on my part not to have included that in the
> first place. Maybe you could give that a try? The usage would be much
> more obvious then.


Looks like including both cstdlib (for ints) and cmath (for floats) is
needed for std::abs.

Fixed now.

Thanks.


-- 
Jean-Pierre CHARRAS


References