Index: autoroute.c =================================================================== --- autoroute.c (revision 31800) +++ autoroute.c (revision 31801) @@ -225,7 +225,7 @@ typedef enum etype { TERM, VIA, VIA_SHADOW, LINE, OTHER, EXPANSION_AREA, PLANE, THERMAL } etype; struct routebox_s { - rnd_rnd_box_t box, sbox; + rnd_box_t box, sbox; struct { rnd_coord_t x1, y1, x2, y2; } line; /* exact coords of the line we are going to draw if type is line; reverse engineering these from the bounding box using halfthick and other hacks lead to rounding errors, a few LSB flicker in coords, e.g. breaking rubber band */ @@ -382,13 +382,13 @@ } routeone_state_t; -static routebox_t *CreateExpansionArea(const rnd_rnd_box_t * area, rnd_cardinal_t group, +static routebox_t *CreateExpansionArea(const rnd_box_t * area, rnd_cardinal_t group, routebox_t * parent, rnd_bool relax_edge_requirements, edge_t * edge); static rnd_heap_cost_t edge_cost(const edge_t * e, const rnd_heap_cost_t too_big); static void best_path_candidate(routeone_state_t *s, edge_t * e, routebox_t * best_target); -static rnd_rnd_box_t edge_to_box(const routebox_t * rb, rnd_direction_t expand_dir); +static rnd_box_t edge_to_box(const routebox_t * rb, rnd_direction_t expand_dir); static void add_or_destroy_edge(routeone_state_t *s, edge_t * e); @@ -457,7 +457,7 @@ return 1; } -int no_planes(const rnd_rnd_box_t * b, void *cl) +int no_planes(const rnd_box_t * b, void *cl) { routebox_t *rb = (routebox_t *) b; if (rb->type == PLANE) @@ -544,7 +544,7 @@ static void init_const_box(routebox_t * rb, rnd_coord_t X1, rnd_coord_t Y1, rnd_coord_t X2, rnd_coord_t Y2, rnd_coord_t clearance) { - rnd_rnd_box_t *bp = (rnd_rnd_box_t *) & rb->box; /* note discarding const! */ + rnd_box_t *bp = (rnd_box_t *) & rb->box; /* note discarding const! */ assert(!rb->flags.inited); assert(X1 <= X2 && Y1 <= Y2); bp->X1 = X1 - clearance; @@ -551,7 +551,7 @@ bp->Y1 = Y1 - clearance; bp->X2 = X2 + clearance; bp->Y2 = Y2 + clearance; - bp = (rnd_rnd_box_t *) & rb->sbox; + bp = (rnd_box_t *) & rb->sbox; bp->X1 = X1; bp->Y1 = Y1; bp->X2 = X2; @@ -559,12 +559,12 @@ rb->flags.inited = 1; } -static inline rnd_rnd_box_t shrink_routebox(const routebox_t * rb) +static inline rnd_box_t shrink_routebox(const routebox_t * rb) { return rb->sbox; } -static inline rnd_heap_cost_t box_area(const rnd_rnd_box_t b) +static inline rnd_heap_cost_t box_area(const rnd_box_t b) { rnd_heap_cost_t ans = b.X2 - b.X1; return ans * (b.Y2 - b.Y1); @@ -577,7 +577,7 @@ static inline rnd_bool point_in_shrunk_box(const routebox_t * box, rnd_coord_t X, rnd_coord_t Y) { - rnd_rnd_box_t b = shrink_routebox(box); + rnd_box_t b = shrink_routebox(box); return rnd_point_in_box(&b, X, Y); } @@ -783,16 +783,16 @@ } struct rb_info { - rnd_rnd_box_t query; + rnd_box_t query; routebox_t *winner; jmp_buf env; }; -static rnd_r_dir_t __found_one_on_lg(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t __found_one_on_lg(const rnd_box_t * box, void *cl) { struct rb_info *inf = (struct rb_info *) cl; routebox_t *rb = (routebox_t *) box; - rnd_rnd_box_t sb; + rnd_box_t sb; if (rb->flags.nonstraight) return RND_R_DIR_NOT_FOUND; @@ -1105,7 +1105,7 @@ static routedata_t *CreateRouteData() { vtp0_t layergroupboxes[PCB_MAX_LAYERGRP]; - rnd_rnd_box_t bbox; + rnd_box_t bbox; routedata_t *rd; int group, i; @@ -1196,7 +1196,7 @@ for (i = 0; i < pcb_max_group(PCB); i++) { /* create the r-tree */ rd->layergrouptree[i] = rnd_r_create_tree(); - rnd_r_insert_array(rd->layergrouptree[i], (const rnd_rnd_box_t **) layergroupboxes[i].array, vtp0_len(&layergroupboxes[i])); + rnd_r_insert_array(rd->layergrouptree[i], (const rnd_box_t **) layergroupboxes[i].array, vtp0_len(&layergroupboxes[i])); } if (AutoRouteParameters.use_vias) { @@ -1298,7 +1298,7 @@ /* return the minimum *cost* from a point to a box on any layer. * It's safe to return a smaller than minimum cost */ -static rnd_heap_cost_t pcb_cost_to_layerless_box(const rnd_cheap_point_t * p, rnd_cardinal_t point_layer, const rnd_rnd_box_t * b) +static rnd_heap_cost_t pcb_cost_to_layerless_box(const rnd_cheap_point_t * p, rnd_cardinal_t point_layer, const rnd_box_t * b) { rnd_cheap_point_t p2 = rnd_closest_cheap_point_in_box(p, b); register rnd_heap_cost_t c1, c2; @@ -1351,9 +1351,9 @@ } -static rnd_rnd_box_t bloat_routebox(routebox_t * rb) +static rnd_box_t bloat_routebox(routebox_t * rb) { - rnd_rnd_box_t r; + rnd_box_t r; rnd_coord_t clearance; assert(__routepcb_box_is_good(rb)); @@ -1373,7 +1373,7 @@ typedef short pcb_dimension_t; /* makes a line on the solder layer silk surrounding the box */ -static void showbox(rnd_rnd_box_t b, pcb_dimension_t thickness, int group) +static void showbox(rnd_box_t b, pcb_dimension_t thickness, int group) { pcb_line_t *line; pcb_layer_t *csl, *SLayer = pcb_get_layer(PCB->Data, group); @@ -1419,7 +1419,7 @@ #if defined(ROUTE_DEBUG) static void showedge(edge_t * e) { - rnd_rnd_box_t *b = (rnd_rnd_box_t *) e->rb; + rnd_box_t *b = (rnd_box_t *) e->rb; if (ddraw == NULL) return; @@ -1536,7 +1536,7 @@ routebox_t *nearest; rnd_heap_cost_t nearest_cost; }; -static rnd_r_dir_t __region_within_guess(const rnd_rnd_box_t * region, void *cl) +static rnd_r_dir_t __region_within_guess(const rnd_box_t * region, void *cl) { struct minpcb_cost_target_closure *mtc = (struct minpcb_cost_target_closure *) cl; rnd_heap_cost_t pcb_cost_to_region; @@ -1550,7 +1550,7 @@ return (pcb_cost_to_region < mtc->nearest_cost) ? RND_R_DIR_FOUND_CONTINUE : RND_R_DIR_NOT_FOUND; } -static rnd_r_dir_t __found_new_guess(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t __found_new_guess(const rnd_box_t * box, void *cl) { struct minpcb_cost_target_closure *mtc = (struct minpcb_cost_target_closure *) cl; routebox_t *guess = (routebox_t *) box; @@ -1632,7 +1632,7 @@ static edge_t *CreateEdge2(routebox_t * rb, rnd_direction_t expand_dir, edge_t * previous_edge, rnd_rtree_t * targets, routebox_t * guess) { - rnd_rnd_box_t thisbox; + rnd_box_t thisbox; rnd_cheap_point_t thiscost, prevcost; rnd_heap_cost_t d; @@ -1653,7 +1653,7 @@ } /* create via edge, using previous edge to fill in defaults. */ -static edge_t *CreateViaEdge(const rnd_rnd_box_t * area, rnd_cardinal_t group, +static edge_t *CreateViaEdge(const rnd_box_t * area, rnd_cardinal_t group, routebox_t * parent, edge_t * previous_edge, conflict_t to_site_conflict, conflict_t through_site_conflict, rnd_rtree_t * targets) { @@ -1719,7 +1719,7 @@ * it will become available if the conflict is elliminated. * That is why we ignore the interior_edge argument. */ -static edge_t *CreateEdgeWithConflicts(const rnd_rnd_box_t * interior_edge, +static edge_t *CreateEdgeWithConflicts(const rnd_box_t * interior_edge, routebox_t * container, edge_t * previous_edge, rnd_heap_cost_t cost_penalty_to_box, rnd_rtree_t * targets) { @@ -1779,9 +1779,9 @@ /* given an edge of a box, return a box containing exactly the points on that * edge. Note that the return box is treated as closed; that is, the bottom and * right "edges" consist of points (just barely) not in the (half-open) box. */ -static rnd_rnd_box_t edge_to_box(const routebox_t * rb, rnd_direction_t expand_dir) +static rnd_box_t edge_to_box(const routebox_t * rb, rnd_direction_t expand_dir) { - rnd_rnd_box_t b = shrink_routebox(rb); + rnd_box_t b = shrink_routebox(rb); /* narrow box down to just the appropriate edge */ switch (expand_dir) { case RND_NORTH: @@ -1804,13 +1804,13 @@ } struct broken_boxes { - rnd_rnd_box_t left, center, right; + rnd_box_t left, center, right; rnd_bool is_valid_left, is_valid_center, is_valid_right; }; -static struct broken_boxes break_box_edge(const rnd_rnd_box_t * original, rnd_direction_t which_edge, routebox_t * breaker) +static struct broken_boxes break_box_edge(const rnd_box_t * original, rnd_direction_t which_edge, routebox_t * breaker) { - rnd_rnd_box_t origbox, breakbox; + rnd_box_t origbox, breakbox; struct broken_boxes result; assert(original && breaker); @@ -1845,7 +1845,7 @@ } #ifndef NDEBUG -static int share_edge(const rnd_rnd_box_t * child, const rnd_rnd_box_t * parent) +static int share_edge(const rnd_box_t * child, const rnd_box_t * parent) { return (child->X1 == parent->X2 || child->X2 == parent->X1 || @@ -1853,7 +1853,7 @@ ((parent->X1 <= child->X1 && child->X2 <= parent->X2) || (parent->Y1 <= child->Y1 && child->Y2 <= parent->Y2)); } -static int edge_intersect(const rnd_rnd_box_t * child, const rnd_rnd_box_t * parent) +static int edge_intersect(const rnd_box_t * child, const rnd_box_t * parent) { return (child->X1 <= parent->X2) && (child->X2 >= parent->X1) && (child->Y1 <= parent->Y2) && (child->Y2 >= parent->Y1); } @@ -1863,7 +1863,7 @@ * immediately preceding expansion area, for backtracing. 'lastarea' is * the last expansion area created, we string these together in a loop * so we can remove them all easily at the end. */ -static routebox_t *CreateExpansionArea(const rnd_rnd_box_t * area, rnd_cardinal_t group, +static routebox_t *CreateExpansionArea(const rnd_box_t * area, rnd_cardinal_t group, routebox_t * parent, rnd_bool relax_edge_requirements, edge_t * src_edge) { routebox_t *rb = (routebox_t *) malloc(sizeof(*rb)); @@ -1876,7 +1876,7 @@ #ifndef NDEBUG { /* work around rounding errors: grow both boxes by 2 nm */ - rnd_rnd_box_t b1 = rb->sbox, b2 = parent->sbox; + rnd_box_t b1 = rb->sbox, b2 = parent->sbox; b1.X1--;b1.Y1--;b1.X2++;b1.Y2++; b2.X1--;b2.Y1--;b2.X2++;b2.Y2++; assert(relax_edge_requirements ? rnd_box_intersect(&b1, &b2) @@ -1911,7 +1911,7 @@ routebox_t *parent; routebox_t *n, *e, *s, *w; rnd_coord_t keep, bloat; - rnd_rnd_box_t inflated, orig; + rnd_box_t inflated, orig; int done; }; @@ -1921,11 +1921,11 @@ * like it wouldn't be seen. We do this while keep the inflated * box as large as possible. */ -static rnd_r_dir_t __Expand_this_rect(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t __Expand_this_rect(const rnd_box_t * box, void *cl) { struct E_result *res = (struct E_result *) cl; routebox_t *rb = (routebox_t *) box; - rnd_rnd_box_t rbox; + rnd_box_t rbox; rnd_coord_t dn, de, ds, dw, bloat; /* we don't see conflicts already encountered */ @@ -2061,7 +2061,7 @@ * looks past the clearance to see these targets even though they * weren't actually touched in the expansion. */ -struct E_result *Expand(rnd_rtree_t * rtree, edge_t * e, const rnd_rnd_box_t * box) +struct E_result *Expand(rnd_rtree_t * rtree, edge_t * e, const rnd_box_t * box) { static struct E_result ans; int noshrink; /* bit field of which edges to not shrink */ @@ -2203,9 +2203,9 @@ * It returns 1 for any fixed blocker that is not part * of this net and zero otherwise. */ -static int blocker_to_heap(rnd_heap_t * heap, routebox_t * rb, rnd_rnd_box_t * box, rnd_direction_t dir) +static int blocker_to_heap(rnd_heap_t * heap, routebox_t * rb, rnd_box_t * box, rnd_direction_t dir) { - rnd_rnd_box_t b = rb->sbox; + rnd_box_t b = rb->sbox; if (rb->style->Clearance > AutoRouteParameters.style->Clearance) b = rnd_bloat_box(&b, rb->style->Clearance - AutoRouteParameters.style->Clearance); b = rnd_clip_box(&b, box); @@ -2240,7 +2240,7 @@ * (more commonly) create a supper-thin box to provide a * home for an expansion edge. */ -static routebox_t *CreateBridge(const rnd_rnd_box_t * area, routebox_t * parent, rnd_direction_t dir) +static routebox_t *CreateBridge(const rnd_box_t * area, routebox_t * parent, rnd_direction_t dir) { routebox_t *rb = (routebox_t *) malloc(sizeof(*rb)); memset((void *) rb, 0, sizeof(*rb)); @@ -2268,12 +2268,12 @@ * starting box, direction and blocker if any. */ void -moveable_edge(vector_t * result, const rnd_rnd_box_t * box, rnd_direction_t dir, +moveable_edge(vector_t * result, const rnd_box_t * box, rnd_direction_t dir, routebox_t * rb, routebox_t * blocker, edge_t * e, rnd_rtree_t * targets, routeone_state_t *s, rnd_rtree_t * tree, vector_t * area_vec) { - rnd_rnd_box_t b; + rnd_box_t b; assert(rnd_box_is_good(box)); b = *box; /* for the cardinal directions, move the box to overlap the @@ -2451,16 +2451,16 @@ struct break_info { rnd_heap_t *heap; routebox_t *parent; - rnd_rnd_box_t box; + rnd_box_t box; rnd_direction_t dir; rnd_bool ignore_source; }; -static rnd_r_dir_t __GatherBlockers(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t __GatherBlockers(const rnd_box_t * box, void *cl) { routebox_t *rb = (routebox_t *) box; struct break_info *bi = (struct break_info *) cl; - rnd_rnd_box_t b; + rnd_box_t b; if (bi->parent == rb || rb->flags.touched || bi->parent->parent.expansion_area == rb) return RND_R_DIR_NOT_FOUND; @@ -2480,9 +2480,9 @@ * i.e. if dir is SOUTH, then this means fixing up an EAST leftover * edge, which would be the southern most edge for that example. */ -static inline rnd_rnd_box_t previous_edge(rnd_coord_t last, rnd_direction_t i, const rnd_rnd_box_t * b) +static inline rnd_box_t previous_edge(rnd_coord_t last, rnd_direction_t i, const rnd_box_t * b) { - rnd_rnd_box_t db = *b; + rnd_box_t db = *b; switch (i) { case RND_EAST: db.X1 = last; @@ -2535,7 +2535,7 @@ * we still need to break portions of all 4 edges */ if (e->expand_dir == RND_NE || e->expand_dir == RND_SE || e->expand_dir == RND_SW || e->expand_dir == RND_NW) { - rnd_rnd_box_t *fb = (rnd_rnd_box_t *) & fake.sbox; + rnd_box_t *fb = (rnd_box_t *) & fake.sbox; memset(&fake, 0, sizeof(fake)); *fb = e->rb->sbox; fake.flags.fixed = 1; /* this stops expansion there */ @@ -2544,7 +2544,7 @@ #ifndef NDEBUG /* the routbox_is_good checker wants a lot more! */ fake.flags.inited = 1; - fb = (rnd_rnd_box_t *) & fake.box; + fb = (rnd_box_t *) & fake.box; *fb = e->rb->sbox; fake.same_net.next = fake.same_net.prev = &fake; fake.same_subnet.next = fake.same_subnet.prev = &fake; @@ -2639,7 +2639,7 @@ * heap loop because it is special; it can be part of a corner */ routebox_t *blk = (routebox_t *) rnd_heap_remove_smallest(heap[dir]); - rnd_rnd_box_t b = rb->sbox; + rnd_box_t b = rb->sbox; struct broken_boxes broke = break_box_edge(&b, dir, blk); if (broke.is_valid_left) { /* if last > 0, then the previous edge had a segment @@ -2647,7 +2647,7 @@ */ if (last > 0) { /* make a corner expansion */ - rnd_rnd_box_t db = b; + rnd_box_t db = b; switch (dir) { case RND_EAST: /* possible NE expansion */ @@ -2689,7 +2689,7 @@ * in the direction of the previous edge, * which it belongs to. */ - rnd_rnd_box_t db = previous_edge(last, dir, &rb->sbox); + rnd_box_t db = previous_edge(last, dir, &rb->sbox); moveable_edge(edges, &db, (rnd_direction_t) (dir - 1), rb, NULL, e, targets, s, NULL, NULL); } if (broke.is_valid_center && !blk->flags.source) @@ -2743,7 +2743,7 @@ if (last > 0) { /* expand the leftover from the prior direction */ - rnd_rnd_box_t db = previous_edge(last, dir, &rb->sbox); + rnd_box_t db = previous_edge(last, dir, &rb->sbox); moveable_edge(edges, &db, (rnd_direction_t) (dir - 1), rb, NULL, e, targets, s, NULL, NULL); } last = -1; @@ -2751,7 +2751,7 @@ } /* for loop */ /* finally, check for the NW corner now that we've come full circle */ if (first > 0 && last > 0) { - rnd_rnd_box_t db = rb->sbox; + rnd_box_t db = rb->sbox; db.X2 = first; db.Y2 = last; moveable_edge(edges, &db, RND_NW, rb, NULL, e, targets, s, NULL, NULL); @@ -2758,12 +2758,12 @@ } else { if (first > 0) { - rnd_rnd_box_t db = rb->sbox; + rnd_box_t db = rb->sbox; db.X2 = first; moveable_edge(edges, &db, RND_NORTH, rb, NULL, e, targets, s, NULL, NULL); } else if (last > 0) { - rnd_rnd_box_t db = rb->sbox; + rnd_box_t db = rb->sbox; db.Y2 = last; moveable_edge(edges, &db, RND_WEST, rb, NULL, e, targets, s, NULL, NULL); } @@ -2789,15 +2789,15 @@ /* ------------ */ struct foib_info { - const rnd_rnd_box_t *box; + const rnd_box_t *box; routebox_t *intersect; jmp_buf env; }; -static rnd_r_dir_t foib_rect_in_reg(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t foib_rect_in_reg(const rnd_box_t * box, void *cl) { struct foib_info *foib = (struct foib_info *) cl; - rnd_rnd_box_t rbox; + rnd_box_t rbox; routebox_t *rb = (routebox_t *) box; if (rb->flags.touched) return RND_R_DIR_NOT_FOUND; @@ -2815,7 +2815,7 @@ static routebox_t *FindOneInBox(rnd_rtree_t * rtree, routebox_t * rb) { struct foib_info foib; - rnd_rnd_box_t r; + rnd_box_t r; r = rb->sbox; foib.box = &r; @@ -2828,14 +2828,14 @@ struct therm_info { routebox_t *plane; - rnd_rnd_box_t query; + rnd_box_t query; jmp_buf env; }; -static rnd_r_dir_t ftherm_rect_in_reg(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t ftherm_rect_in_reg(const rnd_box_t * box, void *cl) { routebox_t *rbox = (routebox_t *) box; struct therm_info *ti = (struct therm_info *) cl; - rnd_rnd_box_t sq, sb; + rnd_box_t sq, sb; if (rbox->type != TERM) return RND_R_DIR_NOT_FOUND; @@ -3066,7 +3066,7 @@ static rnd_bool RD_DrawManhattanLine(routedata_t * rd, - const rnd_rnd_box_t * box1, const rnd_rnd_box_t * box2, + const rnd_box_t * box1, const rnd_box_t * box2, rnd_cheap_point_t start, rnd_cheap_point_t end, rnd_coord_t halfthick, rnd_cardinal_t group, routebox_t * subnet, rnd_bool is_bad, rnd_bool last_was_x) { @@ -3123,7 +3123,7 @@ /* for smoothing, don't pack traces to min clearance gratuitously */ #if 0 -static void add_clearance(rnd_cheap_point_t * nextpoint, const rnd_rnd_box_t * b) +static void add_clearance(rnd_cheap_point_t * nextpoint, const rnd_box_t * b) { if (nextpoint->X == b->X1) { if (nextpoint->X + AutoRouteParameters.style->Clearance < (b->X1 + b->X2) / 2) @@ -3171,7 +3171,7 @@ rnd_coord_t radius = HALF_THICK(AutoRouteParameters.style->Diameter); rnd_cheap_point_t lastpoint, nextpoint; routebox_t *lastpath; - rnd_rnd_box_t b; + rnd_box_t b; assert(subnet->style == AutoRouteParameters.style); /*XXX: because we round up odd thicknesses, there's the possibility that @@ -3327,7 +3327,7 @@ routebox_t * rb, conflict_t conflict, rnd_rtree_t * targets, rnd_bool in_plane) { routebox_t *target; - rnd_rnd_box_t b; + rnd_box_t b; rnd_heap_cost_t cost; assert(__routepcb_box_is_good(rb)); /* find the cheapest target */ @@ -3408,7 +3408,7 @@ { rnd_coord_t radius, clearance; vetting_t *work; - rnd_rnd_box_t region = shrink_routebox(within); + rnd_box_t region = shrink_routebox(within); rnd_shrink_box(®ion, shrink); radius = HALF_THICK(AutoRouteParameters.style->Diameter); @@ -3452,8 +3452,8 @@ i == LO_CONFLICT ? vss->lo_conflict_space_vec : i == HI_CONFLICT ? vss->hi_conflict_space_vec : NULL); assert(v); while (!vector_is_empty(v)) { - rnd_rnd_box_t cliparea; - rnd_rnd_box_t *area = (rnd_rnd_box_t *) vector_remove_last(v); + rnd_box_t cliparea; + rnd_box_t *area = (rnd_box_t *) vector_remove_last(v); if (!(i == NO_CONFLICT || AutoRouteParameters.with_conflicts)) { free(area); continue; @@ -3569,7 +3569,7 @@ #endif -static rnd_r_dir_t __conflict_source(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t __conflict_source(const rnd_box_t * box, void *cl) { routebox_t *rb = (routebox_t *) box; if (rb->flags.touched || rb->flags.fixed) @@ -3603,7 +3603,7 @@ routeone_status_t result; routebox_t *p; int seen, i; - const rnd_rnd_box_t **target_list; + const rnd_box_t **target_list; int num_targets; rnd_rtree_t *targets; /* vector of source edges for filtering */ @@ -3681,7 +3681,7 @@ assert(!from->flags.target); assert(num_targets > 0); /* create list of target pointers and from that a r-tree of targets */ - target_list = (const rnd_rnd_box_t **) malloc(num_targets * sizeof(*target_list)); + target_list = (const rnd_box_t **) malloc(num_targets * sizeof(*target_list)); i = 0; LIST_LOOP(from, same_net, p); if (p->flags.target) { @@ -3692,7 +3692,7 @@ } PCB_END_LOOP; targets = rnd_r_create_tree(); - rnd_r_insert_array(targets, (const rnd_rnd_box_t **)target_list, i); + rnd_r_insert_array(targets, (const rnd_box_t **)target_list, i); assert(i <= num_targets); free(target_list); @@ -3707,7 +3707,7 @@ if (p->flags.source && is_layer_group_active[p->group]) { rnd_cheap_point_t cp; edge_t *e; - rnd_rnd_box_t b = shrink_routebox(p); + rnd_box_t b = shrink_routebox(p); #if defined(ROUTE_DEBUG) && defined(DEBUG_SHOW_SOURCES) showroutebox(p); @@ -3790,7 +3790,7 @@ if (e->rb->type == PLANE) { routebox_t *pin = FindThermable(targets, e->rb); if (pin) { - rnd_rnd_box_t b = shrink_routebox(pin); + rnd_box_t b = shrink_routebox(pin); edge_t *ne; routebox_t *nrb; assert(pin->flags.target); @@ -3833,7 +3833,7 @@ /* we have hit a plane */ edge_t *ne; routebox_t *nrb; - rnd_rnd_box_t b = shrink_routebox(e->rb); + rnd_box_t b = shrink_routebox(e->rb); /* limit via region to that inside the plane */ rnd_clip_box(&b, &intersecting->sbox); nrb = CreateExpansionArea(&b, e->rb->group, e->rb, rnd_true, e); @@ -3862,7 +3862,7 @@ goto dontexpand; else if (0) { /* XXX: disabling this causes no via collisions. */ - rnd_rnd_box_t a = bloat_routebox(intersecting), b; + rnd_box_t a = bloat_routebox(intersecting), b; edge_t *ne; int i, j; /* something intersects this via candidate. split via candidate @@ -3935,7 +3935,7 @@ if (1) { routebox_t *nrb; struct E_result *ans; - rnd_rnd_box_t b; + rnd_box_t b; vector_t *broken; if (e->flags.is_interior) { assert(AutoRouteParameters.with_conflicts); /* no interior edges unless @@ -4108,7 +4108,7 @@ } #ifndef NDEBUG -rnd_r_dir_t bad_boy(const rnd_rnd_box_t * b, void *cl) +rnd_r_dir_t bad_boy(const rnd_box_t * b, void *cl) { routebox_t *box = (routebox_t *) b; if (box->type == EXPANSION_AREA) @@ -4119,7 +4119,7 @@ rnd_bool no_expansion_boxes(routedata_t * rd) { int i; - rnd_rnd_box_t big; + rnd_box_t big; big.X1 = 0; big.X2 = RND_MAX_COORD; big.Y1 = 0; @@ -4148,7 +4148,7 @@ } } -static rnd_r_dir_t ripout_livedraw_obj_cb(const rnd_rnd_box_t * b, void *cl) +static rnd_r_dir_t ripout_livedraw_obj_cb(const rnd_box_t * b, void *cl) { routebox_t *box = (routebox_t *) b; ripout_livedraw_obj(box); @@ -4207,7 +4207,7 @@ LIST_LOOP(rd->first_net, different_net, net); { double area; - rnd_rnd_box_t bb = shrink_routebox(net); + rnd_box_t bb = shrink_routebox(net); LIST_LOOP(net, same_net, p); { RND_MAKE_MIN(bb.X1, p->sbox.X1); @@ -4323,7 +4323,7 @@ LIST_LOOP(net, same_net, p); { #ifdef NET_HEAP - rnd_rnd_box_t b = shrink_routebox(p); + rnd_box_t b = shrink_routebox(p); /* using a heap allows us to start from smaller objects and * end at bigger ones. also prefer to start at planes, then pads */ rnd_heap_insert(net_heap, (float) (b.X2 - b.X1) * @@ -4448,7 +4448,7 @@ jmp_buf env; }; -static rnd_r_dir_t fpstk_rect(const rnd_rnd_box_t * b, void *cl) +static rnd_r_dir_t fpstk_rect(const rnd_box_t * b, void *cl) { pcb_pstk_t *ps = (pcb_pstk_t *)b; struct fpin_info *info = (struct fpin_info *) cl; @@ -4459,7 +4459,7 @@ return RND_R_DIR_NOT_FOUND; } -static int FindPin(const rnd_rnd_box_t *box, pcb_pstk_t **ps_out) +static int FindPin(const rnd_box_t *box, pcb_pstk_t **ps_out) { struct fpin_info info; @@ -4505,7 +4505,7 @@ if (p->type == LINE) { rnd_coord_t halfwidth = HALF_THICK(p->style->Thick); double th = halfwidth * 2 + 1; - rnd_rnd_box_t b; + rnd_box_t b; assert(p->parent.line == NULL); /* orthogonal; thickness is 2*halfwidth */ /* flip coordinates, if bl_to_ur */ @@ -4535,7 +4535,7 @@ else if (p->type == VIA || p->type == VIA_SHADOW) { routebox_t *pp = (p->type == VIA_SHADOW) ? p->parent.via_shadow : p; rnd_coord_t radius = HALF_THICK(pp->style->Diameter); - rnd_rnd_box_t b = shrink_routebox(p); + rnd_box_t b = shrink_routebox(p); total_via_count++; assert(pp->type == VIA); if (pp->parent.via == NULL) { @@ -4745,7 +4745,7 @@ rnd_hid_progress(0, 0, NULL); if (conf_core.editor.live_routing) { int i; - rnd_rnd_box_t big = { 0, 0, RND_MAX_COORD, RND_MAX_COORD }; + rnd_box_t big = { 0, 0, RND_MAX_COORD, RND_MAX_COORD }; for (i = 0; i < pcb_max_group(PCB); i++) { rnd_r_search(rd->layergrouptree[i], &big, NULL, ripout_livedraw_obj_cb, NULL, NULL); } Index: mtspace.c =================================================================== --- mtspace.c (revision 31800) +++ mtspace.c (revision 31801) @@ -57,7 +57,7 @@ /* mtspace data structures are built on r-trees. */ typedef struct mtspacebox { - const rnd_rnd_box_t box; + const rnd_box_t box; rnd_coord_t clearance; /* the smallest clearance around this box */ } mtspacebox_t; @@ -86,13 +86,13 @@ #define SPECIAL 823157 -mtspacebox_t *mtspace_create_box(const rnd_rnd_box_t * box, rnd_coord_t clearance) +mtspacebox_t *mtspace_create_box(const rnd_box_t * box, rnd_coord_t clearance) { mtspacebox_t *mtsb; assert(rnd_box_is_good(box)); mtsb = (mtspacebox_t *) malloc(sizeof(*mtsb)); /* the box was sent to us pre-bloated by the clearance amount */ - *((rnd_rnd_box_t *) & mtsb->box) = *box; + *((rnd_box_t *) & mtsb->box) = *box; mtsb->clearance = clearance; assert(rnd_box_is_good(&mtsb->box)); return mtsb; @@ -128,12 +128,12 @@ struct mts_info { rnd_coord_t clearance; - rnd_rnd_box_t box; + rnd_box_t box; rnd_rtree_t *tree; jmp_buf env; }; -static rnd_r_dir_t mts_remove_one(const rnd_rnd_box_t * b, void *cl) +static rnd_r_dir_t mts_remove_one(const rnd_box_t * b, void *cl) { struct mts_info *info = (struct mts_info *) cl; mtspacebox_t *box = (mtspacebox_t *) b; @@ -142,7 +142,7 @@ /* the info box is pre-bloated, so just check equality */ if (b->X1 == info->box.X1 && b->X2 == info->box.X2 && b->Y1 == info->box.Y1 && b->Y2 == info->box.Y2 && box->clearance == info->clearance) { - rnd_r_delete_entry_free_data(info->tree, (rnd_rnd_box_t *)b, free); + rnd_r_delete_entry_free_data(info->tree, (rnd_box_t *)b, free); longjmp(info->env, 1); } return RND_R_DIR_NOT_FOUND; @@ -161,17 +161,17 @@ } /* add a space-filler to the empty space representation. */ -void mtspace_add(mtspace_t * mtspace, const rnd_rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance) +void mtspace_add(mtspace_t * mtspace, const rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance) { mtspacebox_t *filler = mtspace_create_box(box, clearance); - rnd_r_insert_entry(which_tree(mtspace, which), (const rnd_rnd_box_t *) filler); + rnd_r_insert_entry(which_tree(mtspace, which), (const rnd_box_t *) filler); } /* remove a space-filler from the empty space representation. */ -void mtspace_remove(mtspace_t * mtspace, const rnd_rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance) +void mtspace_remove(mtspace_t * mtspace, const rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance) { struct mts_info cl; - rnd_rnd_box_t small_search; + rnd_box_t small_search; cl.clearance = clearance; cl.box = *box; @@ -184,7 +184,7 @@ } struct query_closure { - rnd_rnd_box_t *cbox; + rnd_box_t *cbox; heap_or_vector checking; heap_or_vector touching; rnd_cheap_point_t *desired; @@ -193,7 +193,7 @@ rnd_bool touch_is_vec; }; -static inline void heap_append(rnd_heap_t * heap, rnd_cheap_point_t * desired, rnd_rnd_box_t * newone) +static inline void heap_append(rnd_heap_t * heap, rnd_cheap_point_t * desired, rnd_box_t * newone) { rnd_cheap_point_t p = *desired; assert(desired); @@ -201,7 +201,7 @@ rnd_heap_insert(heap, RND_ABS(p.X - desired->X) + (p.Y - desired->Y), newone); } -static inline void append(struct query_closure *qc, rnd_rnd_box_t * newone) +static inline void append(struct query_closure *qc, rnd_box_t * newone) { if (qc->desired) heap_append(qc->checking.h, qc->desired, newone); @@ -213,7 +213,7 @@ * First check if it does intersect, then break it into * overlaping regions that don't intersect this box. */ -static rnd_r_dir_t query_one(const rnd_rnd_box_t * box, void *cl) +static rnd_r_dir_t query_one(const rnd_box_t * box, void *cl) { struct query_closure *qc = (struct query_closure *) cl; mtspacebox_t *mtsb = (mtspacebox_t *) box; @@ -222,7 +222,7 @@ #ifndef NDEBUG { /* work around rounding errors: grow both boxes by 2 nm */ - rnd_rnd_box_t b1 = *qc->cbox, b2 = mtsb->box; + rnd_box_t b1 = *qc->cbox, b2 = mtsb->box; b1.X1--;b1.Y1--;b1.X2++;b1.Y2++; b2.X1--;b2.Y1--;b2.X2++;b2.Y2++; assert(rnd_box_intersect(&b1, &b2)); @@ -244,7 +244,7 @@ rnd_coord_t Y1 = qc->cbox->Y1; rnd_coord_t Y2 = mtsb->box.Y1 + shrink; if (Y2 - Y1 >= 2 * (qc->radius + qc->clearance)) { - rnd_rnd_box_t *newone = (rnd_rnd_box_t *) malloc(sizeof(rnd_rnd_box_t)); + rnd_box_t *newone = (rnd_box_t *) malloc(sizeof(rnd_box_t)); newone->X1 = qc->cbox->X1; newone->X2 = qc->cbox->X2; newone->Y1 = Y1; @@ -257,7 +257,7 @@ rnd_coord_t Y1 = mtsb->box.Y2 - shrink; rnd_coord_t Y2 = qc->cbox->Y2; if (Y2 - Y1 >= 2 * (qc->radius + qc->clearance)) { - rnd_rnd_box_t *newone = (rnd_rnd_box_t *) malloc(sizeof(rnd_rnd_box_t)); + rnd_box_t *newone = (rnd_box_t *) malloc(sizeof(rnd_box_t)); newone->X1 = qc->cbox->X1; newone->X2 = qc->cbox->X2; newone->Y2 = qc->cbox->Y2; @@ -270,8 +270,8 @@ rnd_coord_t X1 = qc->cbox->X1; rnd_coord_t X2 = mtsb->box.X1 + shrink; if (X2 - X1 >= 2 * (qc->radius + qc->clearance)) { - rnd_rnd_box_t *newone; - newone = (rnd_rnd_box_t *) malloc(sizeof(rnd_rnd_box_t)); + rnd_box_t *newone; + newone = (rnd_box_t *) malloc(sizeof(rnd_box_t)); newone->Y1 = qc->cbox->Y1; newone->Y2 = qc->cbox->Y2; newone->X1 = qc->cbox->X1; @@ -284,7 +284,7 @@ rnd_coord_t X1 = mtsb->box.X2 - shrink; rnd_coord_t X2 = qc->cbox->X2; if (X2 - X1 >= 2 * (qc->radius + qc->clearance)) { - rnd_rnd_box_t *newone = (rnd_rnd_box_t *) malloc(sizeof(rnd_rnd_box_t)); + rnd_box_t *newone = (rnd_box_t *) malloc(sizeof(rnd_box_t)); newone->Y1 = qc->cbox->Y1; newone->Y2 = qc->cbox->Y2; newone->X2 = qc->cbox->X2; @@ -315,11 +315,11 @@ */ static void qloop(struct query_closure *qc, rnd_rtree_t * tree, heap_or_vector res, rnd_bool is_vec) { - rnd_rnd_box_t *cbox; + rnd_box_t *cbox; int n; while (!(qc->desired ? rnd_heap_is_empty(qc->checking.h) : vector_is_empty(qc->checking.v))) { - cbox = qc->desired ? (rnd_rnd_box_t *) rnd_heap_remove_smallest(qc->checking.h) : (rnd_rnd_box_t *) vector_remove_last(qc->checking.v); + cbox = qc->desired ? (rnd_box_t *) rnd_heap_remove_smallest(qc->checking.h) : (rnd_box_t *) vector_remove_last(qc->checking.v); if (setjmp(qc->env) == 0) { assert(rnd_box_is_good(cbox)); qc->cbox = cbox; @@ -387,7 +387,7 @@ * to search harder for such regions if the computation becomes * necessary. */ -vetting_t *mtspace_query_rect(mtspace_t * mtspace, const rnd_rnd_box_t * region, +vetting_t *mtspace_query_rect(mtspace_t * mtspace, const rnd_box_t * region, rnd_coord_t radius, rnd_coord_t clearance, vetting_t * work, vector_t * free_space_vec, @@ -402,7 +402,7 @@ assert(hi_conflict_space_vec); /* search out to anything that might matter */ if (region) { - rnd_rnd_box_t *cbox; + rnd_box_t *cbox; assert(work == NULL); assert(rnd_box_is_good(region)); assert(vector_is_empty(free_space_vec)); @@ -411,7 +411,7 @@ work = (vetting_t *) malloc(sizeof(vetting_t)); work->clearance = clearance; work->radius = radius; - cbox = (rnd_rnd_box_t *) malloc(sizeof(rnd_rnd_box_t)); + cbox = (rnd_box_t *) malloc(sizeof(rnd_box_t)); *cbox = rnd_bloat_box(region, clearance + radius); if (desired) { work->untested.h = rnd_heap_create(); Index: mtspace.h =================================================================== --- mtspace.h (revision 31800) +++ mtspace.h (revision 31801) @@ -60,15 +60,15 @@ * should *not* be bloated; it should be "true". The feature will fill * *at least* a radius of clearance around it; */ -void mtspace_add(mtspace_t * mtspace, const rnd_rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance); +void mtspace_add(mtspace_t * mtspace, const rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance); /* remove a space-filler from the empty space representation. The given box * should *not* be bloated; it should be "true". The feature will fill * *at least* a radius of clearance around it; */ -void mtspace_remove(mtspace_t * mtspace, const rnd_rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance); +void mtspace_remove(mtspace_t * mtspace, const rnd_box_t * box, mtspace_type_t which, rnd_coord_t clearance); -vetting_t *mtspace_query_rect(mtspace_t * mtspace, const rnd_rnd_box_t * region, +vetting_t *mtspace_query_rect(mtspace_t * mtspace, const rnd_box_t * region, rnd_coord_t radius, rnd_coord_t clearance, vetting_t * work, vector_t * free_space_vec,