Index: flag.c =================================================================== --- flag.c (revision 37125) +++ flag.c (revision 37126) @@ -87,12 +87,12 @@ return (memcmp(f1->t, &f2->t, sizeof(f1->t)) == 0); } -const char *pcb_dynflag_cookie[RND_DYNFLAG_BLEN]; +const char *pcb_dynflag_cookie[PCB_DYNFLAG_BLEN]; pcb_dynf_t pcb_dynflag_alloc(const char *cookie) { pcb_dynf_t n; - for(n = 0; n < RND_DYNFLAG_BLEN; n++) { + for(n = 0; n < PCB_DYNFLAG_BLEN; n++) { if (pcb_dynflag_cookie[n] == NULL) { pcb_dynflag_cookie[n] = cookie; return n; @@ -103,7 +103,7 @@ void pcb_dynflag_free(pcb_dynf_t dynf) { - if ((dynf >= 0) && (dynf < RND_DYNFLAG_BLEN)) + if ((dynf >= 0) && (dynf < PCB_DYNFLAG_BLEN)) pcb_dynflag_cookie[dynf] = NULL; } @@ -111,7 +111,7 @@ void pcb_dynflag_uninit(void) { pcb_dynf_t n; - for(n = 0; n < RND_DYNFLAG_BLEN; n++) + for(n = 0; n < PCB_DYNFLAG_BLEN; n++) if (pcb_dynflag_cookie[n] != NULL) fprintf(stderr, "pcb-rnd: Internal error: dynamic flag %d (%s) not unregistered\n", n, pcb_dynflag_cookie[n]); } Index: flag.h =================================================================== --- flag.h (revision 37125) +++ flag.h (revision 37126) @@ -40,8 +40,12 @@ pcb_unknown_flag_t *next; }; +/* number of dynamic flag bits that can be allocated at once; should be n*64 for + memory efficiency */ +#define PCB_DYNFLAG_BLEN 64 + #define PCB_DYNFLAG_WORD unsigned long -#define PCB_DYNFLAG_WLEN ((RND_DYNFLAG_BLEN-1) / sizeof(PCB_DYNFLAG_WORD)+1) +#define PCB_DYNFLAG_WLEN ((PCB_DYNFLAG_BLEN-1) / sizeof(PCB_DYNFLAG_WORD)+1) typedef PCB_DYNFLAG_WORD pcb_dynflag_t[PCB_DYNFLAG_WLEN]; typedef struct { @@ -188,7 +192,7 @@ #define PCB_DFLAG_TEST(flg, dynf) (!!((flg)->df[(dynf) / sizeof(PCB_DYNFLAG_WORD)] & (1 << (dynf) % sizeof(PCB_DYNFLAG_WORD)))) #define PCB_DFLAG_PUT(flg, dynf, val) ((val) ? PCB_DFLAG_SET((flg), (dynf)) : PCB_DFLAG_CLR((flg), (dynf))) -extern const char *pcb_dynflag_cookie[RND_DYNFLAG_BLEN]; +extern const char *pcb_dynflag_cookie[PCB_DYNFLAG_BLEN]; typedef int pcb_dynf_t; #define PCB_DYNF_INVALID (-1) Index: globalconst.h =================================================================== --- globalconst.h (revision 37125) +++ globalconst.h (revision 37126) @@ -31,12 +31,14 @@ #include +#define PCB_MIN_SIZE 0 + #define PCB_MAX_LAYER 38 /* max number of layer, check source code for more changes, a *lot* more changes */ /* new array size that allows substrate layers */ #define PCB_MAX_LAYERGRP ((PCB_MAX_LAYER+8)*2) /* max number of layer groups, a.k.a. physical layers: a few extra outer layers per side, pluse one substrate per real layer */ -#define PCB_MIN_THICKNESS RND_MIN_SIZE +#define PCB_MIN_THICKNESS PCB_MIN_SIZE #define PCB_MAX_THICKNESS RND_MAX_COORD -#define PCB_MIN_ARCRADIUS RND_MIN_SIZE +#define PCB_MIN_ARCRADIUS PCB_MIN_SIZE #define PCB_MAX_ARCRADIUS RND_MAX_COORD #define PCB_MIN_TEXTSCALE 1 /* scaling of text objects in percent (must be an integer greater than 0) */ #define PCB_MAX_TEXTSCALE 10000 Index: search.c =================================================================== --- search.c (revision 37125) +++ search.c (revision 37126) @@ -49,6 +49,9 @@ #include "obj_subc_parent.h" #include "obj_pstk_inlines.h" +#define PCB_MAX_POLYGON_POINT_DISTANCE 0 /* maximum distance when searching polygon points */ +#define PCB_MAX_LINE_POINT_DISTANCE 0 /* maximum distance when searching line points; same for arc point */ + static double PosX, PosY; /* search position for subroutines */ static rnd_coord_t SearchRadius; static rnd_box_t SearchBox; @@ -437,7 +440,7 @@ info.Line = Line; info.Point = Point; *Point = NULL; - info.least = RND_MAX_LINE_POINT_DISTANCE + SearchRadius; + info.least = PCB_MAX_LINE_POINT_DISTANCE + SearchRadius; info.objst = objst; info.req_flag = req_flag; @@ -456,7 +459,7 @@ info.Arc = Arc; info.arc_pt = Point; *Point = NULL; - info.least = RND_MAX_LINE_POINT_DISTANCE + SearchRadius; + info.least = PCB_MAX_LINE_POINT_DISTANCE + SearchRadius; info.objst = objst; info.req_flag = req_flag; @@ -521,7 +524,7 @@ ctx.Polygon = Polygon; ctx.Point = Point; ctx.found = rnd_false;; - ctx.least = SearchRadius + RND_MAX_POLYGON_POINT_DISTANCE; + ctx.least = SearchRadius + PCB_MAX_POLYGON_POINT_DISTANCE; ctx.least = ctx.least * ctx.least; rnd_r_search(SearchLayer->polygon_tree, &SearchBox, NULL, polypoint_callback, &ctx, NULL); @@ -585,7 +588,7 @@ ctx.gfx = gfx; ctx.Point = Point; ctx.found = rnd_false;; - ctx.least = SearchRadius + RND_MAX_POLYGON_POINT_DISTANCE; + ctx.least = SearchRadius + PCB_MAX_POLYGON_POINT_DISTANCE; ctx.least = ctx.least * ctx.least; rnd_r_search(SearchLayer->gfx_tree, &SearchBox, NULL, gfxpoint_callback, &ctx, NULL);