Index: trunk/src/obj_padstack.c =================================================================== --- trunk/src/obj_padstack.c (revision 12458) +++ trunk/src/obj_padstack.c (revision 12459) @@ -351,15 +351,24 @@ return 0; } -void pcb_padstack_set_thermal(pcb_padstack_t *ps, unsigned long lid, unsigned char shape) +unsigned char *pcb_padstack_get_thermal(pcb_padstack_t *ps, unsigned long lid, pcb_bool_t alloc) { if (ps->thermals.used <= lid) { unsigned long oldu = ps->thermals.used; + if (!alloc) + return NULL; ps->thermals.used = lid+1; ps->thermals.shape = realloc(ps->thermals.shape, ps->thermals.used); - memset(ps->thermals.shape + oldu, 0, ps->thermals.used - oldu - 1); + memset(ps->thermals.shape + oldu, 0, ps->thermals.used - oldu); } - ps->thermals.shape[lid] = shape; + return ps->thermals.shape + lid; } +void pcb_padstack_set_thermal(pcb_padstack_t *ps, unsigned long lid, unsigned char shape) +{ + unsigned char *th = pcb_padstack_get_thermal(ps, lid, 1); + if (th != NULL) + *th = shape; +} + #include "obj_padstack_op.c" Index: trunk/src/obj_padstack.h =================================================================== --- trunk/src/obj_padstack.h (revision 12458) +++ trunk/src/obj_padstack.h (revision 12459) @@ -116,6 +116,7 @@ void pcb_padstack_bbox(pcb_padstack_t *ps); void pcb_padstack_set_thermal(pcb_padstack_t *ps, unsigned long lid, unsigned char shape); +unsigned char *pcb_padstack_get_thermal(pcb_padstack_t *ps, unsigned long lid, pcb_bool_t alloc); /*** proto ***/