Index: trunk/src/obj_padstack_inlines.h =================================================================== --- trunk/src/obj_padstack_inlines.h (revision 12524) +++ trunk/src/obj_padstack_inlines.h (revision 12525) @@ -37,15 +37,21 @@ } pcb_bb_type_t; /* return the padstack prototype for a padstack reference - returns NULL if not found */ -static inline PCB_FUNC_UNUSED pcb_padstack_proto_t *pcb_padstack_get_proto(pcb_padstack_t *ps) +static inline PCB_FUNC_UNUSED pcb_padstack_proto_t *pcb_padstack_get_proto_(const pcb_data_t *data, pcb_cardinal_t proto) { - if (ps->proto >= ps->parent.data->ps_protos.used) + if (proto >= data->ps_protos.used) return NULL; - if (ps->parent.data->ps_protos.array[ps->proto].in_use == 0) + if (data->ps_protos.array[proto].in_use == 0) return NULL; - return ps->parent.data->ps_protos.array + ps->proto; + return data->ps_protos.array + proto; } +/* return the padstack prototype for a padstack reference - returns NULL if not found */ +static inline PCB_FUNC_UNUSED pcb_padstack_proto_t *pcb_padstack_get_proto(pcb_padstack_t *ps) +{ + return pcb_padstack_get_proto_(ps->parent.data, ps->proto); +} + /* return the type of drill and optionally fill in group IDs of drill ends ; if proto_out is not NULL, also load it with the proto */ static inline PCB_FUNC_UNUSED pcb_bb_type_t pcb_padstack_bbspan(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t *top, pcb_layergrp_id_t *bottom, pcb_padstack_proto_t **proto_out)