gEDA-user: illegal layer-group string

DJ Delorie dj at delorie.com
Tue Jun 20 17:09:59 EDT 2006


> It appears that the problem is on line 769 of misc.c:
> 
> if (layer > LayerN + MAX (SOLDER_LAYER, COMPONENT_LAYER) ||
> 	      member >= LayerN + 1)
> 		    goto error;
> 	  groupnum[layer] = group;
> 	  LayerGroup->Entries[group][member++] = layer;
> 	  while (*++s && isdigit ((int) *s));
> 
> I'm not familiar with how the flexible layer count patch works.  Is there
> an ultimate limit to the number of layers?

"max_layer" is the current number of layers (and, in theory, layer
groups).

"MAX_LAYER" is the compile-time upper limit to the number of layers.
This is used to declare arrays, for example.

> It appears that groupnum is defined in terms of MAX_LAYER.  Perhaps
> we can simply increment MAX_LAYER and whatever LayerGroup->Entries
> is defined in terms of.  Of course, if there is no longer a
> predetermined hard limit (or any limit at all) then we'll have to do
> something more intelligent...

That function is interesting because it needs to treat "c" and "s"
according to the number of layers the pcb *has*, not MAX_LAYER.
That's why we pass LayerN, it replaces MAX_LAYER for that purpose.  We
also have to defer parsing the grouping string until we know how many
layers the pcb has.

Also check LayerGroupsToString, which converts the groups table to the
string form.


More information about the geda-user mailing list