Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 30845) +++ trunk/src/find.c (revision 30846) @@ -31,9 +31,6 @@ #include "undo.h" #include "obj_subc_parent.h" -TODO("find: this is the only non-reentrant part - pass it on!") -pcb_coord_t Bloat = 0; - const pcb_find_t pcb_find0_, *pcb_find0 = &pcb_find0_; #include "find_geo.c" Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 30845) +++ trunk/src/find.h (revision 30846) @@ -43,6 +43,7 @@ typedef struct pcb_find_s pcb_find_t; struct pcb_find_s { /* public config - all-zero uses the original method, except for flag set */ + pcb_coord_t bloat; /* perform intersection tests with one object bloated up by this amount (can be negative for shrinking) */ unsigned stay_layergrp:1; /* do not leave the layer (no padstack hop) */ unsigned allow_noncopper:1; /* also run on non-copper objects */ unsigned list_found:1; /* allow adding objects in the ->found vector */ Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 30845) +++ trunk/src/find_geo.c (revision 30846) @@ -54,6 +54,8 @@ (p)->BoundingBox.Y1 -= Bloat; \ (p)->BoundingBox.Y2 += Bloat;} +#define Bloat ctx->bloat + /* This is required for fullpoly: whether an object bbox intersects a poly bbox can't be determined by a single contour check because there might be multiple contours. Returns 1 if obj bbox intersects any island's bbox */ Index: trunk/src_plugins/query/net_int.c =================================================================== --- trunk/src_plugins/query/net_int.c (revision 30845) +++ trunk/src_plugins/query/net_int.c (revision 30846) @@ -85,9 +85,9 @@ not have enough overlap and shrink disconnected it. */ if (shrink != 0) { ctx.shrunk = 1; - Bloat = -shrink; + ctx.fa.bloat = -shrink; pcb_find_from_obj(&ctx.fa, pcb->Data, from); - Bloat = 0; + ctx.fa.bloat = 0; pcb_find_from_obj(&ctx.fb, pcb->Data, from); pcb_find_free(&ctx.fa); pcb_find_free(&ctx.fb); @@ -98,16 +98,14 @@ not have a connection without the bloat. */ if (bloat != 0) { ctx.shrunk = 0; - Bloat = 0; + ctx.fa.bloat = 0; pcb_find_from_obj(&ctx.fa, pcb->Data, from); - Bloat = bloat; + ctx.fb.bloat = bloat; pcb_find_from_obj(&ctx.fb, pcb->Data, from); pcb_find_free(&ctx.fa); pcb_find_free(&ctx.fb); } - Bloat = 0; - return pcb_false; }