# HG changeset patch # User Mychaela Falconia # Date 1454216569 0 # Node ID ff1d565d233ca49b1ee0f2a858912124c8fb436f # Parent 0444db01fa4a32470dc4def96b56b3d950d8a157 pads2gpcb: handle dummy decals with no pins (found in the E-Sample PCB) diff -r 0444db01fa4a -r ff1d565d233c pads2gpcb/decals.c --- a/pads2gpcb/decals.c Sun Jan 31 03:29:33 2016 +0000 +++ b/pads2gpcb/decals.c Sun Jan 31 05:02:49 2016 +0000 @@ -484,18 +484,6 @@ else num_attr_labels = 0; - /* sanity checks */ - if (fpbody.npins < 1) { - fprintf(stderr, "%s line %d: # of terminals %d < 1\n", - input_filename, input_lineno, fpbody.npins); - exit(1); - } - if (num_padstack_defs < 1) { - fprintf(stderr, "%s line %d: # of pad stack defs %d < 1\n", - input_filename, input_lineno, num_padstack_defs); - exit(1); - } - /* done parsing the header line, initialize some misc */ fpbody.refdes_scale = 100; num_silk_lines = 0; @@ -509,6 +497,23 @@ for (i = 0; i < num_attr_labels; i++) one_attr_label(); + /* deal with dummies */ + if (fpbody.npins == 0 && num_padstack_defs == 0) { + printf("Dummy decal with no pins, skipping\n"); + return; + } + if (fpbody.npins < 1) { + fprintf(stderr, "Error in decal %s: # of terminals %d < 1\n", + current_decal->name, fpbody.npins); + exit(1); + } + if (num_padstack_defs < 1) { + fprintf(stderr, + "Error in decal %s: # of pad stack defs %d < 1\n", + current_decal->name, num_padstack_defs); + exit(1); + } + /* the meat: allocate and fill the pins array */ pins_array = malloc(sizeof(struct footprint_pad) * fpbody.npins); if (!pins_array) {