Index: polyhelp.c =================================================================== --- polyhelp.c (revision 37910) +++ polyhelp.c (revision 37911) @@ -251,10 +251,10 @@ rnd_coord_t coord[1]; } intersect_t; -static rnd_r_dir_t pcb_cploy_hatch_edge_hor(const rnd_box_t *region, void *cl) +static rnd_rtree_dir_t pcb_cploy_hatch_edge_hor(void *cl, void *obj, const rnd_rtree_box_t *box) { intersect_t *is = (intersect_t *)cl; - pcb_cpoly_edge_t *e = (pcb_cpoly_edge_t *)region; + pcb_cpoly_edge_t *e = (pcb_cpoly_edge_t *)obj; if (e->y1 != e->y2) { /* consider only non-horizontal edges */ @@ -267,13 +267,13 @@ is->used++; } - return RND_R_DIR_FOUND_CONTINUE; + return rnd_RTREE_DIR_FOUND_CONT; } -static rnd_r_dir_t pcb_cploy_hatch_edge_ver(const rnd_box_t *region, void *cl) +static rnd_rtree_dir_t pcb_cploy_hatch_edge_ver(void *cl, void *obj, const rnd_rtree_box_t *box) { intersect_t *is = (intersect_t *)cl; - pcb_cpoly_edge_t *e = (pcb_cpoly_edge_t *)region; + pcb_cpoly_edge_t *e = (pcb_cpoly_edge_t *)obj; if (e->x1 != e->x2) { /* consider only non-vertical edges */ @@ -286,7 +286,7 @@ is->used++; } - return RND_R_DIR_FOUND_CONTINUE; + return rnd_RTREE_DIR_FOUND_CONT; } static int coord_cmp(const void *p1, const void *p2) @@ -323,7 +323,7 @@ is->used = 0; is->at = y; - rnd_r_search(etr->edge_tree, &scan, NULL, pcb_cploy_hatch_edge_hor, is, NULL); + rnd_rtree_search_any(etr->edge_tree, (rnd_rtree_box_t *)&scan, NULL, pcb_cploy_hatch_edge_hor, is, NULL); qsort(is->coord, is->used, sizeof(rnd_coord_t), coord_cmp); for(n = 1; n < is->used; n+=2) /* call the callback for the odd scan lines */ cb(ctx, is->coord[n-1], y, is->coord[n], y); @@ -341,7 +341,7 @@ is->used = 0; is->at = x; - rnd_r_search(etr->edge_tree, &scan, NULL, pcb_cploy_hatch_edge_ver, is, NULL); + rnd_rtree_search_any(etr->edge_tree, (rnd_rtree_box_t *)&scan, NULL, pcb_cploy_hatch_edge_ver, is, NULL); qsort(is->coord, is->used, sizeof(rnd_coord_t), coord_cmp); for(n = 1; n < is->used; n+=2) /* call the callback for the odd scan lines */ cb(ctx, x, is->coord[n-1], x, is->coord[n]); Index: topoly.c =================================================================== --- topoly.c (revision 37910) +++ topoly.c (revision 37911) @@ -60,15 +60,15 @@ pcb_dynf_t mark; } next_conn_t; -static rnd_r_dir_t next_conn_found_arc(const rnd_box_t *box, void *cl) +static rnd_rtree_dir_t next_conn_found_arc(void *cl, void *obj_, const rnd_rtree_box_t *box) { rnd_coord_t ex, ey; next_conn_t *ctx = cl; - pcb_any_obj_t *obj = (pcb_any_obj_t *)box; + pcb_any_obj_t *obj = (pcb_any_obj_t *)obj_; int n; if (PCB_DFLAG_TEST(&obj->Flags, ctx->mark)) - return RND_R_DIR_NOT_FOUND; /* object already mapped */ + return rnd_RTREE_DIR_NOT_FOUND_CONT; /* object already mapped */ for(n = 0; n < 2; n++) { pcb_arc_get_end((pcb_arc_t *)obj, n, &ex, &ey); @@ -77,21 +77,21 @@ vtp0_append(ctx->list, obj); PCB_DFLAG_SET(&obj->Flags, ctx->mark); ctx->result = obj; - return RND_R_DIR_FOUND_CONTINUE; + return rnd_RTREE_DIR_FOUND_CONT; } } - return RND_R_DIR_NOT_FOUND; + return rnd_RTREE_DIR_NOT_FOUND_CONT; } -static rnd_r_dir_t next_conn_found_line(const rnd_box_t *box, void *cl) +static rnd_rtree_dir_t next_conn_found_line(void *cl, void *obj_, const rnd_rtree_box_t *box) { next_conn_t *ctx = cl; - pcb_any_obj_t *obj = (pcb_any_obj_t *)box; + pcb_any_obj_t *obj = (pcb_any_obj_t *)obj_; pcb_line_t *l = (pcb_line_t *)box; if (PCB_DFLAG_TEST(&obj->Flags, ctx->mark)) - return RND_R_DIR_NOT_FOUND; /* object already mapped */ + return rnd_RTREE_DIR_NOT_FOUND_CONT; /* object already mapped */ if (NEAR(ctx->tx, l->Point1.X, ctx->ty, l->Point1.Y)) { vti0_append(ctx->endlist, 0); @@ -98,7 +98,7 @@ vtp0_append(ctx->list, obj); PCB_DFLAG_SET(&obj->Flags, ctx->mark); ctx->result = obj; - return RND_R_DIR_FOUND_CONTINUE; + return rnd_RTREE_DIR_FOUND_CONT;; } if (NEAR(ctx->tx, l->Point2.X, ctx->ty, l->Point2.Y)) { @@ -106,10 +106,10 @@ vtp0_append(ctx->list, obj); PCB_DFLAG_SET(&obj->Flags, ctx->mark); ctx->result = obj; - return RND_R_DIR_FOUND_CONTINUE; + return rnd_RTREE_DIR_FOUND_CONT; } - return RND_R_DIR_NOT_FOUND; + return rnd_RTREE_DIR_NOT_FOUND_CONT; } static pcb_any_obj_t *next_conn(vtp0_t *list, vti0_t *endlist, pcb_any_obj_t *curr, pcb_dynf_t df) @@ -142,7 +142,7 @@ for(n = 0; n < 2; n++) { rnd_box_t region; - int len; + long len; region.X1 = cx[n]-1; region.Y1 = cy[n]-1; @@ -151,7 +151,7 @@ ctx.tx = cx[n]; ctx.ty = cy[n]; - rnd_r_search(curr->parent.layer->arc_tree, ®ion, NULL, next_conn_found_arc, &ctx, &len); + rnd_rtree_search_any(curr->parent.layer->arc_tree, (rnd_rtree_box_t *)®ion, NULL, next_conn_found_arc, &ctx, &len); if (len > 1) { rnd_message(RND_MSG_ERROR, "map_contour(): contour is not a clean loop: it contains at least one stub or subloop\n"); return NULL; @@ -159,7 +159,7 @@ if (ctx.result != NULL) return ctx.result; - rnd_r_search(curr->parent.layer->line_tree, ®ion, NULL, next_conn_found_line, &ctx, &len); + rnd_rtree_search_any(curr->parent.layer->line_tree, (rnd_rtree_box_t *)®ion, NULL, next_conn_found_line, &ctx, &len); if (len > 1) { rnd_message(RND_MSG_ERROR, "map_contour(): contour is not a clean loop: it contains at least one stub or subloop\n"); return NULL; @@ -303,12 +303,12 @@ } pstk_on_outline_t; /* rtree callback on pline segment crossing padstack bbox */ -static rnd_r_dir_t pcb_topoly_check_pstk_on_pline_cb(const rnd_box_t *box, void *cl) +static rnd_rtree_dir_t pcb_topoly_check_pstk_on_pline_cb(void *cl, void *obj_, const rnd_rtree_box_t *box) { pstk_on_outline_t *ctx = cl; pcb_find_t fctx = {0}; pcb_line_t line = {0}; - rnd_vnode_t *vn = rnd_pline_seg2vnode((void *)box); + rnd_vnode_t *vn = rnd_pline_seg2vnode((void *)obj_); line.Point1.X = vn->point[0]; line.Point1.Y = vn->point[1]; line.Point2.X = vn->next->point[0]; line.Point2.Y = vn->next->point[1]; @@ -318,28 +318,28 @@ vtp0_append(&ctx->pstks, ctx->ps); } - return RND_R_DIR_NOT_FOUND; + return rnd_RTREE_DIR_NOT_FOUND_CONT; } /* rtree callback on generated polygon overlapping padstack */ -static rnd_r_dir_t pcb_topoly_check_pstk_on_outline_cb(const rnd_box_t *box, void *cl) +static rnd_rtree_dir_t pcb_topoly_check_pstk_on_outline_cb(void *cl, void *obj_, const rnd_rtree_box_t *box) { pstk_on_outline_t *ctx = cl; - pcb_pstk_t *ps = (pcb_pstk_t *)box; + pcb_pstk_t *ps = (pcb_pstk_t *)obj_; pcb_pstk_shape_t holetmp; pcb_pstk_proto_t *proto = pcb_pstk_get_proto(ps); pcb_pstk_shape_t *shape = pcb_pstk_shape_mech_or_hole_(ps, proto, &holetmp); if (shape == NULL) - return RND_R_DIR_NOT_FOUND; + return rnd_RTREE_DIR_NOT_FOUND_CONT; ctx->ps = ps; ctx->shape = shape; - rnd_r_search(ctx->poly->Clipped->contours->tree, &ps->bbox_naked, NULL, pcb_topoly_check_pstk_on_pline_cb, ctx, NULL); + rnd_rtree_search_any(ctx->poly->Clipped->contours->tree, (rnd_rtree_box_t *)&ps->bbox_naked, NULL, pcb_topoly_check_pstk_on_pline_cb, ctx, NULL); ctx->ps = NULL; ctx->shape = NULL; - return RND_R_DIR_NOT_FOUND; + return rnd_RTREE_DIR_NOT_FOUND_CONT; } #define check(x, y, obj) \ @@ -421,7 +421,7 @@ vtp0_init(&pctx.pstks); /* map: first search (and mark) all offending padstacks */ - rnd_r_search(pcb->Data->padstack_tree, &poly->bbox_naked, NULL, pcb_topoly_check_pstk_on_outline_cb, &pctx, NULL); + rnd_rtree_search_any(pcb->Data->padstack_tree, (rnd_rtree_box_t *)&poly->bbox_naked, NULL, pcb_topoly_check_pstk_on_outline_cb, &pctx, NULL); /* apply: subtract all padstacks found while mapping */ for(n = 0; n < pctx.pstks.used; n++) {