← Back to team overview

kicad-developers team mailing list archive

Re: [RFC 1/2] New coordinate framework


Hi Wayne,

On 21.11.2018 17:37, Wayne Stambaugh wrote:

> If that is the end
> goal of these changes, I'm all for it.  If not, I would prefer that this
> be part of the redesign.  This should allow us to put the base units in
> a kicad shared object.

Yes, that is the main point of these changes, as well as some more
compile-time error checking.

We should in principle also be able to just switch all the conversion
constants so that the entire code uses nanometers as internal units,
which would be a rather minimal change, but I'm almost certain that
there are some assumptions hidden inside the code still, and making
coordinates effectively incompatible with scalars will force us to visit
every place where constants are defined and explicitly specify a unit
for them.

The other thing it can probably allow us to do is instruct the compiler
to detect coordinate overflows in Debug builds. I've already tried
building the entire program with -ftrapv in order to find the point
where the gtk3/Cairo problem originates, but there are quite a few
places where the code uses integer overflow, so we get a lot of false
positives there — however coordinates should never overflow.


Attachment: signature.asc
Description: OpenPGP digital signature

Follow ups