Index: trunk/src/flag.c =================================================================== --- trunk/src/flag.c (revision 37125) +++ trunk/src/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: trunk/src/flag.h =================================================================== --- trunk/src/flag.h (revision 37125) +++ trunk/src/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: trunk/src/globalconst.h =================================================================== --- trunk/src/globalconst.h (revision 37125) +++ trunk/src/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: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 37125) +++ trunk/src/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); Index: trunk/src_plugins/import_netlist/import_netlist.c =================================================================== --- trunk/src_plugins/import_netlist/import_netlist.c (revision 37125) +++ trunk/src_plugins/import_netlist/import_netlist.c (revision 37126) @@ -46,6 +46,7 @@ static pcb_plug_import_t import_netlist; +#define PCB_MAX_NETLIST_LINE_LENGTH 255 /* maximum line length for netlist files */ #define BLANK(x) ((x) == ' ' || (x) == '\t' || (x) == '\n' \ || (x) == '\0') @@ -56,8 +57,8 @@ static int ReadNetlist(const char *filename) { char *command = NULL; - char inputline[RND_MAX_NETLIST_LINE_LENGTH + 1]; - char temp[RND_MAX_NETLIST_LINE_LENGTH + 1]; + char inputline[PCB_MAX_NETLIST_LINE_LENGTH + 1]; + char temp[PCB_MAX_NETLIST_LINE_LENGTH + 1]; FILE *fp; pcb_net_t *net = NULL; int i, j, lines, kind; @@ -101,13 +102,13 @@ * kind = 2 is connection */ kind = 0; - while (fgets(inputline, RND_MAX_NETLIST_LINE_LENGTH, fp)) { + while (fgets(inputline, PCB_MAX_NETLIST_LINE_LENGTH, fp)) { size_t len = strlen(inputline); /* check for maximum length line */ if (len) { if (inputline[--len] != '\n') rnd_message(RND_MSG_ERROR, "Line length (%i) exceeded in netlist file.\n" - "additional characters will be ignored.\n", RND_MAX_NETLIST_LINE_LENGTH); + "additional characters will be ignored.\n", PCB_MAX_NETLIST_LINE_LENGTH); else inputline[len] = '\0'; }