Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 9890) +++ trunk/src/action_helper.c (revision 9891) @@ -766,8 +766,8 @@ pcb_crosshair.AttachedLine.Point1.Y, conf_core.design.via_thickness / 2) == PCB_TYPE_NONE - && (pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, CURRENT)) & PCB_LYT_COPPER) - && (pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, lastLayer)) & PCB_LYT_COPPER) + && (pcb_layer_flags_(PCB, CURRENT) & PCB_LYT_COPPER) + && (pcb_layer_flags_(PCB, lastLayer) & PCB_LYT_COPPER) && (via = pcb_via_new(PCB->Data, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, @@ -824,7 +824,7 @@ } if (conf_core.editor.auto_drc - && (pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, CURRENT)) & PCB_LYT_COPPER)) + && (pcb_layer_flags_(PCB, CURRENT) & PCB_LYT_COPPER)) maybe_found_flag = PCB_FLAG_FOUND; else maybe_found_flag = 0; @@ -852,8 +852,8 @@ isn't a pin already here */ if (PCB->ViaOn && pcb_layer_get_group_(CURRENT) != pcb_layer_get_group_(lastLayer) - && (pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, CURRENT)) & PCB_LYT_COPPER) - && (pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, lastLayer)) & PCB_LYT_COPPER) + && (pcb_layer_flags_(PCB, CURRENT) & PCB_LYT_COPPER) + && (pcb_layer_flags_(PCB, lastLayer) & PCB_LYT_COPPER) && pcb_search_obj_by_location(PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3, pcb_crosshair.AttachedLine.Point1.X, pcb_crosshair.AttachedLine.Point1.Y, Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 9890) +++ trunk/src/draw.c (revision 9891) @@ -390,7 +390,6 @@ { pcb_draw_info_t info; pcb_box_t scr2; - pcb_layer_id_t lid; unsigned int lflg = 0; if ((screen->X2 <= screen->X1) || (screen->Y2 <= screen->Y1)) { @@ -421,9 +420,7 @@ /* draw the layer text on screen */ pcb_r_search(Layer->text_tree, screen, NULL, draw_text_callback, Layer, NULL); - lid = pcb_layer_id(PCB->Data, Layer); - if (lid >= 0) - lflg = pcb_layer_flags(PCB, lid); + lflg = pcb_layer_flags_(PCB, Layer); /* The implicit outline rectangle (or automatic outline rectanlge). We should check for pcb_gui->gui here, but it's kinda cool seeing the Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 9890) +++ trunk/src/find_misc.c (revision 9891) @@ -227,10 +227,8 @@ if (type == PCB_TYPE_NONE) return; if (type & PCB_SILK_TYPE) { - pcb_layer_id_t laynum = pcb_layer_id(PCB->Data, (pcb_layer_t *) ptr1); - /* don't mess with non-conducting objects! */ - if (!(pcb_layer_flags(PCB, laynum) & PCB_LYT_COPPER) || ((pcb_layer_t *) ptr1)->meta.real.no_drc) + if (!(pcb_layer_flags_(PCB, (pcb_layer_t *) ptr1) & PCB_LYT_COPPER) || ((pcb_layer_t *) ptr1)->meta.real.no_drc) return; } } Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 9890) +++ trunk/src/obj_line.c (revision 9891) @@ -598,7 +598,7 @@ pcb_draw(); if (!PCB->ViaOn || ctx->move.more_to_come || pcb_layer_get_group_(Layer) == - pcb_layer_get_group_(ctx->move.dst_layer) || !(pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, Layer)) & PCB_LYT_COPPER) || !(pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, ctx->move.dst_layer)) & PCB_LYT_COPPER)) + pcb_layer_get_group_(ctx->move.dst_layer) || !(pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, Layer)) & PCB_LYT_COPPER) || !(pcb_layer_flags_(PCB, ctx->move.dst_layer) & PCB_LYT_COPPER)) return (newone); /* consider via at Point1 */ sb.X1 = newone->Point1.X - newone->Thickness / 2; Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 9890) +++ trunk/src/obj_line_drcenf.c (revision 9891) @@ -47,7 +47,7 @@ pcb_attached_line_t *line = &pcb_crosshair.AttachedLine; int flags = conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0; - if (conf_core.editor.auto_drc && (pcb_layer_flags(PCB,pcb_layer_id(PCB->Data, CURRENT)) & PCB_LYT_COPPER)) + if (conf_core.editor.auto_drc && (pcb_layer_flags_(PCB, CURRENT) & PCB_LYT_COPPER)) flags |= PCB_FLAG_FOUND; /* I need at least one point */ Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 9890) +++ trunk/src/obj_text.c (revision 9891) @@ -406,7 +406,7 @@ textlist_remove(text); textlist_append(&Destination->Text, text); - if (pcb_layer_flags(PCB, pcb_layer_id(PCB->Data, Destination)) & PCB_LYT_BOTTOM) + if (pcb_layer_flags_(PCB, Destination) & PCB_LYT_BOTTOM) PCB_FLAG_SET(PCB_FLAG_ONSOLDER, text); /* get the text mirrored on display */ else PCB_FLAG_CLEAR(PCB_FLAG_ONSOLDER, text); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 9890) +++ trunk/src/polygon.c (revision 9891) @@ -1023,7 +1023,7 @@ pcb_layergrp_id_t group; unsigned int gflg; - if (!(pcb_layer_flags(PCB, pcb_layer_id(Data, Layer)) & PCB_LYT_COPPER)) { + if (!(pcb_layer_flags_(PCB, Layer) & PCB_LYT_COPPER)) { polygon->NoHolesValid = 0; return 0; } @@ -1520,7 +1520,7 @@ if (type == PCB_TYPE_PIN || ptr1 == ptr2 || ptr1 == NULL) { LAYER_LOOP(Data, pcb_max_layer); { - if (!(pcb_layer_flags(PCB, pcb_layer_id(Data, layer)) & PCB_LYT_COPPER)) + if (!(pcb_layer_flags_(PCB, layer) & PCB_LYT_COPPER)) continue; info.layer = layer; pcb_r_search(layer->polygon_tree, &sb, NULL, plow_callback, &info, &seen); @@ -1545,6 +1545,7 @@ if (!PCB_FLAG_TEST(PCB_FLAG_CLEARLINE, (pcb_line_t *) ptr2)) return 0; /* non-copper (e.g. silk, outline) doesn't plow */ +#warning TODO: use pcb_layer_flags_ here - but what PCB? if (!(pcb_layer_flags(PCB, pcb_layer_id(Data, (pcb_layer_t *) ptr1) & PCB_LYT_COPPER))) return 0; PCB_COPPER_GROUP_LOOP(Data, pcb_layer_get_group(PCB, pcb_layer_id(Data, ((pcb_layer_t *) ptr1))));