← Back to team overview

kicad-developers team mailing list archive

Re: Function prototypes

 

On 11/01/2013 12:40 AM, Lorenzo Marcantonio wrote:
On Thu, Oct 31, 2013 at 11:24:39PM +0100, Maciej Suminski wrote:
Regarding LAYER_NUMs, if all the code uses LAYER_NUMs, then I do not see a
point in changing that in the contributed part. Again, if you have ready
patches and main developers agree, please go ahead. If you do not want to
spend time on that, then I will take care of introducing the changes.

The reason is another... in my branch I put further the work done on the
LAYER_NUM/LAYER_MSK types; in fact they are not simple ints like in the
main branch but enum (the idea would maybe to promote eventually to
class, someday... look in the list archives). I have some operator
define too, on them (like booleans for LAYER_MSK).

Simply you can't assign an int to an enum without a cast; I call it type
safety, other people there think that's a nuisance and that part was
rejected. OTOH I found a couple of mismatches (like a number assigned to
a mask and vice-versa) that couldn't have been found having everything
as an int around, so I still try to keep maintained the subdivision.


Hi Lorenzo,

As for missing variable names in prototypes in pcb_painter.h, I apologize. We will fix them (I also have a bunch of P&S bugs to fix and feature requests to implement...)

The layer IDs in the VIEW/VIEW_ITEM/PAINTER are a bit more complicated, as the VIEW uses internally more layers than are defined in pcbnew. For example, for each copper layer there is additional label layer with a separate ID, so that toggling label display is simply toggling visibility of a particular layer in a VIEW. We plan to use the VIEW component for eeschema/gerbview in the future, with a different layer set for each application. IMHO a fixed enum type is probably not the best solution here...

Regards,
Tom




Follow ups

References