[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: PCB nanometer git tree



On Fri, Aug 12, 2011 at 11:31:39PM +0200, Karl Hammar wrote:
> Andrew Poelstra:
> > On Thu, Aug 11, 2011 at 09:30:34PM +0200, Karl Hammar wrote:
> ...
> > > -#define LARGE_VALUE            (LONG_MAX / 2 - 1) /* maximum extent of board and elements */
> > > +#define LARGE_VALUE            LONG_MAX /* (LONG_MAX / 2 - 1) maximum extent of board and elements */
> ...
> > > Why do you want to use only half the range?
> >
> > So that the width of a "max width" box can be calculated as
> > LARGE_VALUE - (-LARGE_VALUE) without overflow,
> 
> Hmm, wouldn't it be better to use unsigned here?

No, because we store deltas a lot as Coords. In the .pcb format
the contents of elements (footprints) are stored relative to the
mark, which are often negative.

Ditto for the r/phi display in the GUI. These are all Coord units.

> [snip]
> 
> Isn't that most easily fixed by using a wider type during addition?
> 

Yes, but we might not have a bigger int.

> [snip]
> 
> Well, not any great consern, just thinking aloud.
>

I hope it isn't a great concern. If it is, we will eventually have
to address the issues you raise. 

-- 
Andrew Poelstra
Email: asp11 at sfu.ca OR apoelstra at wpsoftware.net
Web:   http://www.wpsoftware.net/andrew/



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user