Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 32880) +++ trunk/src/data.c (revision 32881) @@ -879,57 +879,41 @@ if (flag & PCB_FLAG_WARN) conf_core.temp.rat_warn = rnd_false; - if (tmask & PCB_OBJ_PSTK) { + if (tmask & PCB_OBJ_PSTK) for(n = rnd_r_first(data->padstack_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } - if (tmask & PCB_OBJ_RAT) { + if (tmask & PCB_OBJ_RAT) for(n = rnd_r_first(data->rat_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } - if (tmask & PCB_OBJ_SUBC) { + if (tmask & PCB_OBJ_SUBC) for(n = rnd_r_first(data->subc_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } if ((tmask & (PCB_OBJ_LINE | PCB_OBJ_ARC | PCB_OBJ_POLY | PCB_OBJ_TEXT | PCB_OBJ_GFX)) == 0) return cnt; /* do not run the layer loop if no layer object is requested */ for(li = 0, l = data->Layer; li < data->LayerN; li++,l++) { - if (tmask & PCB_OBJ_LINE) { + if (tmask & PCB_OBJ_LINE) for(n = rnd_r_first(l->line_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } - if (tmask & PCB_OBJ_ARC) { + if (tmask & PCB_OBJ_ARC) for(n = rnd_r_first(l->arc_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } - if (tmask & PCB_OBJ_POLY) { + if (tmask & PCB_OBJ_POLY) for(n = rnd_r_first(l->polygon_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } - if (tmask & PCB_OBJ_TEXT) { + if (tmask & PCB_OBJ_TEXT) for(n = rnd_r_first(l->text_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } - if (tmask & PCB_OBJ_GFX) { + if (tmask & PCB_OBJ_GFX) for(n = rnd_r_first(l->gfx_tree, &it); n != NULL; n = rnd_r_next(&it)) CHK_CLEAR(n); - rnd_r_end(&it); - } } return cnt; } @@ -950,36 +934,28 @@ for(n = rnd_r_first(data->padstack_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(n = rnd_r_first(data->subc_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(n = rnd_r_first(data->rat_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(li = 0, l = data->Layer; li < data->LayerN; li++,l++) { for(n = rnd_r_first(l->line_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(n = rnd_r_first(l->arc_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(n = rnd_r_first(l->polygon_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(n = rnd_r_first(l->text_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); for(n = rnd_r_first(l->gfx_tree, &it); n != NULL; n = rnd_r_next(&it)) PCB_DFLAG_CLR(&((pcb_any_obj_t *)n)->Flags, dynf); - rnd_r_end(&it); } } Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 32880) +++ trunk/src/find.c (revision 32881) @@ -403,29 +403,21 @@ rnd_rtree_it_t it; rnd_box_t *n; - if (l->line_tree != NULL) { + if (l->line_tree != NULL) for(n = rnd_rtree_first(&it, l->line_tree, sb); n != NULL; n = rnd_rtree_next(&it)) PCB_FIND_CHECK(ctx, curr, n, ctype, return); - rnd_r_end(&it); - } - if (l->arc_tree != NULL) { + if (l->arc_tree != NULL) for(n = rnd_rtree_first(&it, l->arc_tree, sb); n != NULL; n = rnd_rtree_next(&it)) PCB_FIND_CHECK(ctx, curr, n, ctype, return); - rnd_r_end(&it); - } - if (l->polygon_tree != NULL) { + if (l->polygon_tree != NULL) for(n = rnd_rtree_first(&it, l->polygon_tree, sb); n != NULL; n = rnd_rtree_next(&it)) PCB_FIND_CHECK(ctx, curr, n, ctype, return); - rnd_r_end(&it); - } - if (l->text_tree != NULL) { + if (l->text_tree != NULL) for(n = rnd_rtree_first(&it, l->text_tree, sb); n != NULL; n = rnd_rtree_next(&it)) PCB_FIND_CHECK(ctx, curr, n, ctype, return); - rnd_r_end(&it); - } } void pcb_find_on_layergrp(pcb_find_t *ctx, pcb_layergrp_t *g, pcb_any_obj_t *curr, rnd_rtree_box_t *sb, pcb_found_conn_type_t ctype) @@ -477,20 +469,14 @@ rnd_box_t *n; rnd_rtree_box_t *sb = (rnd_rtree_box_t *)&curr->bbox_naked; - if (PCB->Data->padstack_tree != NULL) { - for(n = rnd_rtree_first(&it, PCB->Data->padstack_tree, sb); n != NULL; n = rnd_rtree_next(&it)) { + if (PCB->Data->padstack_tree != NULL) + for(n = rnd_rtree_first(&it, PCB->Data->padstack_tree, sb); n != NULL; n = rnd_rtree_next(&it)) PCB_FIND_CHECK(ctx, curr, n, ctype, return ctx->nfound); - } - rnd_r_end(&it); - } - if ((ctx->consider_rats || ctx->only_mark_rats) && (PCB->Data->rat_tree != NULL)) { - if (PCB->Data->padstack_tree != NULL) { + if ((ctx->consider_rats || ctx->only_mark_rats) && (PCB->Data->rat_tree != NULL)) + if (PCB->Data->padstack_tree != NULL) for(n = rnd_rtree_first(&it, PCB->Data->rat_tree, sb); n != NULL; n = rnd_rtree_next(&it)) PCB_FIND_CHECK_RAT(ctx, curr, n, PCB_FCT_RAT, return ctx->nfound); - rnd_r_end(&it); - } - } if (curr->type == PCB_OBJ_PSTK) { int li; Index: trunk/src/obj_rat.c =================================================================== --- trunk/src/obj_rat.c (revision 32880) +++ trunk/src/obj_rat.c (revision 32881) @@ -220,48 +220,27 @@ sb.x1 = x; sb.x2 = x+1; sb.y1 = y; sb.y2 = y+1; - if (l->line_tree != NULL) { - for(n = rnd_rtree_first(&it, l->line_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) { - if (rat_meets_line((pcb_line_t *)n, x, y, -1)) { - rnd_r_end(&it); + if (l->line_tree != NULL) + for(n = rnd_rtree_first(&it, l->line_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) + if (rat_meets_line((pcb_line_t *)n, x, y, -1)) return (pcb_any_obj_t *)n; - } - } - rnd_r_end(&it); - } - if (l->arc_tree != NULL) { - for(n = rnd_rtree_first(&it, l->arc_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) { - if (rat_meets_arc((pcb_arc_t *)n, x, y, -1)) { - rnd_r_end(&it); + if (l->arc_tree != NULL) + for(n = rnd_rtree_first(&it, l->arc_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) + if (rat_meets_arc((pcb_arc_t *)n, x, y, -1)) return (pcb_any_obj_t *)n; - } - } - rnd_r_end(&it); - } - if (l->polygon_tree != NULL) { - for(n = rnd_rtree_first(&it, l->polygon_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) { - if (rat_meets_poly((pcb_poly_t *)n, x, y, -1)) { - rnd_r_end(&it); + if (l->polygon_tree != NULL) + for(n = rnd_rtree_first(&it, l->polygon_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) + if (rat_meets_poly((pcb_poly_t *)n, x, y, -1)) return (pcb_any_obj_t *)n; - } - } - rnd_r_end(&it); - } TODO("find through text"); #if 0 - if (l->text_tree != NULL) { - for(n = rnd_rtree_first(&it, l->text_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) { - if (rat_meets_text((pcb_text_t *)n, x, y, -1)) { - rnd_r_end(&it); + if (l->text_tree != NULL) + for(n = rnd_rtree_first(&it, l->text_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) + if (rat_meets_text((pcb_text_t *)n, x, y, -1)) return (pcb_any_obj_t *)n; - } - } - - rnd_r_end(&it); - } #endif return NULL; } @@ -282,15 +261,10 @@ sb.x1 = x; sb.x2 = x+1; sb.y1 = y; sb.y2 = y+1; - if (PCB->Data->padstack_tree != NULL) { - for(n = rnd_rtree_first(&it, data->padstack_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) { - if (rat_meets_pstk(data, (pcb_pstk_t *)n, x, y, gid)) { - rnd_r_end(&it); + if (PCB->Data->padstack_tree != NULL) + for(n = rnd_rtree_first(&it, data->padstack_tree, &sb); n != NULL; n = rnd_rtree_next(&it)) + if (rat_meets_pstk(data, (pcb_pstk_t *)n, x, y, gid)) return (pcb_any_obj_t *)n; - } - } - rnd_r_end(&it); - } for(i = 0; i < g->len; i++) { pcb_any_obj_t *o = find_obj_on_layer(x, y, &data->Layer[g->lid[i]]); Index: trunk/src_plugins/export_openscad/scad_draw.c =================================================================== --- trunk/src_plugins/export_openscad/scad_draw.c (revision 32880) +++ trunk/src_plugins/export_openscad/scad_draw.c (revision 32881) @@ -124,7 +124,6 @@ for(obj = rnd_r_first(PCB->Data->padstack_tree, &it); obj != NULL; obj = rnd_r_next(&it)) scad_draw_pstk((pcb_pstk_t *)obj); - rnd_r_end(&it); fprintf(f, "}\n"); } Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 32880) +++ trunk/src_plugins/io_lihata/read.c (revision 32881) @@ -2561,7 +2561,6 @@ pcb_poly_t *p = (pcb_poly_t *)b; pcb_poly_init_clip(pcb->Data, layer, p); } - rnd_r_end(&it); } } Index: trunk/src_plugins/io_tedax/tetest.c =================================================================== --- trunk/src_plugins/io_tedax/tetest.c (revision 32880) +++ trunk/src_plugins/io_tedax/tetest.c (revision 32881) @@ -147,9 +147,7 @@ continue; tedax_etest_fsave_pstk(f, ps, t->parent.net->name, sc->refdes, ps->term); } - rnd_r_end(&it); - fprintf(f, "end etest\n"); return 0; } Index: trunk/src_plugins/lib_compat_help/layer_compat.c =================================================================== --- trunk/src_plugins/lib_compat_help/layer_compat.c (revision 32880) +++ trunk/src_plugins/lib_compat_help/layer_compat.c (revision 32881) @@ -69,7 +69,6 @@ /* thermals are referenced by layer IDs which are going to change now */ for(n = rnd_r_first(pcb->Data->padstack_tree, &it); n != NULL; n = rnd_r_next(&it)) swap_one_thermal((pcb_pstk_t *)n, lid1, lid2, 0); - rnd_r_end(&it); for(gid = 0; gid < pcb_max_group(pcb); gid++) { pcb_layergrp_t *g = &pcb->LayerGroups.grp[gid]; Index: trunk/src_plugins/millpath/toolpath.c =================================================================== --- trunk/src_plugins/millpath/toolpath.c (revision 32880) +++ trunk/src_plugins/millpath/toolpath.c (revision 32881) @@ -139,7 +139,6 @@ for(line = (pcb_line_t *)rnd_r_first(layer->line_tree, &it); line != NULL; line = (pcb_line_t *)rnd_r_next(&it)) sub_layer_line(pcb, result, layer, line, centerline); - rnd_r_end(&it); for(arc = (pcb_arc_t *)rnd_r_first(layer->arc_tree, &it); arc != NULL; arc = (pcb_arc_t *)rnd_r_next(&it)) sub_layer_arc(pcb, result, layer, arc, centerline); @@ -147,7 +146,6 @@ for(poly = (pcb_poly_t *)rnd_r_first(layer->polygon_tree, &it); poly != NULL; poly = (pcb_poly_t *)rnd_r_next(&it)) sub_layer_poly(pcb, result, layer, poly, centerline); - rnd_r_end(&it); slt.pcb = pcb; slt.layer = layer; @@ -155,8 +153,6 @@ slt.result = result; for(text = (pcb_text_t *)rnd_r_first(layer->text_tree, &it); text != NULL; text = (pcb_text_t *)rnd_r_next(&it)) pcb_text_decompose_text(NULL, text, sub_layer_text, &slt); - rnd_r_end(&it); - } @@ -181,7 +177,6 @@ ps_tmp.thermals.used = 0; pcb_poly_sub_obj(pcb->Data, layer, result->fill, PCB_OBJ_PSTK, &ps_tmp); } - rnd_r_end(&it); } static void setup_ui_layers(pcb_board_t *pcb, pcb_tlp_session_t *result, pcb_layergrp_t *grp) @@ -255,11 +250,9 @@ for(line = (pcb_line_t *)rnd_r_first(l->line_tree, &it); line != NULL; line = (pcb_line_t *)rnd_r_next(&it)) rnd_box_bump_box(&otlbb, (rnd_box_t *)line); - rnd_r_end(&it); for(arc = (pcb_arc_t *)rnd_r_first(l->arc_tree, &it); arc != NULL; arc = (pcb_arc_t *)rnd_r_next(&it)) rnd_box_bump_box(&otlbb, (rnd_box_t *)arc); - rnd_r_end(&it); } result->fill = pcb_poly_new_from_rectangle(result->res_ply, otlbb.X1, otlbb.Y1, otlbb.X2, otlbb.Y2, 0, pcb_flag_make(PCB_FLAG_FULLPOLY)); result->remain = pcb_poly_new_from_rectangle(result->res_remply, otlbb.X1, otlbb.Y1, otlbb.X2, otlbb.Y2, 0, pcb_flag_make(PCB_FLAG_FULLPOLY)); Index: trunk/src_plugins/report/drill.c =================================================================== --- trunk/src_plugins/report/drill.c (revision 32880) +++ trunk/src_plugins/report/drill.c (revision 32881) @@ -112,7 +112,6 @@ drill_fill(Drill, (pcb_any_obj_t *)ps, !proto->hplated); } } - rnd_r_end(&it); qsort(AllDrills->Drill, AllDrills->DrillN, sizeof(pcb_drill_t), drill_qsort_cmp); return AllDrills; Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 32880) +++ trunk/src_plugins/teardrops/teardrops.c (revision 32881) @@ -256,7 +256,6 @@ for(b = rnd_r_first(PCB->Data->padstack_tree, &it); b != NULL; b = rnd_r_next(&it)) check_pstk((pcb_pstk_t *)b); - rnd_r_end(&it); rnd_gui->invalidate_all(rnd_gui);