← Back to team overview

kicad-developers team mailing list archive

Re: Miscellaneous stuff

 

On Sun, Apr 28, 2013 at 08:09:29AM -0500, Dick Hollenbeck wrote:
> GenDate() is not my function, so I could only offer an opinion but no protective mandate.
>  I am neutral, and to formulate a strong opinion would require a study of its usage, for
> which I do not have the time.

AFAIK mostly reports and sheet border. I'll investigate.

> std::swap seems OK, but it may cost us compile time by bringing in a header or two
> everywhere.  Your template is also OK and perhaps leaner to compile.  Either is superior
> to the macro.

std::swap wouldn't work since there are (harmless) cases in which an int
is swapped with a double. The real question is why degrees are stored as
double and not as int when they are defined in tenth of degree. BTW
std::swap is nearly identical to mine, it only has one template
parameter. Also it has been relocated (from algorithm to utility) in
C++11 so it can give compilation issues.

> Reasoning: we can at least see what is happening.  SAFE_DELETE tells me absolutely
> nothing, other than that my normal delete is not safe, and that is hogwash.

More or less agree with that. I guess it's the idiom for garbage
collected languages to set the reference to nil and send the object to
its death. Need investigations (I think that's probably used not many
times).

> If there is not way to Set the LayerPair, then LayerPair() would also be OK for me.

There is a SetLayerPair, in fact these are the only members using it:P
No problem with Returnxxx, only consistency.

> This is code that I have worked on, don't recall who originally wrote it.  If the
> interface is well defined and the contract of the interface is being met, then I would say
> leave the black box implementation alone, until it stops working.

It's a getter and a setter only, but it breaks the idea of layer identifier. In fact in the whole hierarchy the m_layer contains *the* layer, with the via it contains *stuff*. In the '60 with 36 bit word architectures maybe that was the best thing to do but here it only break a 'type' (for about 4 bytes:D). Anyway I'll keep it here, now it don't harm anyone.

> // when 7000 stops working, ask dick

OK, it's real magic then

> Yes, if that's what the UI guidelines call for, go for it.

Not guidelines, it more spelling... SMD is an acronym so it should be
upcased. Like OK.

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups

References