Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 12406) +++ trunk/src/obj_common.h (revision 12407) @@ -130,9 +130,11 @@ pcb_parent_t parent; \ const char *term; \ void *ratconn; \ + unsigned char thermal; \ unsigned char intconn; \ pcb_attribute_list_t Attributes + /* Lines, pads, and rats all use this so they can be cross-cast. */ #define PCB_ANYLINEFIELDS \ PCB_ANYOBJECTFIELDS; \ Index: trunk/src/obj_padstack.c =================================================================== --- trunk/src/obj_padstack.c (revision 12406) +++ trunk/src/obj_padstack.c (revision 12407) @@ -59,7 +59,7 @@ void pcb_padstack_free(pcb_padstack_t *ps) { padstacklist_remove(ps); - free(ps->thermal.shape); + free(ps->thermals.shape); free(ps); } @@ -353,13 +353,13 @@ void pcb_padstack_set_thermal(pcb_padstack_t *ps, unsigned long lid, unsigned char shape) { - if (ps->thermal.used <= lid) { - unsigned long oldu = ps->thermal.used; - ps->thermal.used = lid+1; - ps->thermal.shape = realloc(ps->thermal.shape, ps->thermal.used); - memset(ps->thermal.shape + oldu, 0, ps->thermal.used - oldu - 1); + if (ps->thermals.used <= lid) { + unsigned long oldu = ps->thermals.used; + 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); } - ps->thermal.shape[lid] = shape; + ps->thermals.shape[lid] = shape; } #include "obj_padstack_op.c" Index: trunk/src/obj_padstack.h =================================================================== --- trunk/src/obj_padstack.h (revision 12406) +++ trunk/src/obj_padstack.h (revision 12407) @@ -27,13 +27,15 @@ /* The actual padstack is just a reference to a padstack proto within the same data */ struct pcb_padstack_s { +#define thermal thermal_dont_use PCB_ANYOBJECTFIELDS; +#undef thermal pcb_cardinal_t proto; /* reference to a pcb_padstack_proto_t within pcb_data_t */ pcb_coord_t x, y; struct { unsigned long used; unsigned char *shape; /* indexed by layer ID */ - } thermal; + } thermals; gdl_elem_t link; /* a padstack is in a list in pcb_data_t as a global object */ }; #endif Index: trunk/src/thermal.h =================================================================== --- trunk/src/thermal.h (revision 12406) +++ trunk/src/thermal.h (revision 12407) @@ -34,7 +34,10 @@ PCB_THERMAL_SOLID = 3, /* bit 2: orientation */ - PCB_THERMAL_DIAGONAL = 4 + PCB_THERMAL_DIAGONAL = 4, + + /* bit 3: do we have a thermal at all? */ + PCB_THERMAL_ON = 8 } pcb_thermal_t; pcb_polyarea_t *pcb_thermal_area(pcb_board_t *p, pcb_any_obj_t *obj, pcb_layer_id_t lid); @@ -41,5 +44,4 @@ pcb_polyarea_t *pcb_thermal_area_pin(pcb_board_t *pcb, pcb_pin_t *pin, pcb_layer_id_t lid); pcb_polyarea_t *pcb_thermal_area_line(pcb_board_t *pcb, pcb_line_t *line, pcb_layer_id_t lid); - #endif Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 12406) +++ trunk/src_plugins/io_lihata/read.c (revision 12407) @@ -752,12 +752,12 @@ if ((thl != NULL) && (thl->type == LHT_LIST)) { int n; for(t = thl->data.list.first, n = 0; t != NULL; t = t->next) n++; - ps->thermal.used = n; - ps->thermal.shape = malloc(sizeof(ps->thermal.shape[0]) * n); + ps->thermals.used = n; + ps->thermals.shape = malloc(sizeof(ps->thermals.shape[0]) * n); for(t = thl->data.list.first, n = 0; t != NULL; t = t->next, n++) { int i; parse_int(&i, t); - ps->thermal.shape[n] = i; + ps->thermals.shape[n] = i; } } Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 12406) +++ trunk/src_plugins/io_lihata/write.c (revision 12407) @@ -609,8 +609,8 @@ lht_dom_hash_put(obj, build_textf("x", CFMT, ps->x)); lht_dom_hash_put(obj, build_textf("y", CFMT, ps->y)); lht_dom_hash_put(obj, thr = lht_dom_node_alloc(LHT_LIST, "thermal")); - for(n = 0; n < ps->thermal.used; n++) - lht_dom_list_append(thr, build_textf(NULL, "%d", ps->thermal.shape[n])); + for(n = 0; n < ps->thermals.used; n++) + lht_dom_list_append(thr, build_textf(NULL, "%d", ps->thermals.shape[n])); return obj; }