Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 2508) +++ trunk/src/action_helper.c (revision 2509) @@ -163,8 +163,8 @@ conf_core.temp.rat_warn = false; ALLPIN_LOOP(PCB->Data); { - if (TEST_FLAG(WARNFLAG, pin)) { - CLEAR_FLAG(WARNFLAG, pin); + if (TEST_FLAG(PCB_FLAG_WARN, pin)) { + CLEAR_FLAG(PCB_FLAG_WARN, pin); DrawPin(pin); } } @@ -171,8 +171,8 @@ ENDALL_LOOP; VIA_LOOP(PCB->Data); { - if (TEST_FLAG(WARNFLAG, via)) { - CLEAR_FLAG(WARNFLAG, via); + if (TEST_FLAG(PCB_FLAG_WARN, via)) { + CLEAR_FLAG(PCB_FLAG_WARN, via); DrawVia(via); } } @@ -179,8 +179,8 @@ END_LOOP; ALLPAD_LOOP(PCB->Data); { - if (TEST_FLAG(WARNFLAG, pad)) { - CLEAR_FLAG(WARNFLAG, pad); + if (TEST_FLAG(PCB_FLAG_WARN, pad)) { + CLEAR_FLAG(PCB_FLAG_WARN, pad); DrawPad(pad); } } @@ -187,8 +187,8 @@ ENDALL_LOOP; ALLLINE_LOOP(PCB->Data); { - if (TEST_FLAG(WARNFLAG, line)) { - CLEAR_FLAG(WARNFLAG, line); + if (TEST_FLAG(PCB_FLAG_WARN, line)) { + CLEAR_FLAG(PCB_FLAG_WARN, line); DrawLine(layer, line); } } @@ -195,8 +195,8 @@ ENDALL_LOOP; ALLARC_LOOP(PCB->Data); { - if (TEST_FLAG(WARNFLAG, arc)) { - CLEAR_FLAG(WARNFLAG, arc); + if (TEST_FLAG(PCB_FLAG_WARN, arc)) { + CLEAR_FLAG(PCB_FLAG_WARN, arc); DrawArc(layer, arc); } } @@ -203,8 +203,8 @@ ENDALL_LOOP; ALLPOLYGON_LOOP(PCB->Data); { - if (TEST_FLAG(WARNFLAG, polygon)) { - CLEAR_FLAG(WARNFLAG, polygon); + if (TEST_FLAG(PCB_FLAG_WARN, polygon)) { + CLEAR_FLAG(PCB_FLAG_WARN, polygon); DrawPolygon(layer, polygon); } } @@ -419,7 +419,7 @@ } if (conf_core.editor.auto_drc && conf_core.editor.mode == PCB_MODE_LINE) { type = SearchScreen(Crosshair.X, Crosshair.Y, PCB_TYPE_PIN | PCB_TYPE_PAD | PCB_TYPE_VIA, &ptr1, &ptr2, &ptr3); - LookupConnection(Crosshair.X, Crosshair.Y, true, 1, FOUNDFLAG); + LookupConnection(Crosshair.X, Crosshair.Y, true, 1, PCB_FLAG_FOUND); } if (type == PCB_TYPE_PIN || type == PCB_TYPE_VIA) { Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = ((PinTypePtr) ptr2)->X; @@ -503,13 +503,13 @@ */ for (test = (SELECT_TYPES | MOVE_TYPES) & ~PCB_TYPE_RATLINE; test; test &= ~type) { type = SearchScreen(Note.X, Note.Y, test, &ptr1, &ptr2, &ptr3); - if (!Note.Hit && (type & MOVE_TYPES) && !TEST_FLAG(LOCKFLAG, (PinTypePtr) ptr2)) { + if (!Note.Hit && (type & MOVE_TYPES) && !TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2)) { Note.Hit = type; Note.ptr1 = ptr1; Note.ptr2 = ptr2; Note.ptr3 = ptr3; } - if (!Note.Moving && (type & SELECT_TYPES) && TEST_FLAG(SELECTEDFLAG, (PinTypePtr) ptr2)) + if (!Note.Moving && (type & SELECT_TYPES) && TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) ptr2)) Note.Moving = true; if ((Note.Hit && Note.Moving) || type == PCB_TYPE_NONE) break; @@ -586,7 +586,7 @@ dir, conf_core.design.line_thickness, 2 * conf_core.design.clearance, - MakeFlags(conf_core.editor.clear_line ? CLEARLINEFLAG : 0)))) { + MakeFlags(conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) { BoxTypePtr bx; bx = GetArcEnds(arc); @@ -610,20 +610,20 @@ if (type == PCB_TYPE_ELEMENT) { ElementTypePtr element = (ElementTypePtr) ptr2; - TOGGLE_FLAG(LOCKFLAG, element); + TOGGLE_FLAG(PCB_FLAG_LOCK, element); PIN_LOOP(element); { - TOGGLE_FLAG(LOCKFLAG, pin); - CLEAR_FLAG(SELECTEDFLAG, pin); + TOGGLE_FLAG(PCB_FLAG_LOCK, pin); + CLEAR_FLAG(PCB_FLAG_SELECTED, pin); } END_LOOP; PAD_LOOP(element); { - TOGGLE_FLAG(LOCKFLAG, pad); - CLEAR_FLAG(SELECTEDFLAG, pad); + TOGGLE_FLAG(PCB_FLAG_LOCK, pad); + CLEAR_FLAG(PCB_FLAG_SELECTED, pad); } END_LOOP; - CLEAR_FLAG(SELECTEDFLAG, element); + CLEAR_FLAG(PCB_FLAG_SELECTED, element); /* always re-draw it since I'm too lazy * to tell if a selected flag changed */ @@ -633,11 +633,11 @@ } else if (type != PCB_TYPE_NONE) { TextTypePtr thing = (TextTypePtr) ptr3; - TOGGLE_FLAG(LOCKFLAG, thing); - if (TEST_FLAG(LOCKFLAG, thing) - && TEST_FLAG(SELECTEDFLAG, thing)) { + TOGGLE_FLAG(PCB_FLAG_LOCK, thing); + if (TEST_FLAG(PCB_FLAG_LOCK, thing) + && TEST_FLAG(PCB_FLAG_SELECTED, thing)) { /* this is not un-doable since LOCK isn't */ - CLEAR_FLAG(SELECTEDFLAG, thing); + CLEAR_FLAG(PCB_FLAG_SELECTED, thing); DrawObject(type, ptr1, ptr2); Draw(); } @@ -648,7 +648,7 @@ case PCB_MODE_THERMAL: { if (((type = SearchScreen(Note.X, Note.Y, PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) - && !TEST_FLAG(HOLEFLAG, (PinTypePtr) ptr3)) { + && !TEST_FLAG(PCB_FLAG_HOLE, (PinTypePtr) ptr3)) { if (gui->shift_is_pressed()) { int tstyle = GET_THERM(INDEXOFCURRENT, (PinTypePtr) ptr3); tstyle++; @@ -715,7 +715,7 @@ if (conf_core.editor.auto_drc && !TEST_SILK_LAYER(CURRENT)) - maybe_found_flag = FOUNDFLAG; + maybe_found_flag = PCB_FLAG_FOUND; else maybe_found_flag = 0; @@ -730,7 +730,7 @@ conf_core.design.line_thickness, 2 * conf_core.design.clearance, MakeFlags(maybe_found_flag | - (conf_core.editor.clear_line ? CLEARLINEFLAG : 0)))) != NULL) { + (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) != NULL) { PinTypePtr via; addedLines++; @@ -769,8 +769,8 @@ Note.X, Note.Y, conf_core.design.line_thickness, 2 * conf_core.design.clearance, - MakeFlags((conf_core.editor.auto_drc ? FOUNDFLAG : 0) | - (conf_core.editor.clear_line ? CLEARLINEFLAG : 0)))) != NULL) { + MakeFlags((conf_core.editor.auto_drc ? PCB_FLAG_FOUND : 0) | + (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) != NULL) { addedLines++; AddObjectToCreateUndoList(PCB_TYPE_LINE, CURRENT, line, line); IncrementUndoSerialNumber(); @@ -807,9 +807,9 @@ Crosshair.AttachedBox.Point1.Y != Crosshair.AttachedBox.Point2.Y) { PolygonTypePtr polygon; - int flags = CLEARPOLYFLAG; + int flags = PCB_FLAG_CLEARPOLY; if (conf_core.editor.full_poly) - flags |= FULLPOLYFLAG; + flags |= PCB_FLAG_FULLPOLY; if ((polygon = CreateNewPolygonFromRectangle(CURRENT, Crosshair.AttachedBox.Point1.X, Crosshair.AttachedBox.Point1.Y, @@ -833,10 +833,10 @@ if ((string = gui->prompt_for(_("Enter text:"), "")) != NULL) { if (strlen(string) > 0) { TextTypePtr text; - int flag = CLEARLINEFLAG; + int flag = PCB_FLAG_CLEARLINE; if (GetLayerGroupNumberByNumber(INDEXOFCURRENT) == GetLayerGroupNumberByNumber(solder_silk_layer)) - flag |= ONSOLDERFLAG; + flag |= PCB_FLAG_ONSOLDER; if ((text = CreateNewText(CURRENT, &PCB->Font, Note.X, Note.Y, 0, conf_core.design.text_scale, string, MakeFlags(flag))) != NULL) { AddObjectToCreateUndoList(PCB_TYPE_TEXT, CURRENT, text, text); @@ -899,7 +899,7 @@ break; /* don't start doing anything if clicket out of polys */ } - if (TEST_FLAG(LOCKFLAG, (PolygonTypePtr) + if (TEST_FLAG(PCB_FLAG_LOCK, (PolygonTypePtr) Crosshair.AttachedObject.Ptr2)) { Message(_("Sorry, the object is locked\n")); Crosshair.AttachedObject.Type = PCB_TYPE_NONE; @@ -1023,7 +1023,7 @@ case PCB_MODE_REMOVE: if ((type = SearchScreen(Note.X, Note.Y, REMOVE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { - if (TEST_FLAG(LOCKFLAG, (LineTypePtr) ptr2)) { + if (TEST_FLAG(PCB_FLAG_LOCK, (LineTypePtr) ptr2)) { Message(_("Sorry, the object is locked\n")); break; } @@ -1037,10 +1037,10 @@ for (i = 0; i < Crosshair.AttachedObject.RubberbandN; i++) { if (PCB->RatOn) EraseRat((RatTypePtr) ptr->Line); - if (TEST_FLAG(RUBBERENDFLAG, ptr->Line)) + if (TEST_FLAG(PCB_FLAG_RUBBEREND, ptr->Line)) MoveObjectToRemoveUndoList(PCB_TYPE_RATLINE, ptr->Line, ptr->Line, ptr->Line); else - TOGGLE_FLAG(RUBBERENDFLAG, ptr->Line); /* only remove line once */ + TOGGLE_FLAG(PCB_FLAG_RUBBEREND, ptr->Line); /* only remove line once */ ptr++; } } @@ -1069,7 +1069,7 @@ SearchScreen(Note.X, Note.Y, types, &Crosshair.AttachedObject.Ptr1, &Crosshair.AttachedObject.Ptr2, &Crosshair.AttachedObject.Ptr3); if (Crosshair.AttachedObject.Type != PCB_TYPE_NONE) { - if (conf_core.editor.mode == PCB_MODE_MOVE && TEST_FLAG(LOCKFLAG, (PinTypePtr) + if (conf_core.editor.mode == PCB_MODE_MOVE && TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) Crosshair.AttachedObject.Ptr2)) { Message(_("Sorry, the object is locked\n")); Crosshair.AttachedObject.Type = PCB_TYPE_NONE; @@ -1115,7 +1115,7 @@ &Crosshair.AttachedObject.Ptr1, &Crosshair.AttachedObject.Ptr2, &Crosshair.AttachedObject.Ptr3); if (Crosshair.AttachedObject.Type != PCB_TYPE_NONE) { - if (TEST_FLAG(LOCKFLAG, (PolygonTypePtr) + if (TEST_FLAG(PCB_FLAG_LOCK, (PolygonTypePtr) Crosshair.AttachedObject.Ptr2)) { Message(_("Sorry, the object is locked\n")); Crosshair.AttachedObject.Type = PCB_TYPE_NONE; Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 2508) +++ trunk/src/buffer.c (revision 2509) @@ -102,7 +102,7 @@ static void *AddViaToBuffer(PinTypePtr Via) { return (CreateNewVia(Dest, Via->X, Via->Y, Via->Thickness, Via->Clearance, - Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, FOUNDFLAG | ExtraFlag))); + Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, PCB_FLAG_FOUND | ExtraFlag))); } /* --------------------------------------------------------------------------- @@ -112,7 +112,7 @@ { return (CreateNewRat(Dest, Rat->Point1.X, Rat->Point1.Y, Rat->Point2.X, Rat->Point2.Y, Rat->group1, - Rat->group2, Rat->Thickness, MaskFlags(Rat->Flags, FOUNDFLAG | ExtraFlag))); + Rat->group2, Rat->Thickness, MaskFlags(Rat->Flags, PCB_FLAG_FOUND | ExtraFlag))); } /* --------------------------------------------------------------------------- @@ -125,7 +125,7 @@ line = CreateNewLineOnLayer(layer, Line->Point1.X, Line->Point1.Y, Line->Point2.X, Line->Point2.Y, - Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, FOUNDFLAG | ExtraFlag)); + Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, PCB_FLAG_FOUND | ExtraFlag)); if (line && Line->Number) line->Number = strdup(Line->Number); return (line); @@ -140,7 +140,7 @@ return (CreateNewArcOnLayer(layer, Arc->X, Arc->Y, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta, - Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, FOUNDFLAG | ExtraFlag))); + Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, PCB_FLAG_FOUND | ExtraFlag))); } /* --------------------------------------------------------------------------- @@ -173,7 +173,7 @@ layer->polygon_tree = r_create_tree(NULL, 0, 0); r_insert_entry(layer->polygon_tree, (BoxType *) polygon, 0); - CLEAR_FLAG(FOUNDFLAG | ExtraFlag, polygon); + CLEAR_FLAG(PCB_FLAG_FOUND | ExtraFlag, polygon); return (polygon); } @@ -195,12 +195,12 @@ END_LOOP; PIN_LOOP(element); { - CLEAR_FLAG(FOUNDFLAG | ExtraFlag, pin); + CLEAR_FLAG(PCB_FLAG_FOUND | ExtraFlag, pin); } END_LOOP; PAD_LOOP(element); { - CLEAR_FLAG(FOUNDFLAG | ExtraFlag, pad); + CLEAR_FLAG(PCB_FLAG_FOUND | ExtraFlag, pad); } END_LOOP; } @@ -218,7 +218,7 @@ pinlist_remove(via); pinlist_append(&Dest->Via, via); - CLEAR_FLAG(WARNFLAG | FOUNDFLAG, via); + CLEAR_FLAG(PCB_FLAG_WARN | PCB_FLAG_FOUND, via); if (!Dest->via_tree) Dest->via_tree = r_create_tree(NULL, 0, 0); @@ -237,7 +237,7 @@ ratlist_remove(rat); ratlist_append(&Dest->Rat, rat); - CLEAR_FLAG(FOUNDFLAG, rat); + CLEAR_FLAG(PCB_FLAG_FOUND, rat); if (!Dest->rat_tree) Dest->rat_tree = r_create_tree(NULL, 0, 0); @@ -258,7 +258,7 @@ linelist_remove(line); linelist_append(&(lay->Line), line); - CLEAR_FLAG(FOUNDFLAG, line); + CLEAR_FLAG(PCB_FLAG_FOUND, line); if (!lay->line_tree) lay->line_tree = r_create_tree(NULL, 0, 0); @@ -280,7 +280,7 @@ arclist_remove(arc); arclist_append(&lay->Arc, arc); - CLEAR_FLAG(FOUNDFLAG, arc); + CLEAR_FLAG(PCB_FLAG_FOUND, arc); if (!lay->arc_tree) lay->arc_tree = r_create_tree(NULL, 0, 0); @@ -321,7 +321,7 @@ polylist_remove(polygon); polylist_append(&lay->Polygon, polygon); - CLEAR_FLAG(FOUNDFLAG, polygon); + CLEAR_FLAG(PCB_FLAG_FOUND, polygon); if (!lay->polygon_tree) lay->polygon_tree = r_create_tree(NULL, 0, 0); @@ -346,13 +346,13 @@ PIN_LOOP(element); { RestoreToPolygon(Source, PCB_TYPE_PIN, element, pin); - CLEAR_FLAG(WARNFLAG | FOUNDFLAG, pin); + CLEAR_FLAG(PCB_FLAG_WARN | PCB_FLAG_FOUND, pin); } END_LOOP; PAD_LOOP(element); { RestoreToPolygon(Source, PCB_TYPE_PAD, element, pad); - CLEAR_FLAG(WARNFLAG | FOUNDFLAG, pad); + CLEAR_FLAG(PCB_FLAG_WARN | PCB_FLAG_FOUND, pad); } END_LOOP; SetElementBoundingBox(Dest, element, &PCB->Font); @@ -405,7 +405,7 @@ * may change the 'valid' area for the cursor */ if (!LeaveSelected) - ExtraFlag = SELECTEDFLAG; + ExtraFlag = PCB_FLAG_SELECTED; notify_crosshair_change(false); Source = PCB->Data; Dest = Buffer->Data; @@ -563,9 +563,9 @@ PIN_LOOP(element); { FlagType f = NoFlags(); - AddFlags(f, VIAFLAG); - if (TEST_FLAG(HOLEFLAG, pin)) - AddFlags(f, HOLEFLAG); + AddFlags(f, PCB_FLAG_VIA); + if (TEST_FLAG(PCB_FLAG_HOLE, pin)) + AddFlags(f, PCB_FLAG_HOLE); CreateNewVia(Buffer->Data, pin->X, pin->Y, pin->Thickness, pin->Clearance, pin->Mask, pin->DrillingHole, pin->Number, f); } @@ -577,7 +577,7 @@ PAD_LOOP(element); { LineTypePtr line; - line = CreateNewLineOnLayer(TEST_FLAG(ONSOLDERFLAG, pad) ? slayer : clayer, + line = CreateNewLineOnLayer(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? slayer : clayer, pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y, pad->Thickness, pad->Clearance, NoFlags()); if (line) @@ -640,7 +640,7 @@ Element = CreateNewElement(PCB->Data, NULL, &PCB->Font, NoFlags(), NULL, NULL, NULL, PASTEBUFFER->X, - PASTEBUFFER->Y, 0, 100, MakeFlags(SWAP_IDENT ? ONSOLDERFLAG : NOFLAG), false); + PASTEBUFFER->Y, 0, 100, MakeFlags(SWAP_IDENT ? PCB_FLAG_ONSOLDER : PCB_FLAG_NO), false); if (!Element) return (false); VIA_LOOP(Buffer->Data); @@ -651,12 +651,12 @@ if (via->Name) CreateNewPin(Element, via->X, via->Y, via->Thickness, via->Clearance, via->Mask, via->DrillingHole, - NULL, via->Name, MaskFlags(via->Flags, VIAFLAG | FOUNDFLAG | SELECTEDFLAG | WARNFLAG)); + NULL, via->Name, MaskFlags(via->Flags, PCB_FLAG_VIA | PCB_FLAG_FOUND | PCB_FLAG_SELECTED | PCB_FLAG_WARN)); else { sprintf(num, "%d", pin_n++); CreateNewPin(Element, via->X, via->Y, via->Thickness, via->Clearance, via->Mask, via->DrillingHole, - NULL, num, MaskFlags(via->Flags, VIAFLAG | FOUNDFLAG | SELECTEDFLAG | WARNFLAG)); + NULL, num, MaskFlags(via->Flags, PCB_FLAG_VIA | PCB_FLAG_FOUND | PCB_FLAG_SELECTED | PCB_FLAG_WARN)); } hasParts = true; } @@ -668,11 +668,11 @@ if ((!onsolder) == (!SWAP_IDENT)) { silk_layer = component_silk_layer; - onsolderflag = NOFLAG; + onsolderflag = PCB_FLAG_NO; } else { silk_layer = solder_silk_layer; - onsolderflag = ONSOLDERFLAG; + onsolderflag = PCB_FLAG_ONSOLDER; } #define MAYBE_WARN() \ @@ -722,7 +722,7 @@ sprintf(num, "%d", pin_n++); CreateNewPad(Element, x1, y1, x2, y2, t, - 2 * conf_core.design.clearance, t + conf_core.design.clearance, NULL, num, MakeFlags(SQUAREFLAG | onsolderflag)); + 2 * conf_core.design.clearance, t + conf_core.design.clearance, NULL, num, MakeFlags(PCB_FLAG_SQUARE | onsolderflag)); MAYBE_WARN(); hasParts = true; } @@ -756,7 +756,7 @@ Element->MarkX = Buffer->X; Element->MarkY = Buffer->Y; if (SWAP_IDENT) - SET_FLAG(ONSOLDERFLAG, Element); + SET_FLAG(PCB_FLAG_ONSOLDER, Element); SetElementBoundingBox(PCB->Data, Element, &PCB->Font); ClearBuffer(Buffer); MoveObjectToBuffer(Buffer->Data, PCB->Data, PCB_TYPE_ELEMENT, Element, Element, Element); @@ -1164,7 +1164,7 @@ r_delete_entry(layer->text_tree, (BoxType *) text); text->X = SWAP_X(text->X); text->Y = SWAP_Y(text->Y); - TOGGLE_FLAG(ONSOLDERFLAG, text); + TOGGLE_FLAG(PCB_FLAG_ONSOLDER, text); SetTextBoundingBox(&PCB->Font, text); r_insert_entry(layer->text_tree, (BoxType *) text, 0); } Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 2508) +++ trunk/src/change.c (revision 2509) @@ -440,9 +440,9 @@ { Coord value = Absolute ? Absolute : Via->Thickness + Delta; - if (TEST_FLAG(LOCKFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); - if (!TEST_FLAG(HOLEFLAG, Via) && value <= MAX_PINORVIASIZE && + if (!TEST_FLAG(PCB_FLAG_HOLE, Via) && value <= MAX_PINORVIASIZE && value >= MIN_PINORVIASIZE && value >= Via->DrillingHole + MIN_PINORVIACOPPER && value != Via->Thickness) { AddObjectToSizeUndoList(PCB_TYPE_VIA, Via, Via, Via); EraseVia(Via); @@ -470,16 +470,16 @@ { Coord value = (Absolute) ? Absolute : Via->DrillingHole + Delta; - if (TEST_FLAG(LOCKFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); if (value <= MAX_PINORVIASIZE && - value >= MIN_PINORVIAHOLE && (TEST_FLAG(HOLEFLAG, Via) || value <= Via->Thickness - MIN_PINORVIACOPPER) + value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, Via) || value <= Via->Thickness - MIN_PINORVIACOPPER) && value != Via->DrillingHole) { AddObjectTo2ndSizeUndoList(PCB_TYPE_VIA, Via, Via, Via); EraseVia(Via); RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via); Via->DrillingHole = value; - if (TEST_FLAG(HOLEFLAG, Via)) { + if (TEST_FLAG(PCB_FLAG_HOLE, Via)) { AddObjectToSizeUndoList(PCB_TYPE_VIA, Via, Via, Via); Via->Thickness = value; } @@ -498,7 +498,7 @@ { Coord value = (Absolute) ? Absolute : Via->Clearance + Delta; - if (TEST_FLAG(LOCKFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); value = MIN(MAX_LINESIZE, value); if (value < 0) @@ -531,9 +531,9 @@ { Coord value = (Absolute) ? Absolute : Pin->Thickness + Delta; - if (TEST_FLAG(LOCKFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); - if (!TEST_FLAG(HOLEFLAG, Pin) && value <= MAX_PINORVIASIZE && + if (!TEST_FLAG(PCB_FLAG_HOLE, Pin) && value <= MAX_PINORVIASIZE && value >= MIN_PINORVIASIZE && value >= Pin->DrillingHole + MIN_PINORVIACOPPER && value != Pin->Thickness) { AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin); AddObjectToMaskSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin); @@ -559,7 +559,7 @@ { Coord value = (Absolute) ? Absolute : Pin->Clearance + Delta; - if (TEST_FLAG(LOCKFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); value = MIN(MAX_LINESIZE, value); if (value < 0) @@ -590,7 +590,7 @@ { Coord value = (Absolute) ? Absolute : Pad->Thickness + Delta; - if (TEST_FLAG(LOCKFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (NULL); if (value <= MAX_PADSIZE && value >= MIN_PADSIZE && value != Pad->Thickness) { AddObjectToSizeUndoList(PCB_TYPE_PAD, Element, Pad, Pad); @@ -617,7 +617,7 @@ { Coord value = (Absolute) ? Absolute : Pad->Clearance + Delta; - if (TEST_FLAG(LOCKFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (NULL); value = MIN(MAX_LINESIZE, value); if (value < 0) @@ -649,13 +649,13 @@ bool changed = false; Coord value; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { value = (Absolute) ? Absolute : pin->DrillingHole + Delta; if (value <= MAX_PINORVIASIZE && - value >= MIN_PINORVIAHOLE && (TEST_FLAG(HOLEFLAG, pin) || value <= pin->Thickness - MIN_PINORVIACOPPER) + value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, pin) || value <= pin->Thickness - MIN_PINORVIACOPPER) && value != pin->DrillingHole) { changed = true; AddObjectTo2ndSizeUndoList(PCB_TYPE_PIN, Element, pin, pin); @@ -662,7 +662,7 @@ ErasePin(pin); RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin); pin->DrillingHole = value; - if (TEST_FLAG(HOLEFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_HOLE, pin)) { AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin); pin->Thickness = value; } @@ -686,7 +686,7 @@ bool changed = false; Coord value; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -697,7 +697,7 @@ ErasePin(pin); RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin); pin->Thickness = value; - if (TEST_FLAG(HOLEFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_HOLE, pin)) { AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin); pin->Thickness = value; } @@ -721,13 +721,13 @@ bool changed = false; Coord value; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { value = (Absolute) ? Absolute : pin->Clearance + Delta; if (value <= MAX_PINORVIASIZE && - value >= MIN_PINORVIAHOLE && (TEST_FLAG(HOLEFLAG, pin) || value <= pin->Thickness - MIN_PINORVIACOPPER) + value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, pin) || value <= pin->Thickness - MIN_PINORVIACOPPER) && value != pin->Clearance) { changed = true; AddObjectToClearSizeUndoList(PCB_TYPE_PIN, Element, pin, pin); @@ -734,7 +734,7 @@ ErasePin(pin); RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, pin); pin->Clearance = value; - if (TEST_FLAG(HOLEFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_HOLE, pin)) { AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, pin, pin); pin->Thickness = value; } @@ -754,7 +754,7 @@ RestoreToPolygon(PCB->Data, PCB_TYPE_PAD, Element, pad); r_delete_entry(PCB->Data->pad_tree, &pad->BoundingBox); pad->Clearance = value; - if (TEST_FLAG(HOLEFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_HOLE, pad)) { AddObjectToSizeUndoList(PCB_TYPE_PAD, Element, pad, pad); pad->Thickness = value; } @@ -781,16 +781,16 @@ { Coord value = (Absolute) ? Absolute : Pin->DrillingHole + Delta; - if (TEST_FLAG(LOCKFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); if (value <= MAX_PINORVIASIZE && - value >= MIN_PINORVIAHOLE && (TEST_FLAG(HOLEFLAG, Pin) || value <= Pin->Thickness - MIN_PINORVIACOPPER) + value >= MIN_PINORVIAHOLE && (TEST_FLAG(PCB_FLAG_HOLE, Pin) || value <= Pin->Thickness - MIN_PINORVIACOPPER) && value != Pin->DrillingHole) { AddObjectTo2ndSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin); ErasePin(Pin); RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin); Pin->DrillingHole = value; - if (TEST_FLAG(HOLEFLAG, Pin)) { + if (TEST_FLAG(PCB_FLAG_HOLE, Pin)) { AddObjectToSizeUndoList(PCB_TYPE_PIN, Element, Pin, Pin); Pin->Thickness = value; } @@ -809,7 +809,7 @@ { Coord value = (Absolute) ? Absolute : Line->Thickness + Delta; - if (TEST_FLAG(LOCKFLAG, Line)) + if (TEST_FLAG(PCB_FLAG_LOCK, Line)) return (NULL); if (value <= MAX_LINESIZE && value >= MIN_LINESIZE && value != Line->Thickness) { AddObjectToSizeUndoList(PCB_TYPE_LINE, Layer, Line, Line); @@ -834,7 +834,7 @@ { Coord value = (Absolute) ? Absolute : Line->Clearance + Delta; - if (TEST_FLAG(LOCKFLAG, Line) || !TEST_FLAG(CLEARLINEFLAG, Line)) + if (TEST_FLAG(PCB_FLAG_LOCK, Line) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) return (NULL); value = MIN(MAX_LINESIZE, MAX(value, PCB->Bloat * 2 + 2)); if (value != Line->Clearance) { @@ -844,7 +844,7 @@ r_delete_entry(Layer->line_tree, (BoxTypePtr) Line); Line->Clearance = value; if (Line->Clearance == 0) { - CLEAR_FLAG(CLEARLINEFLAG, Line); + CLEAR_FLAG(PCB_FLAG_CLEARLINE, Line); Line->Clearance = MIL_TO_COORD(10); } SetLineBoundingBox(Line); @@ -881,7 +881,7 @@ { Coord value = (Absolute) ? Absolute : Arc->Thickness + Delta; - if (TEST_FLAG(LOCKFLAG, Arc)) + if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) return (NULL); if (value <= MAX_LINESIZE && value >= MIN_LINESIZE && value != Arc->Thickness) { AddObjectToSizeUndoList(PCB_TYPE_ARC, Layer, Arc, Arc); @@ -906,7 +906,7 @@ { Coord value = (Absolute) ? Absolute : Arc->Clearance + Delta; - if (TEST_FLAG(LOCKFLAG, Arc) || !TEST_FLAG(CLEARLINEFLAG, Arc)) + if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) return (NULL); value = MIN(MAX_LINESIZE, MAX(value, PCB->Bloat * 2 + 2)); if (value != Arc->Clearance) { @@ -916,7 +916,7 @@ RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc); Arc->Clearance = value; if (Arc->Clearance == 0) { - CLEAR_FLAG(CLEARLINEFLAG, Arc); + CLEAR_FLAG(PCB_FLAG_CLEARLINE, Arc); Arc->Clearance = MIL_TO_COORD(10); } SetArcBoundingBox(Arc); @@ -937,7 +937,7 @@ int value = Absolute ? COORD_TO_MIL(Absolute) : Text->Scale + COORD_TO_MIL(Delta); - if (TEST_FLAG(LOCKFLAG, Text)) + if (TEST_FLAG(PCB_FLAG_LOCK, Text)) return (NULL); if (value <= MAX_TEXTSCALE && value >= MIN_TEXTSCALE && value != Text->Scale) { AddObjectToSizeUndoList(PCB_TYPE_TEXT, Layer, Text, Text); @@ -963,7 +963,7 @@ Coord value; bool changed = false; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); if (PCB->ElementOn) EraseElement(Element); @@ -1004,7 +1004,7 @@ int value = Absolute ? COORD_TO_MIL(Absolute) : DESCRIPTION_TEXT(Element).Scale + COORD_TO_MIL(Delta); - if (TEST_FLAG(LOCKFLAG, &Element->Name[0])) + if (TEST_FLAG(PCB_FLAG_LOCK, &Element->Name[0])) return (NULL); if (value <= MAX_TEXTSCALE && value >= MIN_TEXTSCALE) { EraseElementName(Element); @@ -1030,7 +1030,7 @@ { char *old = Via->Name; - if (TEST_FLAG(DISPLAYNAMEFLAG, Via)) { + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Via)) { ErasePinName(Via); Via->Name = NewName; DrawPinName(Via); @@ -1048,7 +1048,7 @@ char *old = Pin->Name; Element = Element; /* get rid of 'unused...' warnings */ - if (TEST_FLAG(DISPLAYNAMEFLAG, Pin)) { + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin)) { ErasePinName(Pin); Pin->Name = NewName; DrawPinName(Pin); @@ -1066,7 +1066,7 @@ char *old = Pad->Name; Element = Element; /* get rid of 'unused...' warnings */ - if (TEST_FLAG(DISPLAYNAMEFLAG, Pad)) { + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad)) { ErasePadName(Pad); Pad->Name = NewName; DrawPadName(Pad); @@ -1084,7 +1084,7 @@ char *old = Pin->Number; Element = Element; /* get rid of 'unused...' warnings */ - if (TEST_FLAG(DISPLAYNAMEFLAG, Pin)) { + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin)) { ErasePinName(Pin); Pin->Number = NewName; DrawPinName(Pin); @@ -1102,7 +1102,7 @@ char *old = Pad->Number; Element = Element; /* get rid of 'unused...' warnings */ - if (TEST_FLAG(DISPLAYNAMEFLAG, Pad)) { + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad)) { ErasePadName(Pad); Pad->Number = NewName; DrawPadName(Pad); @@ -1154,7 +1154,7 @@ static void *ChangeElementName(ElementTypePtr Element) { - if (TEST_FLAG(LOCKFLAG, &Element->Name[0])) + if (TEST_FLAG(PCB_FLAG_LOCK, &Element->Name[0])) return (NULL); if (NAME_INDEX() == NAMEONPCB_INDEX) { if (conf_core.editor.unique_names && UniqueElementName(PCB->Data, NewName) != NewName) { @@ -1168,9 +1168,9 @@ static void *ChangeElementNonetlist(ElementTypePtr Element) { - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); - TOGGLE_FLAG(NONETLISTFLAG, Element); + TOGGLE_FLAG(PCB_FLAG_NONETLIST, Element); return Element; } @@ -1184,7 +1184,7 @@ { char *old = Text->TextString; - if (TEST_FLAG(LOCKFLAG, Text)) + if (TEST_FLAG(PCB_FLAG_LOCK, Text)) return (NULL); EraseText(Layer, Text); RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text); @@ -1215,7 +1215,7 @@ */ bool ChangeElementSide(ElementTypePtr Element, Coord yoff) { - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (false); EraseElement(Element); AddObjectToMirrorUndoList(PCB_TYPE_ELEMENT, Element, Element, Element, yoff); @@ -1240,16 +1240,16 @@ */ static void *ChangeLineJoin(LayerTypePtr Layer, LineTypePtr Line) { - if (TEST_FLAG(LOCKFLAG, Line)) + if (TEST_FLAG(PCB_FLAG_LOCK, Line)) return (NULL); EraseLine(Line); - if (TEST_FLAG(CLEARLINEFLAG, Line)) { + if (TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) { AddObjectToClearPolyUndoList(PCB_TYPE_LINE, Layer, Line, Line, false); RestoreToPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line); } AddObjectToFlagUndoList(PCB_TYPE_LINE, Layer, Line, Line); - TOGGLE_FLAG(CLEARLINEFLAG, Line); - if (TEST_FLAG(CLEARLINEFLAG, Line)) { + TOGGLE_FLAG(PCB_FLAG_CLEARLINE, Line); + if (TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) { AddObjectToClearPolyUndoList(PCB_TYPE_LINE, Layer, Line, Line, true); ClearFromPolygon(PCB->Data, PCB_TYPE_LINE, Layer, Line); } @@ -1262,7 +1262,7 @@ */ static void *SetLineJoin(LayerTypePtr Layer, LineTypePtr Line) { - if (TEST_FLAG(LOCKFLAG, Line) || TEST_FLAG(CLEARLINEFLAG, Line)) + if (TEST_FLAG(PCB_FLAG_LOCK, Line) || TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) return (NULL); return ChangeLineJoin(Layer, Line); } @@ -1272,7 +1272,7 @@ */ static void *ClrLineJoin(LayerTypePtr Layer, LineTypePtr Line) { - if (TEST_FLAG(LOCKFLAG, Line) || !TEST_FLAG(CLEARLINEFLAG, Line)) + if (TEST_FLAG(PCB_FLAG_LOCK, Line) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) return (NULL); return ChangeLineJoin(Layer, Line); } @@ -1282,16 +1282,16 @@ */ static void *ChangeArcJoin(LayerTypePtr Layer, ArcTypePtr Arc) { - if (TEST_FLAG(LOCKFLAG, Arc)) + if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) return (NULL); EraseArc(Arc); - if (TEST_FLAG(CLEARLINEFLAG, Arc)) { + if (TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) { RestoreToPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc); AddObjectToClearPolyUndoList(PCB_TYPE_ARC, Layer, Arc, Arc, false); } AddObjectToFlagUndoList(PCB_TYPE_ARC, Layer, Arc, Arc); - TOGGLE_FLAG(CLEARLINEFLAG, Arc); - if (TEST_FLAG(CLEARLINEFLAG, Arc)) { + TOGGLE_FLAG(PCB_FLAG_CLEARLINE, Arc); + if (TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) { ClearFromPolygon(PCB->Data, PCB_TYPE_ARC, Layer, Arc); AddObjectToClearPolyUndoList(PCB_TYPE_ARC, Layer, Arc, Arc, true); } @@ -1304,7 +1304,7 @@ */ static void *SetArcJoin(LayerTypePtr Layer, ArcTypePtr Arc) { - if (TEST_FLAG(LOCKFLAG, Arc) || TEST_FLAG(CLEARLINEFLAG, Arc)) + if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) return (NULL); return ChangeArcJoin(Layer, Arc); } @@ -1314,7 +1314,7 @@ */ static void *ClrArcJoin(LayerTypePtr Layer, ArcTypePtr Arc) { - if (TEST_FLAG(LOCKFLAG, Arc) || !TEST_FLAG(CLEARLINEFLAG, Arc)) + if (TEST_FLAG(PCB_FLAG_LOCK, Arc) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) return (NULL); return ChangeArcJoin(Layer, Arc); } @@ -1324,16 +1324,16 @@ */ static void *ChangeTextJoin(LayerTypePtr Layer, TextTypePtr Text) { - if (TEST_FLAG(LOCKFLAG, Text)) + if (TEST_FLAG(PCB_FLAG_LOCK, Text)) return (NULL); EraseText(Layer, Text); - if (TEST_FLAG(CLEARLINEFLAG, Text)) { + if (TEST_FLAG(PCB_FLAG_CLEARLINE, Text)) { AddObjectToClearPolyUndoList(PCB_TYPE_TEXT, Layer, Text, Text, false); RestoreToPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text); } AddObjectToFlagUndoList(PCB_TYPE_LINE, Layer, Text, Text); - TOGGLE_FLAG(CLEARLINEFLAG, Text); - if (TEST_FLAG(CLEARLINEFLAG, Text)) { + TOGGLE_FLAG(PCB_FLAG_CLEARLINE, Text); + if (TEST_FLAG(PCB_FLAG_CLEARLINE, Text)) { AddObjectToClearPolyUndoList(PCB_TYPE_TEXT, Layer, Text, Text, true); ClearFromPolygon(PCB->Data, PCB_TYPE_TEXT, Layer, Text); } @@ -1346,7 +1346,7 @@ */ static void *SetTextJoin(LayerTypePtr Layer, TextTypePtr Text) { - if (TEST_FLAG(LOCKFLAG, Text) || TEST_FLAG(CLEARLINEFLAG, Text)) + if (TEST_FLAG(PCB_FLAG_LOCK, Text) || TEST_FLAG(PCB_FLAG_CLEARLINE, Text)) return (NULL); return ChangeTextJoin(Layer, Text); } @@ -1356,7 +1356,7 @@ */ static void *ClrTextJoin(LayerTypePtr Layer, TextTypePtr Text) { - if (TEST_FLAG(LOCKFLAG, Text) || !TEST_FLAG(CLEARLINEFLAG, Text)) + if (TEST_FLAG(PCB_FLAG_LOCK, Text) || !TEST_FLAG(PCB_FLAG_CLEARLINE, Text)) return (NULL); return ChangeTextJoin(Layer, Text); } @@ -1368,7 +1368,7 @@ { void *ans = NULL; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -1390,7 +1390,7 @@ { void *ans = NULL; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -1412,7 +1412,7 @@ { void *ans = NULL; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -1434,7 +1434,7 @@ { void *result = NULL; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -1452,7 +1452,7 @@ { void *result = NULL; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -1470,7 +1470,7 @@ { void *result = NULL; - if (TEST_FLAG(LOCKFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_LOCK, Element)) return (NULL); PIN_LOOP(Element); { @@ -1486,13 +1486,13 @@ */ static void *ChangePadSquare(ElementTypePtr Element, PadTypePtr Pad) { - if (TEST_FLAG(LOCKFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (NULL); ErasePad(Pad); AddObjectToClearPolyUndoList(PCB_TYPE_PAD, Element, Pad, Pad, false); RestoreToPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad); AddObjectToFlagUndoList(PCB_TYPE_PAD, Element, Pad, Pad); - TOGGLE_FLAG(SQUAREFLAG, Pad); + TOGGLE_FLAG(PCB_FLAG_SQUARE, Pad); AddObjectToClearPolyUndoList(PCB_TYPE_PAD, Element, Pad, Pad, true); ClearFromPolygon(PCB->Data, PCB_TYPE_PAD, Element, Pad); DrawPad(Pad); @@ -1505,7 +1505,7 @@ static void *SetPadSquare(ElementTypePtr Element, PadTypePtr Pad) { - if (TEST_FLAG(LOCKFLAG, Pad) || TEST_FLAG(SQUAREFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pad) || TEST_FLAG(PCB_FLAG_SQUARE, Pad)) return (NULL); return (ChangePadSquare(Element, Pad)); @@ -1518,7 +1518,7 @@ static void *ClrPadSquare(ElementTypePtr Element, PadTypePtr Pad) { - if (TEST_FLAG(LOCKFLAG, Pad) || !TEST_FLAG(SQUAREFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pad) || !TEST_FLAG(PCB_FLAG_SQUARE, Pad)) return (NULL); return (ChangePadSquare(Element, Pad)); @@ -1530,7 +1530,7 @@ */ static void *ChangeViaSquare(PinTypePtr Via) { - if (TEST_FLAG(LOCKFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); EraseVia(Via); AddObjectToClearPolyUndoList(PCB_TYPE_VIA, NULL, Via, Via, false); @@ -1538,9 +1538,9 @@ AddObjectToFlagUndoList(PCB_TYPE_VIA, NULL, Via, Via); ASSIGN_SQUARE(Absolute, Via); if (Absolute == 0) - CLEAR_FLAG(SQUAREFLAG, Via); + CLEAR_FLAG(PCB_FLAG_SQUARE, Via); else - SET_FLAG(SQUAREFLAG, Via); + SET_FLAG(PCB_FLAG_SQUARE, Via); SetPinBoundingBox(Via); AddObjectToClearPolyUndoList(PCB_TYPE_VIA, NULL, Via, Via, true); ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, NULL, Via); @@ -1553,7 +1553,7 @@ */ static void *ChangePinSquare(ElementTypePtr Element, PinTypePtr Pin) { - if (TEST_FLAG(LOCKFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); ErasePin(Pin); AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, false); @@ -1561,9 +1561,9 @@ AddObjectToFlagUndoList(PCB_TYPE_PIN, Element, Pin, Pin); ASSIGN_SQUARE(Absolute, Pin); if (Absolute == 0) - CLEAR_FLAG(SQUAREFLAG, Pin); + CLEAR_FLAG(PCB_FLAG_SQUARE, Pin); else - SET_FLAG(SQUAREFLAG, Pin); + SET_FLAG(PCB_FLAG_SQUARE, Pin); SetPinBoundingBox(Pin); AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, true); ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin); @@ -1576,7 +1576,7 @@ */ static void *SetPinSquare(ElementTypePtr Element, PinTypePtr Pin) { - if (TEST_FLAG(LOCKFLAG, Pin) || TEST_FLAG(SQUAREFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || TEST_FLAG(PCB_FLAG_SQUARE, Pin)) return (NULL); return (ChangePinSquare(Element, Pin)); @@ -1587,7 +1587,7 @@ */ static void *ClrPinSquare(ElementTypePtr Element, PinTypePtr Pin) { - if (TEST_FLAG(LOCKFLAG, Pin) || !TEST_FLAG(SQUAREFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || !TEST_FLAG(PCB_FLAG_SQUARE, Pin)) return (NULL); return (ChangePinSquare(Element, Pin)); @@ -1598,13 +1598,13 @@ */ static void *ChangeViaOctagon(PinTypePtr Via) { - if (TEST_FLAG(LOCKFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (NULL); EraseVia(Via); AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, false); RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via); AddObjectToFlagUndoList(PCB_TYPE_VIA, Via, Via, Via); - TOGGLE_FLAG(OCTAGONFLAG, Via); + TOGGLE_FLAG(PCB_FLAG_OCTAGON, Via); AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, true); ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via); DrawVia(Via); @@ -1616,7 +1616,7 @@ */ static void *SetViaOctagon(PinTypePtr Via) { - if (TEST_FLAG(LOCKFLAG, Via) || TEST_FLAG(OCTAGONFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via) || TEST_FLAG(PCB_FLAG_OCTAGON, Via)) return (NULL); return (ChangeViaOctagon(Via)); @@ -1627,7 +1627,7 @@ */ static void *ClrViaOctagon(PinTypePtr Via) { - if (TEST_FLAG(LOCKFLAG, Via) || !TEST_FLAG(OCTAGONFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via) || !TEST_FLAG(PCB_FLAG_OCTAGON, Via)) return (NULL); return (ChangeViaOctagon(Via)); @@ -1638,13 +1638,13 @@ */ static void *ChangePinOctagon(ElementTypePtr Element, PinTypePtr Pin) { - if (TEST_FLAG(LOCKFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin)) return (NULL); ErasePin(Pin); AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, false); RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin); AddObjectToFlagUndoList(PCB_TYPE_PIN, Element, Pin, Pin); - TOGGLE_FLAG(OCTAGONFLAG, Pin); + TOGGLE_FLAG(PCB_FLAG_OCTAGON, Pin); AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, true); ClearFromPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin); DrawPin(Pin); @@ -1656,7 +1656,7 @@ */ static void *SetPinOctagon(ElementTypePtr Element, PinTypePtr Pin) { - if (TEST_FLAG(LOCKFLAG, Pin) || TEST_FLAG(OCTAGONFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || TEST_FLAG(PCB_FLAG_OCTAGON, Pin)) return (NULL); return (ChangePinOctagon(Element, Pin)); @@ -1667,7 +1667,7 @@ */ static void *ClrPinOctagon(ElementTypePtr Element, PinTypePtr Pin) { - if (TEST_FLAG(LOCKFLAG, Pin) || !TEST_FLAG(OCTAGONFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pin) || !TEST_FLAG(PCB_FLAG_OCTAGON, Pin)) return (NULL); return (ChangePinOctagon(Element, Pin)); @@ -1678,7 +1678,7 @@ */ bool ChangeHole(PinTypePtr Via) { - if (TEST_FLAG(LOCKFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_LOCK, Via)) return (false); EraseVia(Via); AddObjectToFlagUndoList(PCB_TYPE_VIA, Via, Via, Via); @@ -1685,9 +1685,9 @@ AddObjectToMaskSizeUndoList(PCB_TYPE_VIA, Via, Via, Via); r_delete_entry(PCB->Data->via_tree, (BoxType *) Via); RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, Via, Via); - TOGGLE_FLAG(HOLEFLAG, Via); + TOGGLE_FLAG(PCB_FLAG_HOLE, Via); - if (TEST_FLAG(HOLEFLAG, Via)) { + if (TEST_FLAG(PCB_FLAG_HOLE, Via)) { /* A tented via becomes an minimally untented hole. An untented via retains its mask clearance. */ if (Via->Mask > Via->Thickness) { @@ -1714,11 +1714,11 @@ */ bool ChangePaste(PadTypePtr Pad) { - if (TEST_FLAG(LOCKFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_LOCK, Pad)) return (false); ErasePad(Pad); AddObjectToFlagUndoList(PCB_TYPE_PAD, Pad, Pad, Pad); - TOGGLE_FLAG(NOPASTEFLAG, Pad); + TOGGLE_FLAG(PCB_FLAG_NOPASTE, Pad); DrawPad(Pad); Draw(); return (true); @@ -1729,11 +1729,11 @@ */ static void *ChangePolyClear(LayerTypePtr Layer, PolygonTypePtr Polygon) { - if (TEST_FLAG(LOCKFLAG, Polygon)) + if (TEST_FLAG(PCB_FLAG_LOCK, Polygon)) return (NULL); AddObjectToClearPolyUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon, true); AddObjectToFlagUndoList(PCB_TYPE_POLYGON, Layer, Polygon, Polygon); - TOGGLE_FLAG(CLEARPOLYFLAG, Polygon); + TOGGLE_FLAG(PCB_FLAG_CLEARPOLY, Polygon); InitClip(PCB->Data, Layer, Polygon); DrawPolygon(Layer, Polygon); return (Polygon); @@ -1751,7 +1751,7 @@ if (PCB->PinOn && PCB->ElementOn) ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { change |= ChangeElementSide(element, 0); } } @@ -2046,7 +2046,7 @@ if (PCB->ViaOn) VIA_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, via)) + if (TEST_FLAG(PCB_FLAG_SELECTED, via)) change |= ChangeHole(via); } END_LOOP; @@ -2067,7 +2067,7 @@ ALLPAD_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, pad)) + if (TEST_FLAG(PCB_FLAG_SELECTED, pad)) change |= ChangePaste(pad); } ENDALL_LOOP; Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 2508) +++ trunk/src/change_act.c (revision 2509) @@ -198,7 +198,7 @@ void *ptr1, *ptr2, *ptr3; if ((type = SearchScreen(Crosshair.X, Crosshair.Y, CHANGESIZE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) - if (TEST_FLAG(LOCKFLAG, (PinTypePtr) ptr2)) + if (TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2)) Message(_("Sorry, the object is locked\n")); if (set_object(type, ptr1, ptr2, ptr3)) SetChangedFlag(true); @@ -410,7 +410,7 @@ case F_Object: { if (type != PCB_TYPE_NONE) - if (TEST_FLAG(LOCKFLAG, (PinTypePtr) ptr2)) + if (TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2)) Message(_("Sorry, the object is locked\n")); if (tostyle) { if (ChangeObject1stSize(type, ptr1, ptr2, ptr3, value, absolute)) Index: trunk/src/const.h =================================================================== --- trunk/src/const.h (revision 2508) +++ trunk/src/const.h (revision 2509) @@ -108,36 +108,36 @@ the numeric value followed by the symbolic name. %end-doc */ typedef enum { - NOFLAG = 0x00000, - PINFLAG = 0x00001, /*!< If set, this object is a pin. This flag is for internal use only. */ - VIAFLAG = 0x00002, /*!< Likewise, for vias. */ - FOUNDFLAG = 0x00004, /*!< If set, this object has been found by @code{FindConnection()}. */ - HOLEFLAG = 0x00008, /*!< For pins and vias, this flag means that the pin or via is a hole without a copper annulus. */ - NOPASTEFLAG = 0x00008, /*!< Pad should not receive solderpaste. This is to support fiducials */ - RATFLAG = 0x00010, /*!< If set for a line, indicates that this line is a rat line instead of a copper trace. */ - PININPOLYFLAG = 0x00010, /*!< For pins and pads, this flag is used internally to indicate that the pin or pad overlaps a polygon on some layer.*/ - CLEARPOLYFLAG = 0x00010, /*!< For polygons, this flag means that pins and vias will normally clear these polygons (thus, thermals are required for electrical connection). When clear, polygons will solidly connect to pins and vias. */ - HIDENAMEFLAG = 0x00010, /*!< For elements, when set the name of the element is hidden. */ - DISPLAYNAMEFLAG = 0x00020, /*!< For elements, when set the names of pins are shown. */ - CLEARLINEFLAG = 0x00020, /*!< For lines and arcs, the line/arc will clear polygons instead of connecting to them. */ - FULLPOLYFLAG = 0x00020, /*!< For polygons, the full polygon is drawn (i.e. all parts instead of only the biggest one). */ - SELECTEDFLAG = 0x00040, /*!< Set when the object is selected. */ - ONSOLDERFLAG = 0x00080, /*!< For elements and pads, indicates that they are on the solder side. */ - AUTOFLAG = 0x00080, /*!< For lines and vias, indicates that these were created by the autorouter. */ - SQUAREFLAG = 0x00100, /*!< For pins and pads, indicates a square (vs round) pin/pad. */ - RUBBERENDFLAG = 0x00200, /*!< For lines, used internally for rubber band moves: indicates one end already rubber banding. */ - WARNFLAG = 0x00200, /*!< For pins, vias, and pads, set to indicate a warning. */ - USETHERMALFLAG = 0x00400, /*!< Obsolete, indicates that pins/vias should be drawn with thermal fingers. */ - ONSILKFLAG = 0x00400, /*!< Obsolete, old files used this to indicate lines drawn on silk. (Used by io_pcb for compatibility.) */ - OCTAGONFLAG = 0x00800, /*!< Draw pins and vias as octagons. */ - DRCFLAG = 0x01000, /*!< Set for objects that fail DRC: flag like FOUND flag for DRC checking. */ - LOCKFLAG = 0x02000, /*!< Set for locked objects. */ - EDGE2FLAG = 0x04000, /*!< For pads, indicates that the second point is closer to the edge. For pins, indicates that the pin is closer to a horizontal edge and thus pinout text should be vertical. (Padr.Point2 is closer to outside edge also pinout text for pins is vertical) */ - VISITFLAG = 0x08000, /*!< marker to avoid re-visiting an object */ - NONETLISTFLAG = 0x10000, /* element is not on the netlist and should not interfere with the netlist */ - MINCUTFLAG = 0x20000, /* used by the mincut short find code */ - ONPOINTFLAG = 0x40000, /*!< crosshair is on line point or arc point */ -/* NOCOPY_FLAGS = (FOUNDFLAG | CONNECTEDFLAG | ONPOINTFLAG)*/ + PCB_FLAG_NO = 0x00000, + PCB_FLAG_PIN = 0x00001, /*!< If set, this object is a pin. This flag is for internal use only. */ + PCB_FLAG_VIA = 0x00002, /*!< Likewise, for vias. */ + PCB_FLAG_FOUND = 0x00004, /*!< If set, this object has been found by @code{FindConnection()}. */ + PCB_FLAG_HOLE = 0x00008, /*!< For pins and vias, this flag means that the pin or via is a hole without a copper annulus. */ + PCB_FLAG_NOPASTE = 0x00008, /*!< Pad should not receive solderpaste. This is to support fiducials */ + PCB_FLAG_RAT = 0x00010, /*!< If set for a line, indicates that this line is a rat line instead of a copper trace. */ + PCB_FLAG_PININPOLY = 0x00010, /*!< For pins and pads, this flag is used internally to indicate that the pin or pad overlaps a polygon on some layer.*/ + PCB_FLAG_CLEARPOLY = 0x00010, /*!< For polygons, this flag means that pins and vias will normally clear these polygons (thus, thermals are required for electrical connection). When clear, polygons will solidly connect to pins and vias. */ + PCB_FLAG_HIDENAME = 0x00010, /*!< For elements, when set the name of the element is hidden. */ + PCB_FLAG_DISPLAYNAME = 0x00020, /*!< For elements, when set the names of pins are shown. */ + PCB_FLAG_CLEARLINE = 0x00020, /*!< For lines and arcs, the line/arc will clear polygons instead of connecting to them. */ + PCB_FLAG_FULLPOLY = 0x00020, /*!< For polygons, the full polygon is drawn (i.e. all parts instead of only the biggest one). */ + PCB_FLAG_SELECTED = 0x00040, /*!< Set when the object is selected. */ + PCB_FLAG_ONSOLDER = 0x00080, /*!< For elements and pads, indicates that they are on the solder side. */ + PCB_FLAG_AUTO = 0x00080, /*!< For lines and vias, indicates that these were created by the autorouter. */ + PCB_FLAG_SQUARE = 0x00100, /*!< For pins and pads, indicates a square (vs round) pin/pad. */ + PCB_FLAG_RUBBEREND = 0x00200, /*!< For lines, used internally for rubber band moves: indicates one end already rubber banding. */ + PCB_FLAG_WARN = 0x00200, /*!< For pins, vias, and pads, set to indicate a warning. */ + PCB_FLAG_USETHERMAL = 0x00400, /*!< Obsolete, indicates that pins/vias should be drawn with thermal fingers. */ + PCB_FLAG_ONSILK = 0x00400, /*!< Obsolete, old files used this to indicate lines drawn on silk. (Used by io_pcb for compatibility.) */ + PCB_FLAG_OCTAGON = 0x00800, /*!< Draw pins and vias as octagons. */ + PCB_FLAG_DRC = 0x01000, /*!< Set for objects that fail DRC: flag like FOUND flag for DRC checking. */ + PCB_FLAG_LOCK = 0x02000, /*!< Set for locked objects. */ + PCB_FLAG_EDGE2 = 0x04000, /*!< For pads, indicates that the second point is closer to the edge. For pins, indicates that the pin is closer to a horizontal edge and thus pinout text should be vertical. (Padr.Point2 is closer to outside edge also pinout text for pins is vertical) */ + PCB_FLAG_VISIT = 0x08000, /*!< marker to avoid re-visiting an object */ + PCB_FLAG_NONETLIST = 0x10000, /* element is not on the netlist and should not interfere with the netlist */ + PCB_FLAG_MINCUT = 0x20000, /* used by the mincut short find code */ + PCB_FLAG_ONPOINT = 0x40000, /*!< crosshair is on line point or arc point */ +/* PCB_FLAG_NOCOPY = (PCB_FLAG_FOUND | CONNECTEDFLAG | PCB_FLAG_ONPOINT)*/ } pcb_flag_t; /* --------------------------------------------------------------------------- Index: trunk/src/copy.c =================================================================== --- trunk/src/copy.c (revision 2508) +++ trunk/src/copy.c (revision 2509) @@ -92,7 +92,7 @@ } SetPolygonBoundingBox(Dest); Dest->Flags = Src->Flags; - CLEAR_FLAG(FOUNDFLAG, Dest); + CLEAR_FLAG(PCB_FLAG_FOUND, Dest); return (Dest); } @@ -110,12 +110,12 @@ /* both coordinates and flags are the same */ Dest = CreateNewElement(Data, Dest, &PCB->Font, - MaskFlags(Src->Flags, FOUNDFLAG), + MaskFlags(Src->Flags, PCB_FLAG_FOUND), DESCRIPTION_NAME(Src), NAMEONPCB_NAME(Src), VALUE_NAME(Src), DESCRIPTION_TEXT(Src).X + dx, DESCRIPTION_TEXT(Src).Y + dy, DESCRIPTION_TEXT(Src).Direction, - DESCRIPTION_TEXT(Src).Scale, MaskFlags(DESCRIPTION_TEXT(Src).Flags, FOUNDFLAG), uniqueName); + DESCRIPTION_TEXT(Src).Scale, MaskFlags(DESCRIPTION_TEXT(Src).Flags, PCB_FLAG_FOUND), uniqueName); /* abort on error */ if (!Dest) @@ -130,7 +130,7 @@ PIN_LOOP(Src); { CreateNewPin(Dest, pin->X + dx, pin->Y + dy, pin->Thickness, - pin->Clearance, pin->Mask, pin->DrillingHole, pin->Name, pin->Number, MaskFlags(pin->Flags, FOUNDFLAG)); + pin->Clearance, pin->Mask, pin->DrillingHole, pin->Name, pin->Number, MaskFlags(pin->Flags, PCB_FLAG_FOUND)); } END_LOOP; PAD_LOOP(Src); @@ -137,7 +137,7 @@ { CreateNewPad(Dest, pad->Point1.X + dx, pad->Point1.Y + dy, pad->Point2.X + dx, pad->Point2.Y + dy, pad->Thickness, - pad->Clearance, pad->Mask, pad->Name, pad->Number, MaskFlags(pad->Flags, FOUNDFLAG)); + pad->Clearance, pad->Mask, pad->Name, pad->Number, MaskFlags(pad->Flags, PCB_FLAG_FOUND)); } END_LOOP; ARC_LOOP(Src); @@ -164,7 +164,7 @@ PinTypePtr via; via = CreateNewVia(PCB->Data, Via->X + DeltaX, Via->Y + DeltaY, - Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, FOUNDFLAG)); + Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, PCB_FLAG_FOUND)); if (!via) return (via); DrawVia(via); @@ -182,7 +182,7 @@ line = CreateDrawnLineOnLayer(Layer, Line->Point1.X + DeltaX, Line->Point1.Y + DeltaY, Line->Point2.X + DeltaX, - Line->Point2.Y + DeltaY, Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, FOUNDFLAG)); + Line->Point2.Y + DeltaY, Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, PCB_FLAG_FOUND)); if (!line) return (line); if (Line->Number) @@ -201,7 +201,7 @@ arc = CreateNewArcOnLayer(Layer, Arc->X + DeltaX, Arc->Y + DeltaY, Arc->Width, Arc->Height, Arc->StartAngle, - Arc->Delta, Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, FOUNDFLAG)); + Arc->Delta, Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, PCB_FLAG_FOUND)); if (!arc) return (arc); DrawArc(Layer, arc); @@ -217,7 +217,7 @@ TextTypePtr text; text = CreateNewText(Layer, &PCB->Font, Text->X + DeltaX, - Text->Y + DeltaY, Text->Direction, Text->Scale, Text->TextString, MaskFlags(Text->Flags, FOUNDFLAG)); + Text->Y + DeltaY, Text->Direction, Text->Scale, Text->TextString, MaskFlags(Text->Flags, PCB_FLAG_FOUND)); DrawText(Layer, text); AddObjectToCreateUndoList(PCB_TYPE_TEXT, Layer, text, text); return (text); Index: trunk/src/create.c =================================================================== --- trunk/src/create.c (revision 2508) +++ trunk/src/create.c (revision 2509) @@ -240,8 +240,8 @@ Via->Name = STRDUP(Name); Via->Flags = Flags; - CLEAR_FLAG(WARNFLAG, Via); - SET_FLAG(VIAFLAG, Via); + CLEAR_FLAG(PCB_FLAG_WARN, Via); + SET_FLAG(PCB_FLAG_VIA, Via); Via->ID = ID++; /* @@ -248,7 +248,7 @@ * don't complain about MIN_PINORVIACOPPER on a mounting hole (pure * hole) */ - if (!TEST_FLAG(HOLEFLAG, Via) && (Via->Thickness < Via->DrillingHole + MIN_PINORVIACOPPER)) { + if (!TEST_FLAG(PCB_FLAG_HOLE, Via) && (Via->Thickness < Via->DrillingHole + MIN_PINORVIACOPPER)) { Via->Thickness = Via->DrillingHole + MIN_PINORVIACOPPER; Message(_("%m+Increased via thickness to %$mS to allow enough copper" " at %$mD.\n"), conf_core.editor.grid_unit->allow, Via->Thickness, Via->X, Via->Y); @@ -290,7 +290,7 @@ /* remove unnecessary line points */ if (line->Thickness == i->Thickness /* don't merge lines if the clear flags differ */ - && TEST_FLAG(CLEARLINEFLAG, line) == TEST_FLAG(CLEARLINEFLAG, i)) { + && TEST_FLAG(PCB_FLAG_CLEARLINE, line) == TEST_FLAG(PCB_FLAG_CLEARLINE, i)) { if (line->Point1.X == i->X1 && line->Point1.Y == i->Y1) { i->test.Point1.X = line->Point2.X; i->test.Point1.Y = line->Point2.Y; @@ -397,7 +397,7 @@ return (Line); Line->ID = ID++; Line->Flags = Flags; - CLEAR_FLAG(RATFLAG, Line); + CLEAR_FLAG(PCB_FLAG_RAT, Line); Line->Thickness = Thickness; Line->Clearance = Clearance; Line->Point1.X = X1; @@ -427,7 +427,7 @@ Line->ID = ID++; Line->Flags = Flags; - SET_FLAG(RATFLAG, Line); + SET_FLAG(PCB_FLAG_RAT, Line); Line->Thickness = Thickness; Line->Point1.X = X1; Line->Point1.Y = Y1; @@ -693,8 +693,8 @@ pin->Name = STRDUP(Name); pin->Number = STRDUP(Number); pin->Flags = Flags; - CLEAR_FLAG(WARNFLAG, pin); - SET_FLAG(PINFLAG, pin); + CLEAR_FLAG(PCB_FLAG_WARN, pin); + SET_FLAG(PCB_FLAG_PIN, pin); pin->ID = ID++; pin->Element = Element; @@ -716,7 +716,7 @@ conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole); pin->DrillingHole = DrillingHole; } - else if (!TEST_FLAG(HOLEFLAG, pin) + else if (!TEST_FLAG(PCB_FLAG_HOLE, pin) && (pin->DrillingHole > pin->Thickness - MIN_PINORVIACOPPER)) { Message(_("%m+Did not map pin #%s (%s) drill hole because %$mS does not leave enough copper\n"), conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole); @@ -764,7 +764,7 @@ pad->Name = STRDUP(Name); pad->Number = STRDUP(Number); pad->Flags = Flags; - CLEAR_FLAG(WARNFLAG, pad); + CLEAR_FLAG(PCB_FLAG_WARN, pad); pad->ID = ID++; pad->Element = Element; return (pad); @@ -843,9 +843,9 @@ { RubberbandTypePtr ptr = GetRubberbandMemory(); - /* we toggle the RUBBERENDFLAG of the line to determine if */ + /* we toggle the PCB_FLAG_RUBBEREND of the line to determine if */ /* both points are being moved. */ - TOGGLE_FLAG(RUBBERENDFLAG, Line); + TOGGLE_FLAG(PCB_FLAG_RUBBEREND, Line); ptr->Layer = Layer; ptr->Line = Line; ptr->MovedPoint = MovedPoint; Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 2508) +++ trunk/src/crosshair.c (revision 2509) @@ -249,7 +249,7 @@ /* pads */ PAD_LOOP(Element); { - if (PCB->InvisibleObjectsOn || (TEST_FLAG(ONSOLDERFLAG, pad) != 0) == conf_core.editor.show_solder_side) { + if (PCB->InvisibleObjectsOn || (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) != 0) == conf_core.editor.show_solder_side) { /* Make a copy of the pad structure, moved to the correct position */ PadType moved_pad = *pad; moved_pad.Point1.X += DX; @@ -460,10 +460,10 @@ while (i) { PointTypePtr point1, point2; - if (TEST_FLAG(VIAFLAG, ptr->Line)) { + if (TEST_FLAG(PCB_FLAG_VIA, ptr->Line)) { /* this is a rat going to a polygon. do not draw for rubberband */ ; } - else if (TEST_FLAG(RUBBERENDFLAG, ptr->Line)) { + else if (TEST_FLAG(PCB_FLAG_RUBBEREND, ptr->Line)) { /* 'point1' is always the fix-point */ if (ptr->MovedPoint == &ptr->Line->Point1) { point1 = &ptr->Line->Point2; @@ -727,7 +727,7 @@ op.type = PCB_TYPE_LINE; op.obj.line = line; vtop_append(&crosshair->onpoint_objs, op); - SET_FLAG(ONPOINTFLAG, (AnyObjectType *) line); + SET_FLAG(PCB_FLAG_ONPOINT, (AnyObjectType *) line); DrawLine(NULL, line); return R_DIR_FOUND_CONTINUE; } @@ -757,7 +757,7 @@ op.type = PCB_TYPE_ARC; op.obj.arc = arc; vtop_append(&crosshair->onpoint_objs, op); - SET_FLAG(ONPOINTFLAG, (AnyObjectType *) arc); + SET_FLAG(PCB_FLAG_ONPOINT, (AnyObjectType *) arc); DrawArc(NULL, arc); return R_DIR_FOUND_CONTINUE; } @@ -846,7 +846,7 @@ if (onpoint_find(&crosshair->onpoint_objs, op->obj.any) != NULL) continue; - CLEAR_FLAG(ONPOINTFLAG, (AnyObjectType *) op->obj.any); + CLEAR_FLAG(PCB_FLAG_ONPOINT, (AnyObjectType *) op->obj.any); DrawLineOrArc(op->type, op->obj.any); redraw = true; } @@ -1058,7 +1058,7 @@ /* find layer groups of the component side and solder side */ SLayer = GetLayerGroupNumberByNumber(solder_silk_layer); CLayer = GetLayerGroupNumberByNumber(component_silk_layer); - desired_group = TEST_FLAG(ONSOLDERFLAG, pad) ? SLayer : CLayer; + desired_group = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer; GROUP_LOOP(PCB->Data, desired_group); { @@ -1141,7 +1141,7 @@ ans = SearchScreenGridSlop(Crosshair.X, Crosshair.Y, PCB_TYPE_LINE_POINT, &ptr1, &ptr2, &ptr3); if (ans == PCB_TYPE_NONE) hid_action("PointCursor"); - else if (!TEST_FLAG(SELECTEDFLAG, (LineType *) ptr2)) + else if (!TEST_FLAG(PCB_FLAG_SELECTED, (LineType *) ptr2)) hid_actionl("PointCursor", "True", NULL); } Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 2508) +++ trunk/src/draw.c (revision 2509) @@ -103,15 +103,15 @@ char buf[sizeof("#XXXXXX")]; if (Type == PCB_TYPE_VIA) { - if (!doing_pinout && TEST_FLAG(WARNFLAG | SELECTEDFLAG | FOUNDFLAG, Pin)) { - if (TEST_FLAG(WARNFLAG, Pin)) + if (!doing_pinout && TEST_FLAG(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, Pin)) { + if (TEST_FLAG(PCB_FLAG_WARN, Pin)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG, Pin)) + else if (TEST_FLAG(PCB_FLAG_SELECTED, Pin)) color = PCB->ViaSelectedColor; else color = PCB->ConnectedColor; - if (TEST_FLAG(ONPOINTFLAG, Pin)) { + if (TEST_FLAG(PCB_FLAG_ONPOINT, Pin)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -121,15 +121,15 @@ color = PCB->ViaColor; } else { - if (!doing_pinout && TEST_FLAG(WARNFLAG | SELECTEDFLAG | FOUNDFLAG, Pin)) { - if (TEST_FLAG(WARNFLAG, Pin)) + if (!doing_pinout && TEST_FLAG(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, Pin)) { + if (TEST_FLAG(PCB_FLAG_WARN, Pin)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG, Pin)) + else if (TEST_FLAG(PCB_FLAG_SELECTED, Pin)) color = PCB->PinSelectedColor; else color = PCB->ConnectedColor; - if (TEST_FLAG(ONPOINTFLAG, Pin)) { + if (TEST_FLAG(PCB_FLAG_ONPOINT, Pin)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -194,7 +194,7 @@ strcpy(buff, pn); text.TextString = buff; - vert = TEST_FLAG(EDGE2FLAG, pv); + vert = TEST_FLAG(PCB_FLAG_EDGE2, pv); if (vert) { box.X1 = pv->X - pv->Thickness / 2 + conf_core.appearance.pinout.text_offset_y; @@ -228,7 +228,7 @@ else gui->fill_pcb_pv(Output.fgGC, Output.bgGC, pv, draw_hole, false); - if (!TEST_FLAG(HOLEFLAG, pv) && TEST_FLAG(DISPLAYNAMEFLAG, pv)) + if (!TEST_FLAG(PCB_FLAG_HOLE, pv) && TEST_FLAG(PCB_FLAG_DISPLAYNAME, pv)) _draw_pv_name(pv); } @@ -322,10 +322,10 @@ if (doing_pinout) gui->set_color(Output.fgGC, PCB->PinColor); - else if (TEST_FLAG(WARNFLAG | SELECTEDFLAG | FOUNDFLAG, pad)) { - if (TEST_FLAG(WARNFLAG, pad)) + else if (TEST_FLAG(PCB_FLAG_WARN | PCB_FLAG_SELECTED | PCB_FLAG_FOUND, pad)) { + if (TEST_FLAG(PCB_FLAG_WARN, pad)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG, pad)) + else if (TEST_FLAG(PCB_FLAG_SELECTED, pad)) color = PCB->PinSelectedColor; else color = PCB->ConnectedColor; @@ -335,7 +335,7 @@ else color = PCB->InvisibleObjectsColor; - if (TEST_FLAG(ONPOINTFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_ONPOINT, pad)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -346,7 +346,7 @@ _draw_pad(Output.fgGC, pad, false, false); - if (doing_pinout || TEST_FLAG(DISPLAYNAMEFLAG, pad)) + if (doing_pinout || TEST_FLAG(PCB_FLAG_DISPLAYNAME, pad)) draw_pad_name(pad); } @@ -362,15 +362,15 @@ static void draw_element_name(ElementType * element) { - if ((conf_core.editor.hide_names && gui->gui) || TEST_FLAG(HIDENAMEFLAG, element)) + if ((conf_core.editor.hide_names && gui->gui) || TEST_FLAG(PCB_FLAG_HIDENAME, element)) return; if (doing_pinout || doing_assy) gui->set_color(Output.fgGC, PCB->ElementColor); - else if (TEST_FLAG(SELECTEDFLAG, &ELEMENT_TEXT(PCB, element))) + else if (TEST_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element))) gui->set_color(Output.fgGC, PCB->ElementSelectedColor); else if (FRONT(element)) { /* TODO: why do we test for Name's flag here? */ - if (TEST_FLAG(NONETLISTFLAG, element)) + if (TEST_FLAG(PCB_FLAG_NONETLIST, element)) gui->set_color(Output.fgGC, PCB->ElementColor_nonetlist); else gui->set_color(Output.fgGC, PCB->ElementColor); @@ -388,7 +388,7 @@ ElementTypePtr element = (ElementTypePtr) text->Element; int *side = cl; - if (TEST_FLAG(HIDENAMEFLAG, element)) + if (TEST_FLAG(PCB_FLAG_HIDENAME, element)) return R_DIR_NOT_FOUND; if (ON_SIDE(element, *side)) @@ -426,11 +426,11 @@ const char *color; char buf[sizeof("#XXXXXX")]; - if ((plated == 0 && !TEST_FLAG(HOLEFLAG, pv)) || (plated == 1 && TEST_FLAG(HOLEFLAG, pv))) + if ((plated == 0 && !TEST_FLAG(PCB_FLAG_HOLE, pv)) || (plated == 1 && TEST_FLAG(PCB_FLAG_HOLE, pv))) return R_DIR_FOUND_CONTINUE; if (conf_core.editor.thin_draw) { - if (!TEST_FLAG(HOLEFLAG, pv)) { + if (!TEST_FLAG(PCB_FLAG_HOLE, pv)) { gui->set_line_cap(Output.fgGC, Round_Cap); gui->set_line_width(Output.fgGC, 0); gui->draw_arc(Output.fgGC, pv->X, pv->Y, pv->DrillingHole / 2, pv->DrillingHole / 2, 0, 360); @@ -439,15 +439,15 @@ else gui->fill_circle(Output.bgGC, pv->X, pv->Y, pv->DrillingHole / 2); - if (TEST_FLAG(HOLEFLAG, pv)) { - if (TEST_FLAG(WARNFLAG, pv)) + if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { + if (TEST_FLAG(PCB_FLAG_WARN, pv)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG, pv)) + else if (TEST_FLAG(PCB_FLAG_SELECTED, pv)) color = PCB->ViaSelectedColor; else color = conf_core.appearance.color.black; - if (TEST_FLAG(ONPOINTFLAG, pv)) { + if (TEST_FLAG(PCB_FLAG_ONPOINT, pv)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -490,10 +490,10 @@ const char *color; char buf[sizeof("#XXXXXX")]; - if (TEST_FLAG(WARNFLAG, line)) + if (TEST_FLAG(PCB_FLAG_WARN, line)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG | FOUNDFLAG, line)) { - if (TEST_FLAG(SELECTEDFLAG, line)) + else if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, line)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, line)) color = layer->SelectedColor; else color = PCB->ConnectedColor; @@ -501,7 +501,7 @@ else color = layer->Color; - if (TEST_FLAG(ONPOINTFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_ONPOINT, line)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -521,8 +521,8 @@ { RatType *rat = (RatType *) b; - if (TEST_FLAG(SELECTEDFLAG | FOUNDFLAG, rat)) { - if (TEST_FLAG(SELECTEDFLAG, rat)) + if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, rat)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, rat)) gui->set_color(Output.fgGC, PCB->RatSelectedColor); else gui->set_color(Output.fgGC, PCB->ConnectedColor); @@ -532,8 +532,8 @@ if (conf_core.appearance.rat_thickness < 20) rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; - /* rats.c set VIAFLAG if this rat goes to a containing poly: draw a donut */ - if (TEST_FLAG(VIAFLAG, rat)) { + /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ + if (TEST_FLAG(PCB_FLAG_VIA, rat)) { int w = rat->Thickness; if (conf_core.editor.thin_draw) @@ -566,10 +566,10 @@ const char *color; char buf[sizeof("#XXXXXX")]; - if (TEST_FLAG(WARNFLAG, arc)) + if (TEST_FLAG(PCB_FLAG_WARN, arc)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG | FOUNDFLAG, arc)) { - if (TEST_FLAG(SELECTEDFLAG, arc)) + else if (TEST_FLAG(PCB_FLAG_SELECTED | PCB_FLAG_FOUND, arc)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, arc)) color = layer->SelectedColor; else color = PCB->ConnectedColor; @@ -577,7 +577,7 @@ else color = layer->Color; - if (TEST_FLAG(ONPOINTFLAG, arc)) { + if (TEST_FLAG(PCB_FLAG_ONPOINT, arc)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -597,7 +597,7 @@ /* set color and draw lines, arcs, text and pins */ if (doing_pinout || doing_assy) gui->set_color(Output.fgGC, PCB->ElementColor); - else if (TEST_FLAG(SELECTEDFLAG, element)) + else if (TEST_FLAG(PCB_FLAG_SELECTED, element)) gui->set_color(Output.fgGC, PCB->ElementSelectedColor); else if (FRONT(element)) gui->set_color(Output.fgGC, PCB->ElementColor); @@ -788,7 +788,7 @@ if (pinlist_length(&e->Pin) != 0) { PinType *pin0 = pinlist_first(&e->Pin); - if (TEST_FLAG(HOLEFLAG, pin0)) + if (TEST_FLAG(PCB_FLAG_HOLE, pin0)) mark_size = MIN(mark_size, pin0->DrillingHole / 2); else mark_size = MIN(mark_size, pin0->Thickness / 2); @@ -812,7 +812,7 @@ * This provides a nice visual indication that it is locked that * works even for color blind users. */ - if (TEST_FLAG(LOCKFLAG, e)) { + if (TEST_FLAG(PCB_FLAG_LOCK, e)) { gui->draw_line(Output.fgGC, X, Y, X + 2 * mark_size, Y); gui->draw_line(Output.fgGC, X, Y, X, Y - 4 * mark_size); } @@ -878,13 +878,13 @@ if (!polygon->Clipped) return R_DIR_NOT_FOUND; - if (TEST_FLAG(WARNFLAG, polygon)) + if (TEST_FLAG(PCB_FLAG_WARN, polygon)) color = PCB->WarnColor; - else if (TEST_FLAG(SELECTEDFLAG, polygon)) + else if (TEST_FLAG(PCB_FLAG_SELECTED, polygon)) color = i->layer->SelectedColor; - else if (TEST_FLAG(FOUNDFLAG, polygon)) + else if (TEST_FLAG(PCB_FLAG_FOUND, polygon)) color = PCB->ConnectedColor; - else if (TEST_FLAG(ONPOINTFLAG, polygon)) { + else if (TEST_FLAG(PCB_FLAG_ONPOINT, polygon)) { assert(color != NULL); LightenColor(color, buf, 1.75); color = buf; @@ -899,7 +899,7 @@ gui->fill_pcb_polygon(Output.fgGC, polygon, i->drawn_area); /* If checking planes, thin-draw any pieces which have been clipped away */ - if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !TEST_FLAG(FULLPOLYFLAG, polygon)) { + if (gui->thindraw_pcb_polygon != NULL && conf_core.editor.check_planes && !TEST_FLAG(PCB_FLAG_FULLPOLY, polygon)) { PolygonType poly = *polygon; for (poly.Clipped = polygon->Clipped->f; poly.Clipped != polygon->Clipped; poly.Clipped = poly.Clipped->f) @@ -1006,7 +1006,7 @@ gui->set_color(Output.fgGC, PCB->ElementColor); ALLPAD_LOOP(PCB->Data); { - if (ON_SIDE(pad, side) && !TEST_FLAG(NOPASTEFLAG, pad) && pad->Mask > 0) { + if (ON_SIDE(pad, side) && !TEST_FLAG(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) { if (pad->Mask < pad->Thickness) _draw_pad(Output.fgGC, pad, true, true); else @@ -1038,7 +1038,7 @@ TextType *text = (TextType *) b; int min_silk_line; - if (TEST_FLAG(SELECTEDFLAG, text)) + if (TEST_FLAG(PCB_FLAG_SELECTED, text)) gui->set_color(Output.fgGC, layer->SelectedColor); else gui->set_color(Output.fgGC, layer->Color); @@ -1110,7 +1110,7 @@ static void GatherPVName(PinTypePtr Ptr) { BoxType box; - bool vert = TEST_FLAG(EDGE2FLAG, Ptr); + bool vert = TEST_FLAG(PCB_FLAG_EDGE2, Ptr); if (vert) { box.X1 = Ptr->X - Ptr->Thickness / 2 + conf_core.appearance.pinout.text_offset_y; @@ -1193,7 +1193,7 @@ /* the labels of SMD objects on the bottom * side haven't been swapped yet, only their offset */ - if (TEST_FLAG(ONSOLDERFLAG, Text)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, Text)) { newline.Point1.X = SWAP_SIGN_X(newline.Point1.X); newline.Point1.Y = SWAP_SIGN_Y(newline.Point1.Y); newline.Point2.X = SWAP_SIGN_X(newline.Point2.X); @@ -1242,7 +1242,7 @@ void DrawVia(PinTypePtr Via) { AddPart(Via); - if (!TEST_FLAG(HOLEFLAG, Via) && TEST_FLAG(DISPLAYNAMEFLAG, Via)) + if (!TEST_FLAG(PCB_FLAG_HOLE, Via) && TEST_FLAG(PCB_FLAG_DISPLAYNAME, Via)) DrawViaName(Via); } @@ -1260,7 +1260,7 @@ void DrawPin(PinTypePtr Pin) { AddPart(Pin); - if ((!TEST_FLAG(HOLEFLAG, Pin) && TEST_FLAG(DISPLAYNAMEFLAG, Pin)) + if ((!TEST_FLAG(PCB_FLAG_HOLE, Pin) && TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin)) || doing_pinout) DrawPinName(Pin); } @@ -1279,7 +1279,7 @@ void DrawPad(PadTypePtr Pad) { AddPart(Pad); - if (doing_pinout || TEST_FLAG(DISPLAYNAMEFLAG, Pad)) + if (doing_pinout || TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad)) DrawPadName(Pad); } @@ -1306,8 +1306,8 @@ { if (conf_core.appearance.rat_thickness < 20) Rat->Thickness = pixel_slop * conf_core.appearance.rat_thickness; - /* rats.c set VIAFLAG if this rat goes to a containing poly: draw a donut */ - if (TEST_FLAG(VIAFLAG, Rat)) { + /* rats.c set PCB_FLAG_VIA if this rat goes to a containing poly: draw a donut */ + if (TEST_FLAG(PCB_FLAG_VIA, Rat)) { Coord w = Rat->Thickness; BoxType b; @@ -1362,7 +1362,7 @@ */ void DrawElementName(ElementTypePtr Element) { - if (TEST_FLAG(HIDENAMEFLAG, Element)) + if (TEST_FLAG(PCB_FLAG_HIDENAME, Element)) return; DrawText(NULL, &ELEMENT_TEXT(PCB, Element)); } @@ -1419,7 +1419,7 @@ void EraseVia(PinTypePtr Via) { AddPart(Via); - if (TEST_FLAG(DISPLAYNAMEFLAG, Via)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Via)) EraseViaName(Via); EraseFlags(&Via->Flags); } @@ -1429,7 +1429,7 @@ */ void EraseRat(RatTypePtr Rat) { - if (TEST_FLAG(VIAFLAG, Rat)) { + if (TEST_FLAG(PCB_FLAG_VIA, Rat)) { Coord w = Rat->Thickness; BoxType b; @@ -1460,7 +1460,7 @@ void ErasePad(PadTypePtr Pad) { AddPart(Pad); - if (TEST_FLAG(DISPLAYNAMEFLAG, Pad)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pad)) ErasePadName(Pad); EraseFlags(&Pad->Flags); } @@ -1479,7 +1479,7 @@ void ErasePin(PinTypePtr Pin) { AddPart(Pin); - if (TEST_FLAG(DISPLAYNAMEFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, Pin)) ErasePinName(Pin); EraseFlags(&Pin->Flags); } @@ -1577,7 +1577,7 @@ void EraseElementName(ElementTypePtr Element) { pcb_trace("EraseElementName enter %p {\n", Element); - if (TEST_FLAG(HIDENAMEFLAG, Element)) { + if (TEST_FLAG(PCB_FLAG_HIDENAME, Element)) { pcb_trace("EE nope\n}\n", Element); return; } Index: trunk/src/draw_fab.c =================================================================== --- trunk/src/draw_fab.c (revision 2508) +++ trunk/src/draw_fab.c (revision 2509) @@ -206,7 +206,7 @@ unplated_sym = --ds; gui->set_color(gc, PCB->PinColor); for (i = 0; i < drill->PinN; i++) - drill_sym(gc, TEST_FLAG(HOLEFLAG, drill->Pin[i]) ? unplated_sym : plated_sym, drill->Pin[i]->X, drill->Pin[i]->Y); + drill_sym(gc, TEST_FLAG(PCB_FLAG_HOLE, drill->Pin[i]) ? unplated_sym : plated_sym, drill->Pin[i]->X, drill->Pin[i]->Y); if (plated_sym != -1) { drill_sym(gc, plated_sym, TEXT_SIZE, yoff + TEXT_SIZE / 4); text_at(gc, MIL_TO_COORD(1350), yoff, MIL_TO_COORD(2), "YES"); Index: trunk/src/drill.c =================================================================== --- trunk/src/drill.c (revision 2508) +++ trunk/src/drill.c (revision 2509) @@ -56,7 +56,7 @@ } else Drill->ViaCount++; - if (TEST_FLAG(HOLEFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_HOLE, Pin)) Drill->UnplatedCount++; } @@ -83,7 +83,7 @@ } else drill->ViaCount = 1; - if (TEST_FLAG(HOLEFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_HOLE, pin)) drill->UnplatedCount = 1; } Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 2508) +++ trunk/src/find.c (revision 2509) @@ -125,8 +125,8 @@ * some local identifiers */ static Coord Bloat = 0; -static int TheFlag = FOUNDFLAG; -static int OldFlag = FOUNDFLAG; +static int TheFlag = PCB_FLAG_FOUND; +static int OldFlag = PCB_FLAG_FOUND; static void *thing_ptr1, *thing_ptr2, *thing_ptr3; static int thing_type; find_callback_t find_callback = NULL; Index: trunk/src/find_deadcode.c =================================================================== --- trunk/src/find_deadcode.c (revision 2508) +++ trunk/src/find_deadcode.c (revision 2509) @@ -56,7 +56,7 @@ PadTypePtr pad = (PadTypePtr) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) + if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && LinePadIntersect(&i->line, pad)) longjmp(i->env, 1); return 0; Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 2508) +++ trunk/src/find_drc.c (revision 2509) @@ -279,7 +279,7 @@ doIsBad: AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon); - SET_FLAG(FOUNDFLAG, polygon); + SET_FLAG(PCB_FLAG_FOUND, polygon); DrawPolygon(layer, polygon); DrawObject(type, ptr1, ptr2); drcerr_count++; @@ -327,7 +327,7 @@ hid_action("LayersChanged"); InitConnectionLookup(); - TheFlag = FOUNDFLAG | DRCFLAG | SELECTEDFLAG; + TheFlag = PCB_FLAG_FOUND | PCB_FLAG_DRC | PCB_FLAG_SELECTED; if (ResetConnections(true)) { IncrementUndoSerialNumber(); @@ -340,7 +340,7 @@ { PIN_LOOP(element); { - if (!TEST_FLAG(DRCFLAG, pin) + if (!TEST_FLAG(PCB_FLAG_DRC, pin) && DRCFind(PCB_TYPE_PIN, (void *) element, (void *) pin, (void *) pin)) { IsBad = true; break; @@ -353,10 +353,10 @@ { /* count up how many pads have no solderpaste openings */ - if (TEST_FLAG(NOPASTEFLAG, pad)) + if (TEST_FLAG(PCB_FLAG_NOPASTE, pad)) nopastecnt++; - if (!TEST_FLAG(DRCFLAG, pad) + if (!TEST_FLAG(PCB_FLAG_DRC, pad) && DRCFind(PCB_TYPE_PAD, (void *) element, (void *) pad, (void *) pad)) { IsBad = true; break; @@ -370,7 +370,7 @@ if (!IsBad) VIA_LOOP(PCB->Data); { - if (!TEST_FLAG(DRCFLAG, via) + if (!TEST_FLAG(PCB_FLAG_DRC, via) && DRCFind(PCB_TYPE_VIA, (void *) via, (void *) via, (void *) via)) { IsBad = true; break; @@ -378,9 +378,9 @@ } END_LOOP; - TheFlag = (IsBad) ? DRCFLAG : (FOUNDFLAG | DRCFLAG | SELECTEDFLAG); + TheFlag = (IsBad) ? PCB_FLAG_DRC : (PCB_FLAG_FOUND | PCB_FLAG_DRC | PCB_FLAG_SELECTED); ResetConnections(false); - TheFlag = SELECTEDFLAG; + TheFlag = PCB_FLAG_SELECTED; /* check minimum widths and polygon clearances */ if (!IsBad) { COPPERLINE_LOOP(PCB->Data); @@ -451,7 +451,7 @@ PlowsPolygon(PCB->Data, PCB_TYPE_PIN, element, pin, drc_callback); if (IsBad) break; - if (!TEST_FLAG(HOLEFLAG, pin) && pin->Thickness - pin->DrillingHole < 2 * PCB->minRing) { + if (!TEST_FLAG(PCB_FLAG_HOLE, pin) && pin->Thickness - pin->DrillingHole < 2 * PCB->minRing) { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); SET_FLAG(TheFlag, pin); DrawPin(pin); @@ -536,7 +536,7 @@ PlowsPolygon(PCB->Data, PCB_TYPE_VIA, via, via, drc_callback); if (IsBad) break; - if (!TEST_FLAG(HOLEFLAG, via) && via->Thickness - via->DrillingHole < 2 * PCB->minRing) { + if (!TEST_FLAG(PCB_FLAG_HOLE, via) && via->Thickness - via->DrillingHole < 2 * PCB->minRing) { AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via); SET_FLAG(TheFlag, via); DrawVia(via); @@ -586,12 +586,12 @@ } FreeConnectionLookupMemory(); - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; Bloat = 0; /* check silkscreen minimum widths outside of elements */ /* XXX - need to check text and polygons too! */ - TheFlag = SELECTEDFLAG; + TheFlag = PCB_FLAG_SELECTED; if (!IsBad) { SILKLINE_LOOP(PCB->Data); { @@ -620,7 +620,7 @@ /* check silkscreen minimum widths inside of elements */ /* XXX - need to check text and polygons too! */ - TheFlag = SELECTEDFLAG; + TheFlag = PCB_FLAG_SELECTED; if (!IsBad) { ELEMENT_LOOP(PCB->Data); { @@ -704,12 +704,12 @@ if (PCB->Shrink != 0) { Bloat = -PCB->Shrink; - TheFlag = DRCFLAG | SELECTEDFLAG; + TheFlag = PCB_FLAG_DRC | PCB_FLAG_SELECTED; ListStart(What, ptr1, ptr2, ptr3); DoIt(true, false); - /* ok now the shrunk net has the SELECTEDFLAG set */ + /* ok now the shrunk net has the PCB_FLAG_SELECTED set */ DumpList(); - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; ListStart(What, ptr1, ptr2, ptr3); Bloat = 0; drc = true; /* abort the search if we find anything not already found */ @@ -716,17 +716,17 @@ if (DoIt(true, false)) { DumpList(); /* make the flag changes undoable */ - TheFlag = FOUNDFLAG | SELECTEDFLAG; + TheFlag = PCB_FLAG_FOUND | PCB_FLAG_SELECTED; ResetConnections(false); User = true; drc = false; Bloat = -PCB->Shrink; - TheFlag = SELECTEDFLAG; + TheFlag = PCB_FLAG_SELECTED; ListStart(What, ptr1, ptr2, ptr3); DoIt(true, true); DumpList(); ListStart(What, ptr1, ptr2, ptr3); - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; Bloat = 0; drc = true; DoIt(true, true); @@ -755,7 +755,7 @@ /* now check the bloated condition */ drc = false; ResetConnections(false); - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; ListStart(What, ptr1, ptr2, ptr3); Bloat = PCB->Bloat; drc = true; @@ -762,16 +762,16 @@ while (DoIt(true, false)) { DumpList(); /* make the flag changes undoable */ - TheFlag = FOUNDFLAG | SELECTEDFLAG; + TheFlag = PCB_FLAG_FOUND | PCB_FLAG_SELECTED; ResetConnections(false); User = true; drc = false; Bloat = 0; - TheFlag = SELECTEDFLAG; + TheFlag = PCB_FLAG_SELECTED; ListStart(What, ptr1, ptr2, ptr3); DoIt(true, true); DumpList(); - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; ListStart(What, ptr1, ptr2, ptr3); Bloat = PCB->Bloat; drc = true; @@ -795,7 +795,7 @@ IncrementUndoSerialNumber(); Undo(true); /* highlight the rest of the encroaching net so it's not reported again */ - TheFlag |= SELECTEDFLAG; + TheFlag |= PCB_FLAG_SELECTED; Bloat = 0; ListStart(thing_type, thing_ptr1, thing_ptr2, thing_ptr3); DoIt(true, true); @@ -806,7 +806,7 @@ } drc = false; DumpList(); - TheFlag = FOUNDFLAG | SELECTEDFLAG; + TheFlag = PCB_FLAG_FOUND | PCB_FLAG_SELECTED; ResetConnections(false); return (false); } Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 2508) +++ trunk/src/find_geo.c (revision 2509) @@ -50,7 +50,7 @@ (IsPointOnLineEnd((PV)->X,(PV)->Y, (Rat))) #define IS_PV_ON_ARC(PV, Arc) \ - (TEST_FLAG(SQUAREFLAG, (PV)) ? \ + (TEST_FLAG(PCB_FLAG_SQUARE, (PV)) ? \ IsArcInRectangle( \ (PV)->X -MAX(((PV)->Thickness+1)/2 +Bloat,0), (PV)->Y -MAX(((PV)->Thickness+1)/2 +Bloat,0), \ (PV)->X +MAX(((PV)->Thickness+1)/2 +Bloat,0), (PV)->Y +MAX(((PV)->Thickness+1)/2 +Bloat,0), \ @@ -321,7 +321,7 @@ { double s, r; double line1_dx, line1_dy, line2_dx, line2_dy, point1_dx, point1_dy; - if (TEST_FLAG(SQUAREFLAG, Line1)) { /* pretty reckless recursion */ + if (TEST_FLAG(PCB_FLAG_SQUARE, Line1)) { /* pretty reckless recursion */ PointType p[4]; form_slanted_rectangle(p, Line1); return IsLineInQuadrangle(p, Line2); @@ -328,7 +328,7 @@ } /* here come only round Line1 because IsLineInQuadrangle() calls LineLineIntersect() with first argument rounded */ - if (TEST_FLAG(SQUAREFLAG, Line2)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, Line2)) { PointType p[4]; form_slanted_rectangle(p, Line2); return IsLineInQuadrangle(p, Line1); @@ -474,7 +474,7 @@ BoxTypePtr Box = (BoxType *) Arc; /* arcs with clearance never touch polys */ - if (TEST_FLAG(CLEARPOLYFLAG, Polygon) && TEST_FLAG(CLEARLINEFLAG, Arc)) + if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Arc)) return false; if (!Polygon->Clipped) return false; @@ -504,11 +504,11 @@ POLYAREA *lp; /* lines with clearance never touch polygons */ - if (TEST_FLAG(CLEARPOLYFLAG, Polygon) && TEST_FLAG(CLEARLINEFLAG, Line)) + if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) return false; if (!Polygon->Clipped) return false; - if (TEST_FLAG(SQUAREFLAG, Line) && (Line->Point1.X == Line->Point2.X || Line->Point1.Y == Line->Point2.Y)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, Line) && (Line->Point1.X == Line->Point2.X || Line->Point1.Y == Line->Point2.Y)) { Coord wid = (Line->Thickness + Bloat + 1) / 2; Coord x1, x2, y1, y2; @@ -648,7 +648,7 @@ if (IsPointOnPin(PV1->X, PV1->Y, t1, PV2) || IsPointOnPin(PV2->X, PV2->Y, t2, PV1)) return true; - if (!TEST_FLAG(SQUAREFLAG, PV1) || !TEST_FLAG(SQUAREFLAG, PV2)) + if (!TEST_FLAG(PCB_FLAG_SQUARE, PV1) || !TEST_FLAG(PCB_FLAG_SQUARE, PV2)) return false; /* check for square/square overlap */ b1.X1 = PV1->X - t1; @@ -665,7 +665,7 @@ bool PinLineIntersect(PinTypePtr PV, LineTypePtr Line) { - if (TEST_FLAG(SQUAREFLAG, PV)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, PV)) { int shape = GET_SQUARE(PV); if (shape <= 1) { /* the original square case */ Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 2508) +++ trunk/src/find_lookup.c (revision 2509) @@ -39,7 +39,7 @@ if (PVList.Number > PVList.Size) printf("ADD_PV_TO_LIST overflow! num=%d size=%d\n", PVList.Number, PVList.Size); #endif - if (drc && !TEST_FLAG(SELECTEDFLAG, Pin)) + if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, Pin)) return (SetThing(PCB_TYPE_PIN, Pin->Element, Pin, Pin)); return false; } @@ -57,7 +57,7 @@ if (PadList[(L)].Number > PadList[(L)].Size) printf("ADD_PAD_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, PadList[(L)].Number, PadList[(L)].Size); #endif - if (drc && !TEST_FLAG(SELECTEDFLAG, Pad)) + if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, Pad)) return (SetThing(PCB_TYPE_PAD, Pad->Element, Pad, Pad)); return false; } @@ -74,7 +74,7 @@ if (LineList[(L)].Number > LineList[(L)].Size) printf("ADD_LINE_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, LineList[(L)].Number, LineList[(L)].Size); #endif - if (drc && !TEST_FLAG(SELECTEDFLAG, (Ptr))) + if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr))) return (SetThing(PCB_TYPE_LINE, LAYER_PTR(L), (Ptr), (Ptr))); return false; } @@ -91,7 +91,7 @@ if (ArcList[(L)].Number > ArcList[(L)].Size) printf("ADD_ARC_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, ArcList[(L)].Number, ArcList[(L)].Size); #endif - if (drc && !TEST_FLAG(SELECTEDFLAG, (Ptr))) + if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr))) return (SetThing(PCB_TYPE_ARC, LAYER_PTR(L), (Ptr), (Ptr))); return false; } @@ -108,7 +108,7 @@ if (RatList.Number > RatList.Size) printf("ADD_RAT_TO_LIST overflow! num=%d size=%d\n", RatList.Number, RatList.Size); #endif - if (drc && !TEST_FLAG(SELECTEDFLAG, (Ptr))) + if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr))) return (SetThing(PCB_TYPE_RATLINE, (Ptr), (Ptr), (Ptr))); return false; } @@ -125,7 +125,7 @@ if (PolygonList[(L)].Number > PolygonList[(L)].Size) printf("ADD_ARC_TO_LIST overflow! lay=%d, num=%d size=%d\n", L, PolygonList[(L)].Number, PolygonList[(L)].Size); #endif - if (drc && !TEST_FLAG(SELECTEDFLAG, (Ptr))) + if (drc && !TEST_FLAG(PCB_FLAG_SELECTED, (Ptr))) return (SetThing(PCB_TYPE_POLYGON, LAYER_PTR(L), (Ptr), (Ptr))); return false; } @@ -187,7 +187,7 @@ NumberOfPads[COMPONENT_LAYER] = NumberOfPads[SOLDER_LAYER] = 0; ALLPAD_LOOP(PCB->Data); { - if (TEST_FLAG(ONSOLDERFLAG, pad)) + if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) NumberOfPads[SOLDER_LAYER]++; else NumberOfPads[COMPONENT_LAYER]++; @@ -277,7 +277,7 @@ LineTypePtr line = (LineTypePtr) b; struct pv_info *i = (struct pv_info *) cl; - if (!TEST_FLAG(TheFlag, line) && PinLineIntersect(&i->pv, line) && !TEST_FLAG(HOLEFLAG, &i->pv)) { + if (!TEST_FLAG(TheFlag, line) && PinLineIntersect(&i->pv, line) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) { if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); } @@ -289,7 +289,7 @@ ArcTypePtr arc = (ArcTypePtr) b; struct pv_info *i = (struct pv_info *) cl; - if (!TEST_FLAG(TheFlag, arc) && IS_PV_ON_ARC(&i->pv, arc) && !TEST_FLAG(HOLEFLAG, &i->pv)) { + if (!TEST_FLAG(TheFlag, arc) && IS_PV_ON_ARC(&i->pv, arc) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) { if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); } @@ -302,8 +302,8 @@ struct pv_info *i = (struct pv_info *) cl; if (!TEST_FLAG(TheFlag, pad) && IS_PV_ON_PAD(&i->pv, pad) && - !TEST_FLAG(HOLEFLAG, &i->pv) && - ADD_PAD_TO_LIST(TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) + !TEST_FLAG(PCB_FLAG_HOLE, &i->pv) && + ADD_PAD_TO_LIST(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; } @@ -329,11 +329,11 @@ * because it might not be inside the polygon, or it could * be on an edge such that it doesn't actually touch. */ - if (!TEST_FLAG(TheFlag, polygon) && !TEST_FLAG(HOLEFLAG, &i->pv) && - (TEST_THERM(i->layer, &i->pv) || !TEST_FLAG(CLEARPOLYFLAG, polygon) + if (!TEST_FLAG(TheFlag, polygon) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv) && + (TEST_THERM(i->layer, &i->pv) || !TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon) || !i->pv.Clearance)) { double wide = MAX(0.5 * i->pv.Thickness + Bloat, 0); - if (TEST_FLAG(SQUAREFLAG, &i->pv)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, &i->pv)) { Coord x1 = i->pv.X - (i->pv.Thickness + 1 + Bloat) / 2; Coord x2 = i->pv.X + (i->pv.Thickness + 1 + Bloat) / 2; Coord y1 = i->pv.Y - (i->pv.Thickness + 1 + Bloat) / 2; @@ -342,7 +342,7 @@ && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); } - else if (TEST_FLAG(OCTAGONFLAG, &i->pv)) { + else if (TEST_FLAG(PCB_FLAG_OCTAGON, &i->pv)) { POLYAREA *oct = OctagonPoly(i->pv.X, i->pv.Y, i->pv.Thickness / 2, GET_SQUARE(&i->pv)); if (isects(oct, polygon, true) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) @@ -515,8 +515,8 @@ struct pv_info *i = (struct pv_info *) cl; if (!TEST_FLAG(TheFlag, pin) && PV_TOUCH_PV(&i->pv, pin)) { - if (TEST_FLAG(HOLEFLAG, pin) || TEST_FLAG(HOLEFLAG, &i->pv)) { - SET_FLAG(WARNFLAG, pin); + if (TEST_FLAG(PCB_FLAG_HOLE, pin) || TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) { + SET_FLAG(PCB_FLAG_WARN, pin); conf_core.temp.rat_warn = true; if (pin->Element) Message(_("WARNING: Hole too close to pin.\n")); @@ -594,8 +594,8 @@ struct lo_info *i = (struct lo_info *) cl; if (!TEST_FLAG(TheFlag, pv) && PinLineIntersect(pv, &i->line)) { - if (TEST_FLAG(HOLEFLAG, pv)) { - SET_FLAG(WARNFLAG, pv); + if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { + SET_FLAG(PCB_FLAG_WARN, pv); conf_core.temp.rat_warn = true; Message(_("WARNING: Hole too close to line.\n")); } @@ -611,8 +611,8 @@ struct lo_info *i = (struct lo_info *) cl; if (!TEST_FLAG(TheFlag, pv) && IS_PV_ON_PAD(pv, &i->pad)) { - if (TEST_FLAG(HOLEFLAG, pv)) { - SET_FLAG(WARNFLAG, pv); + if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { + SET_FLAG(PCB_FLAG_WARN, pv); conf_core.temp.rat_warn = true; Message(_("WARNING: Hole too close to pad.\n")); } @@ -628,8 +628,8 @@ struct lo_info *i = (struct lo_info *) cl; if (!TEST_FLAG(TheFlag, pv) && IS_PV_ON_ARC(pv, &i->arc)) { - if (TEST_FLAG(HOLEFLAG, pv)) { - SET_FLAG(WARNFLAG, pv); + if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { + SET_FLAG(PCB_FLAG_WARN, pv); conf_core.temp.rat_warn = true; Message(_("WARNING: Hole touches arc.\n")); } @@ -645,9 +645,9 @@ struct lo_info *i = (struct lo_info *) cl; /* note that holes in polygons are ok, so they don't generate warnings. */ - if (!TEST_FLAG(TheFlag, pv) && !TEST_FLAG(HOLEFLAG, pv) && - (TEST_THERM(i->layer, pv) || !TEST_FLAG(CLEARPOLYFLAG, &i->polygon) || !pv->Clearance)) { - if (TEST_FLAG(SQUAREFLAG, pv)) { + if (!TEST_FLAG(TheFlag, pv) && !TEST_FLAG(PCB_FLAG_HOLE, pv) && + (TEST_THERM(i->layer, pv) || !TEST_FLAG(PCB_FLAG_CLEARPOLY, &i->polygon) || !pv->Clearance)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) { Coord x1, x2, y1, y2; x1 = pv->X - (PIN_SIZE(pv) + 1 + Bloat) / 2; x2 = pv->X + (PIN_SIZE(pv) + 1 + Bloat) / 2; @@ -657,7 +657,7 @@ && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER)) longjmp(i->env, 1); } - else if (TEST_FLAG(OCTAGONFLAG, pv)) { + else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv)) { POLYAREA *oct = OctagonPoly(pv->X, pv->Y, PIN_SIZE(pv) / 2, GET_SQUARE(pv)); if (isects(oct, &i->polygon, true) && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER)) longjmp(i->env, 1); @@ -836,7 +836,7 @@ PadTypePtr pad = (PadTypePtr) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) + if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && ArcPadIntersect(&i->arc, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_ARC, &i->arc, FCT_COPPER)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; @@ -948,7 +948,7 @@ PadTypePtr pad = (PadTypePtr) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) + if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && LinePadIntersect(&i->line, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_LINE, &i->line, FCT_COPPER)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; @@ -1059,7 +1059,7 @@ struct rat_info *i = (struct rat_info *) cl; if (!TEST_FLAG(TheFlag, pad) && i->layer == - (TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && + (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && ((pad->Point1.X == i->Point->X && pad->Point1.Y == i->Point->Y) || (pad->Point2.X == i->Point->X && pad->Point2.Y == i->Point->Y) || ((pad->Point1.X + pad->Point2.X) / 2 == i->Point->X && @@ -1145,7 +1145,7 @@ struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, polygon) && (!TEST_FLAG(CLEARPOLYFLAG, polygon) || !i->pad.Clearance)) { + if (!TEST_FLAG(TheFlag, polygon) && (!TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon) || !i->pad.Clearance)) { if (IsPadInPolygon(&i->pad, polygon) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PAD, &i->pad, FCT_COPPER)) longjmp(i->env, 1); } @@ -1183,7 +1183,7 @@ PadTypePtr pad = (PadTypePtr) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) + if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && PadPadIntersect(pad, &i->pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_PAD, &i->pad, FCT_COPPER)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; @@ -1225,8 +1225,8 @@ PAD_LOOP(e); { if ((orig_pad != pad) && (ic == GET_INTCONN(pad))) { - int padlayer = TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER; -/*fprintf(stderr, "layergroup1: %d {%d %d %d} %d \n", tlayer, TEST_FLAG(ONSOLDERFLAG, pad), SOLDER_LAYER, COMPONENT_LAYER, padlayer);*/ + int padlayer = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER; +/*fprintf(stderr, "layergroup1: %d {%d %d %d} %d \n", tlayer, TEST_FLAG(PCB_FLAG_ONSOLDER, pad), SOLDER_LAYER, COMPONENT_LAYER, padlayer);*/ if ((!TEST_FLAG(TheFlag, pad)) && (tlayer != padlayer)) { /*fprintf(stderr, "layergroup2\n");*/ ADD_PAD_TO_LIST(padlayer, pad, PCB_TYPE_PAD, orig_pad, FCT_INTERNAL); @@ -1240,7 +1240,7 @@ } - if (!TEST_FLAG(SQUAREFLAG, Pad)) + if (!TEST_FLAG(PCB_FLAG_SQUARE, Pad)) return (LookupLOConnectionsToLine((LineTypePtr) Pad, LayerGroup, false)); info.pad = *Pad; @@ -1320,7 +1320,7 @@ PadTypePtr pad = (PadTypePtr) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER) + if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) && IsPadInPolygon(pad, &i->polygon)) { if (ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER)) longjmp(i->env, 1); Index: trunk/src/find_misc.c =================================================================== --- trunk/src/find_misc.c (revision 2508) +++ trunk/src/find_misc.c (revision 2509) @@ -127,7 +127,7 @@ while (PVList.DrawLocation < PVList.Number) { PinTypePtr pv = PVLIST_ENTRY(PVList.DrawLocation); - if (TEST_FLAG(PINFLAG, pv)) { + if (TEST_FLAG(PCB_FLAG_PIN, pv)) { if (PCB->PinOn) DrawPin(pv); } @@ -199,7 +199,7 @@ case PCB_TYPE_PAD: { PadTypePtr pad = (PadTypePtr) ptr2; - if (ADD_PAD_TO_LIST(TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, 0, NULL, FCT_START)) + if (ADD_PAD_TO_LIST(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, 0, NULL, FCT_START)) return true; break; } @@ -210,7 +210,7 @@ /* --------------------------------------------------------------------------- * looks up all connections from the object at the given coordinates - * the TheFlag (normally 'FOUNDFLAG') is set for all objects found + * the TheFlag (normally 'PCB_FLAG_FOUND') is set for all objects found * the objects are re-drawn if AndDraw is true * also the action is marked as undoable if AndDraw is true */ Index: trunk/src/find_print.c =================================================================== --- trunk/src/find_print.c (revision 2508) +++ trunk/src/find_print.c (revision 2509) @@ -41,7 +41,7 @@ PIN_LOOP(Element); { - if (!TEST_FLAG(HOLEFLAG, pin)) { + if (!TEST_FLAG(PCB_FLAG_HOLE, pin)) { /* pin might have bee checked before, add to list if not */ if (!TEST_FLAG(TheFlag, pin) && FP) { int i; @@ -66,7 +66,7 @@ fputc('\t', FP); PrintQuotedString(FP, (char *) EMPTY(pin->Name)); fputc('\n', FP); - SET_FLAG(SELECTEDFLAG, pin); + SET_FLAG(PCB_FLAG_SELECTED, pin); DrawPin(pin); } @@ -85,7 +85,7 @@ /* pad might has bee checked before, add to list if not */ if (!TEST_FLAG(TheFlag, pad) && FP) { int i; - if (ADD_PAD_TO_LIST(TEST_FLAG(ONSOLDERFLAG, pad) + if (ADD_PAD_TO_LIST(TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER, pad, 0, NULL, 0)) return true; DoIt(true, true); @@ -108,7 +108,7 @@ PrintQuotedString(FP, (char *) EMPTY(pad->Name)); fputc('\n', FP); - SET_FLAG(SELECTEDFLAG, pad); + SET_FLAG(PCB_FLAG_SELECTED, pad); DrawPad(pad); } @@ -193,7 +193,7 @@ fputs("\t\t__CHECKED_BEFORE__\n\t}\n", FP); continue; } - layer = TEST_FLAG(ONSOLDERFLAG, pad) ? SOLDER_LAYER : COMPONENT_LAYER; + layer = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER; if (ADD_PAD_TO_LIST(layer, pad, PCB_TYPE_ELEMENT, Element, FCT_ELEMENT)) return true; DoIt(true, AndDraw); @@ -245,7 +245,7 @@ { /* reset all currently marked connections */ User = true; - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; ResetConnections(true); InitConnectionLookup(); PrintElementConnections(Element, FP, true); @@ -266,7 +266,7 @@ { /* reset all currently marked connections */ User = false; - TheFlag = FOUNDFLAG; + TheFlag = PCB_FLAG_FOUND; ResetConnections(false); InitConnectionLookup(); Index: trunk/src/global_objs.h =================================================================== --- trunk/src/global_objs.h (revision 2508) +++ trunk/src/global_objs.h (revision 2509) @@ -136,7 +136,7 @@ /* This is the extents of a Pin or Via, depending on whether it's a hole or not. */ -#define PIN_SIZE(pinptr) (TEST_FLAG(HOLEFLAG, (pinptr)) \ +#define PIN_SIZE(pinptr) (TEST_FLAG(PCB_FLAG_HOLE, (pinptr)) \ ? (pinptr)->DrillingHole \ : (pinptr)->Thickness) Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 2508) +++ trunk/src/gui_act.c (revision 2509) @@ -363,7 +363,7 @@ Draw(); } if (Crosshair.AttachedLine.State != STATE_FIRST) - LookupConnection(Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, true, 1, FOUNDFLAG); + LookupConnection(Crosshair.AttachedLine.Point1.X, Crosshair.AttachedLine.Point1.Y, true, 1, PCB_FLAG_FOUND); } notify_crosshair_change(true); break; @@ -441,22 +441,22 @@ case PCB_TYPE_ELEMENT: PIN_LOOP((ElementTypePtr) ptr1); { - if (TEST_FLAG(DISPLAYNAMEFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, pin)) ErasePinName(pin); else DrawPinName(pin); AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, pin, pin); - TOGGLE_FLAG(DISPLAYNAMEFLAG, pin); + TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, pin); } END_LOOP; PAD_LOOP((ElementTypePtr) ptr1); { - if (TEST_FLAG(DISPLAYNAMEFLAG, pad)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, pad)) ErasePadName(pad); else DrawPadName(pad); AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, pad, pad); - TOGGLE_FLAG(DISPLAYNAMEFLAG, pad); + TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, pad); } END_LOOP; SetChangedFlag(true); @@ -465,12 +465,12 @@ break; case PCB_TYPE_PIN: - if (TEST_FLAG(DISPLAYNAMEFLAG, (PinTypePtr) ptr2)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2)) ErasePinName((PinTypePtr) ptr2); else DrawPinName((PinTypePtr) ptr2); AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, ptr2, ptr3); - TOGGLE_FLAG(DISPLAYNAMEFLAG, (PinTypePtr) ptr2); + TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2); SetChangedFlag(true); IncrementUndoSerialNumber(); Draw(); @@ -477,23 +477,23 @@ break; case PCB_TYPE_PAD: - if (TEST_FLAG(DISPLAYNAMEFLAG, (PadTypePtr) ptr2)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, (PadTypePtr) ptr2)) ErasePadName((PadTypePtr) ptr2); else DrawPadName((PadTypePtr) ptr2); AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, ptr2, ptr3); - TOGGLE_FLAG(DISPLAYNAMEFLAG, (PadTypePtr) ptr2); + TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, (PadTypePtr) ptr2); SetChangedFlag(true); IncrementUndoSerialNumber(); Draw(); break; case PCB_TYPE_VIA: - if (TEST_FLAG(DISPLAYNAMEFLAG, (PinTypePtr) ptr2)) + if (TEST_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2)) EraseViaName((PinTypePtr) ptr2); else DrawViaName((PinTypePtr) ptr2); AddObjectToFlagUndoList(PCB_TYPE_VIA, ptr1, ptr2, ptr3); - TOGGLE_FLAG(DISPLAYNAMEFLAG, (PinTypePtr) ptr2); + TOGGLE_FLAG(PCB_FLAG_DISPLAYNAME, (PinTypePtr) ptr2); SetChangedFlag(true); IncrementUndoSerialNumber(); Draw(); @@ -901,7 +901,7 @@ if ((type = SearchScreen(x, y, PCB_TYPE_ELEMENT, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { AddObjectToFlagUndoList(type, ptr1, ptr2, ptr3); EraseElementName((ElementTypePtr) ptr2); - TOGGLE_FLAG(HIDENAMEFLAG, (ElementTypePtr) ptr2); + TOGGLE_FLAG(PCB_FLAG_HIDENAME, (ElementTypePtr) ptr2); DrawElementName((ElementTypePtr) ptr2); Draw(); IncrementUndoSerialNumber(); @@ -914,11 +914,11 @@ bool changed = false; ELEMENT_LOOP(PCB->Data); { - if ((TEST_FLAG(SELECTEDFLAG, element) || TEST_FLAG(SELECTEDFLAG, &NAMEONPCB_TEXT(element))) + if ((TEST_FLAG(PCB_FLAG_SELECTED, element) || TEST_FLAG(PCB_FLAG_SELECTED, &NAMEONPCB_TEXT(element))) && (FRONT(element) || PCB->InvisibleObjectsOn)) { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element); EraseElementName(element); - TOGGLE_FLAG(HIDENAMEFLAG, element); + TOGGLE_FLAG(PCB_FLAG_HIDENAME, element); DrawElementName(element); changed = true; } Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 2508) +++ trunk/src/hid_draw_helpers.c (revision 2509) @@ -154,7 +154,7 @@ /* Draw other parts of the polygon if fullpoly flag is set */ /* NB: No "NoHoles" cache for these */ - if (TEST_FLAG(FULLPOLYFLAG, poly)) { + if (TEST_FLAG(PCB_FLAG_FULLPOLY, poly)) { PolygonType p = *poly; for (p.Clipped = poly->Clipped->f; p.Clipped != poly->Clipped; p.Clipped = p.Clipped->f) @@ -195,7 +195,7 @@ } gui->set_line_cap(gc, Round_Cap); gui->set_line_width(gc, 0); - if (TEST_FLAG(SQUAREFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) { /* slanted square pad */ double tx, ty, theta; @@ -245,7 +245,7 @@ : pad->Thickness; if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y) { - if (TEST_FLAG(SQUAREFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) { Coord l, r, t, b; l = pad->Point1.X - w / 2; b = pad->Point1.Y - w / 2; @@ -258,7 +258,7 @@ } } else { - gui->set_line_cap(gc, TEST_FLAG(SQUAREFLAG, pad) ? Square_Cap : Round_Cap); + gui->set_line_cap(gc, TEST_FLAG(PCB_FLAG_SQUARE, pad) ? Square_Cap : Round_Cap); gui->set_line_width(gc, w); gui->draw_line(gc, pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y); @@ -342,7 +342,7 @@ Coord w = mask ? pv->Mask : pv->Thickness; Coord r = w / 2; - if (TEST_FLAG(HOLEFLAG, pv)) { + if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { if (mask) gui->fill_circle(bg_gc, pv->X, pv->Y, r); if (drawHole) { @@ -354,7 +354,7 @@ return; } - if (TEST_FLAG(SQUAREFLAG, pv)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) { /* use the original code for now */ if ((GET_SQUARE(pv) == 0) || (GET_SQUARE(pv) == 1)) { Coord l = pv->X - r; @@ -366,7 +366,7 @@ else draw_square_pin_poly(fg_gc, pv->X, pv->Y, w, false, GET_SQUARE(pv)); } - else if (TEST_FLAG(OCTAGONFLAG, pv)) + else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv)) draw_octagon_poly(fg_gc, pv->X, pv->Y, w, false); else /* draw a round pin or via */ gui->fill_circle(fg_gc, pv->X, pv->Y, r); @@ -381,7 +381,7 @@ Coord w = mask ? pv->Mask : pv->Thickness; Coord r = w / 2; - if (TEST_FLAG(HOLEFLAG, pv)) { + if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { if (mask) gui->draw_arc(fg_gc, pv->X, pv->Y, r, r, 0, 360); if (drawHole) { @@ -393,7 +393,7 @@ return; } - if (TEST_FLAG(SQUAREFLAG, pv)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pv)) { Coord l = pv->X - r; Coord b = pv->Y - r; Coord r = l + w; @@ -407,7 +407,7 @@ gui->draw_line(fg_gc, r, b, l, b); } - else if (TEST_FLAG(OCTAGONFLAG, pv)) { + else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv)) { draw_octagon_poly(fg_gc, pv->X, pv->Y, w, true); } else { /* draw a round pin or via */ Index: trunk/src/line.c =================================================================== --- trunk/src/line.c (revision 2508) +++ trunk/src/line.c (revision 2509) @@ -206,7 +206,7 @@ PinTypePtr via = (PinTypePtr) b; struct drc_info *i = (struct drc_info *) cl; - if (!TEST_FLAG(FOUNDFLAG, via) && PinLineIntersect(via, i->line)) + if (!TEST_FLAG(PCB_FLAG_FOUND, via) && PinLineIntersect(via, i->line)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } @@ -216,7 +216,7 @@ PadTypePtr pad = (PadTypePtr) b; struct drc_info *i = (struct drc_info *) cl; - if (TEST_FLAG(ONSOLDERFLAG, pad) == i->solder && !TEST_FLAG(FOUNDFLAG, pad) && LinePadIntersect(i->line, pad)) + if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == i->solder && !TEST_FLAG(PCB_FLAG_FOUND, pad) && LinePadIntersect(i->line, pad)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } @@ -226,7 +226,7 @@ LineTypePtr line = (LineTypePtr) b; struct drc_info *i = (struct drc_info *) cl; - if (!TEST_FLAG(FOUNDFLAG, line) && LineLineIntersect(line, i->line)) + if (!TEST_FLAG(PCB_FLAG_FOUND, line) && LineLineIntersect(line, i->line)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } @@ -236,7 +236,7 @@ ArcTypePtr arc = (ArcTypePtr) b; struct drc_info *i = (struct drc_info *) cl; - if (!TEST_FLAG(FOUNDFLAG, arc) && LineArcIntersect(i->line, arc)) + if (!TEST_FLAG(PCB_FLAG_FOUND, arc) && LineArcIntersect(i->line, arc)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } Index: trunk/src/macro.h =================================================================== --- trunk/src/macro.h (revision 2508) +++ trunk/src/macro.h (revision 2509) @@ -156,7 +156,7 @@ * Determines if object is on front or back */ #define FRONT(o) \ - ((TEST_FLAG(ONSOLDERFLAG, (o)) != 0) == SWAP_IDENT) + ((TEST_FLAG(PCB_FLAG_ONSOLDER, (o)) != 0) == SWAP_IDENT) /* --------------------------------------------------------------------------- * Determines if an object is on the given side. side is either SOLDER_LAYER @@ -163,7 +163,7 @@ * or COMPONENT_LAYER. */ #define ON_SIDE(element, side) \ - (TEST_FLAG (ONSOLDERFLAG, element) == (side == SOLDER_LAYER)) + (TEST_FLAG (PCB_FLAG_ONSOLDER, element) == (side == SOLDER_LAYER)) /* --------------------------------------------------------------------------- * some loop shortcuts Index: trunk/src/mirror.c =================================================================== --- trunk/src/mirror.c (revision 2508) +++ trunk/src/mirror.c (revision 2509) @@ -69,7 +69,7 @@ pad->Point1.Y = SWAP_Y(pad->Point1.Y) + yoff; pad->Point2.X = SWAP_X(pad->Point2.X); pad->Point2.Y = SWAP_Y(pad->Point2.Y) + yoff; - TOGGLE_FLAG(ONSOLDERFLAG, pad); + TOGGLE_FLAG(PCB_FLAG_ONSOLDER, pad); } END_LOOP; ARC_LOOP(Element); @@ -84,7 +84,7 @@ { text->X = SWAP_X(text->X); text->Y = SWAP_Y(text->Y) + yoff; - TOGGLE_FLAG(ONSOLDERFLAG, text); + TOGGLE_FLAG(PCB_FLAG_ONSOLDER, text); } END_LOOP; Element->MarkX = SWAP_X(Element->MarkX); @@ -91,7 +91,7 @@ Element->MarkY = SWAP_Y(Element->MarkY) + yoff; /* now toggle the solder-side flag */ - TOGGLE_FLAG(ONSOLDERFLAG, Element); + TOGGLE_FLAG(PCB_FLAG_ONSOLDER, Element); /* this inserts all of the rtree data too */ SetElementBoundingBox(Data, Element, &PCB->Font); ClearFromPolygon(Data, PCB_TYPE_ELEMENT, Element, Element); Index: trunk/src/misc.c =================================================================== --- trunk/src/misc.c (revision 2508) +++ trunk/src/misc.c (revision 2509) @@ -105,7 +105,7 @@ { Coord width; - if ((GET_SQUARE(Pin) > 1) && (TEST_FLAG(SQUAREFLAG, Pin))) { + if ((GET_SQUARE(Pin) > 1) && (TEST_FLAG(PCB_FLAG_SQUARE, Pin))) { POLYAREA *p = PinPoly(Pin, PIN_SIZE(Pin), Pin->Clearance); poly_bbox(p, &Pin->BoundingBox); poly_Free(&p); @@ -143,7 +143,7 @@ deltax = Pad->Point2.X - Pad->Point1.X; deltay = Pad->Point2.Y - Pad->Point1.Y; - if (TEST_FLAG(SQUAREFLAG, Pad) && deltax != 0 && deltay != 0) { + if (TEST_FLAG(PCB_FLAG_SQUARE, Pad) && deltax != 0 && deltay != 0) { /* slanted square pad */ double theta; Coord btx, bty; @@ -302,7 +302,7 @@ MAKEMAX(vbox->Y2, MAX(pad->Point1.Y, pad->Point2.Y) + pad->Thickness / 2); } END_LOOP; - /* now we set the EDGE2FLAG of the pad if Point2 + /* now we set the PCB_FLAG_EDGE2 of the pad if Point2 * is closer to the outside edge than Point1 */ PAD_LOOP(Element); @@ -310,16 +310,16 @@ if (pad->Point1.Y == pad->Point2.Y) { /* horizontal pad */ if (box->X2 - pad->Point2.X < pad->Point1.X - box->X1) - SET_FLAG(EDGE2FLAG, pad); + SET_FLAG(PCB_FLAG_EDGE2, pad); else - CLEAR_FLAG(EDGE2FLAG, pad); + CLEAR_FLAG(PCB_FLAG_EDGE2, pad); } else { /* vertical pad */ if (box->Y2 - pad->Point2.Y < pad->Point1.Y - box->Y1) - SET_FLAG(EDGE2FLAG, pad); + SET_FLAG(PCB_FLAG_EDGE2, pad); else - CLEAR_FLAG(EDGE2FLAG, pad); + CLEAR_FLAG(PCB_FLAG_EDGE2, pad); } } END_LOOP; @@ -328,7 +328,7 @@ if ((box->X2 - box->X1) > (box->Y2 - box->Y1)) { PIN_LOOP(Element); { - SET_FLAG(EDGE2FLAG, pin); + SET_FLAG(PCB_FLAG_EDGE2, pin); } END_LOOP; } @@ -335,7 +335,7 @@ else { PIN_LOOP(Element); { - CLEAR_FLAG(EDGE2FLAG, pin); + CLEAR_FLAG(PCB_FLAG_EDGE2, pin); } END_LOOP; } @@ -434,7 +434,7 @@ * and rotate box */ - if (TEST_FLAG(ONSOLDERFLAG, Text)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, Text)) { Text->BoundingBox.X1 = Text->X + minx; Text->BoundingBox.Y1 = Text->Y - miny; Text->BoundingBox.X2 = Text->X + maxx; @@ -507,7 +507,7 @@ bool paste_empty = true; ALLPAD_LOOP(PCB->Data); { - if (ON_SIDE(pad, side) && !TEST_FLAG(NOPASTEFLAG, pad) && pad->Mask > 0) { + if (ON_SIDE(pad, side) && !TEST_FLAG(PCB_FLAG_NOPASTE, pad) && pad->Mask > 0) { paste_empty = false; break; } @@ -526,7 +526,7 @@ { PinTypePtr pin = (PinTypePtr) b; HoleCountStruct *hcs = (HoleCountStruct *) cl; - if (TEST_FLAG(HOLEFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_HOLE, pin)) hcs->nunplated++; else hcs->nplated++; Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 2508) +++ trunk/src/move.c (revision 2509) @@ -423,7 +423,7 @@ { ArcTypePtr newone; - if (TEST_FLAG(LOCKFLAG, Arc)) { + if (TEST_FLAG(PCB_FLAG_LOCK, Arc)) { Message(_("Sorry, the object is locked\n")); return NULL; } @@ -453,7 +453,7 @@ LineTypePtr newone; /*Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y; Coord X1 = Rat->Point1.X, Y1 = Rat->Point1.Y; - if VIAFLAG + if PCB_FLAG_VIA if we're on a pin, add a thermal else make a via and a wire, but 0-length wire not good else as before */ @@ -489,7 +489,7 @@ if ((via = CreateNewVia(PCB->Data, i->X, i->Y, - conf_core.design.via_thickness, 2 * conf_core.design.clearance, NOFLAG, conf_core.design.via_drilling_hole, NULL, NoFlags())) != NULL) { + conf_core.design.via_thickness, 2 * conf_core.design.clearance, PCB_FLAG_NO, conf_core.design.via_drilling_hole, NULL, NoFlags())) != NULL) { AddObjectToCreateUndoList(PCB_TYPE_VIA, via, via, via); DrawVia(via); } @@ -503,7 +503,7 @@ LineTypePtr newone; void *ptr1, *ptr2, *ptr3; - if (TEST_FLAG(LOCKFLAG, Line)) { + if (TEST_FLAG(PCB_FLAG_LOCK, Line)) { Message(_("Sorry, the object is locked\n")); return NULL; } @@ -568,9 +568,9 @@ textlist_append(&Destination->Text, text); if (GetLayerGroupNumberByNumber(solder_silk_layer) == GetLayerGroupNumberByPointer(Destination)) - SET_FLAG(ONSOLDERFLAG, text); + SET_FLAG(PCB_FLAG_ONSOLDER, text); else - CLEAR_FLAG(ONSOLDERFLAG, text); + CLEAR_FLAG(PCB_FLAG_ONSOLDER, text); /* re-calculate the bounding box (it could be mirrored now) */ SetTextBoundingBox(&PCB->Font, text); @@ -587,7 +587,7 @@ */ static void *MoveTextToLayer(LayerType * layer, TextType * text) { - if (TEST_FLAG(LOCKFLAG, text)) { + if (TEST_FLAG(PCB_FLAG_LOCK, text)) { Message(_("Sorry, the object is locked\n")); return NULL; } @@ -650,7 +650,7 @@ PolygonTypePtr newone; struct mptlc d; - if (TEST_FLAG(LOCKFLAG, Polygon)) { + if (TEST_FLAG(PCB_FLAG_LOCK, Polygon)) { Message(_("Sorry, the object is locked\n")); return NULL; } @@ -710,7 +710,7 @@ ptr = Crosshair.AttachedObject.Rubberband; while (Crosshair.AttachedObject.RubberbandN) { /* first clear any marks that we made in the line flags */ - CLEAR_FLAG(RUBBERENDFLAG, ptr->Line); + CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line); AddObjectToMoveUndoList(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, DX, DY); MoveLinePoint(ptr->Layer, ptr->Line, ptr->MovedPoint); Crosshair.AttachedObject.RubberbandN--; Index: trunk/src/netlist.c =================================================================== --- trunk/src/netlist.c (revision 2508) +++ trunk/src/netlist.c (revision 2509) @@ -138,7 +138,7 @@ int x, y; if (pin_name_to_xy(net->Entry, &x, &y)) return; - LookupConnection(x, y, 1, 1, FOUNDFLAG); + LookupConnection(x, y, 1, 1, PCB_FLAG_FOUND); } static void netlist_select(LibraryMenuType * net, LibraryEntryType * pin) @@ -146,7 +146,7 @@ int x, y; if (pin_name_to_xy(net->Entry, &x, &y)) return; - LookupConnection(x, y, 1, 1, SELECTEDFLAG); + LookupConnection(x, y, 1, 1, PCB_FLAG_SELECTED); } static void netlist_rats(LibraryMenuType * net, LibraryEntryType * pin) @@ -219,7 +219,7 @@ { PIN_LOOP(element); { - if (TEST_FLAG(SELECTEDFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, pin)) { int le, lp; if (next > 2) { Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 2508) +++ trunk/src/object_act.c (revision 2509) @@ -155,7 +155,7 @@ ElementType *e = NULL; ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { e = element; n_found++; } @@ -251,7 +251,7 @@ * going to be used either with a brand new design or a scratch * design holding some new components */ - if (!TEST_FLAG(LOCKFLAG, element) && (all || TEST_FLAG(SELECTEDFLAG, element))) { + if (!TEST_FLAG(PCB_FLAG_LOCK, element) && (all || TEST_FLAG(PCB_FLAG_SELECTED, element))) { /* figure out how much to move the element */ dx = minx - element->BoundingBox.X1; @@ -498,7 +498,7 @@ if (strcasecmp(function, "start") == 0) { ELEMENT_LOOP(PCB->Data); { - CLEAR_FLAG(FOUNDFLAG, element); + CLEAR_FLAG(PCB_FLAG_FOUND, element); } END_LOOP; element_cache = NULL; @@ -509,12 +509,12 @@ if (strcasecmp(function, "done") == 0) { ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, element)) { - CLEAR_FLAG(FOUNDFLAG, element); + if (TEST_FLAG(PCB_FLAG_FOUND, element)) { + CLEAR_FLAG(PCB_FLAG_FOUND, element); } else if (!EMPTY_STRING_P(NAMEONPCB_NAME(element))) { /* Unnamed elements should remain untouched */ - SET_FLAG(SELECTEDFLAG, element); + SET_FLAG(PCB_FLAG_SELECTED, element); } } END_LOOP; @@ -637,7 +637,7 @@ if (old) free(old); - SET_FLAG(FOUNDFLAG, e); + SET_FLAG(PCB_FLAG_FOUND, e); #ifdef DEBUG printf(" ... Leaving ActionElementList.\n"); @@ -738,7 +738,7 @@ case F_All: ALLLINE_LOOP(PCB->Data); { - if (TEST_FLAG(AUTOFLAG, line) && !TEST_FLAG(LOCKFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_AUTO, line) && !TEST_FLAG(PCB_FLAG_LOCK, line)) { RemoveObject(PCB_TYPE_LINE, layer, line, line); changed = true; } @@ -746,7 +746,7 @@ ENDALL_LOOP; ALLARC_LOOP(PCB->Data); { - if (TEST_FLAG(AUTOFLAG, arc) && !TEST_FLAG(LOCKFLAG, arc)) { + if (TEST_FLAG(PCB_FLAG_AUTO, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc)) { RemoveObject(PCB_TYPE_ARC, layer, arc, arc); changed = true; } @@ -754,7 +754,7 @@ ENDALL_LOOP; VIA_LOOP(PCB->Data); { - if (TEST_FLAG(AUTOFLAG, via) && !TEST_FLAG(LOCKFLAG, via)) { + if (TEST_FLAG(PCB_FLAG_AUTO, via) && !TEST_FLAG(PCB_FLAG_LOCK, via)) { RemoveObject(PCB_TYPE_VIA, via, via, via); changed = true; } @@ -769,8 +769,8 @@ case F_Selected: VISIBLELINE_LOOP(PCB->Data); { - if (TEST_FLAGS(AUTOFLAG | SELECTEDFLAG, line) - && !TEST_FLAG(LOCKFLAG, line)) { + if (TEST_FLAGS(PCB_FLAG_AUTO | PCB_FLAG_SELECTED, line) + && !TEST_FLAG(PCB_FLAG_LOCK, line)) { RemoveObject(PCB_TYPE_LINE, layer, line, line); changed = true; } @@ -779,8 +779,8 @@ if (PCB->ViaOn) VIA_LOOP(PCB->Data); { - if (TEST_FLAGS(AUTOFLAG | SELECTEDFLAG, via) - && !TEST_FLAG(LOCKFLAG, via)) { + if (TEST_FLAGS(PCB_FLAG_AUTO | PCB_FLAG_SELECTED, via) + && !TEST_FLAG(PCB_FLAG_LOCK, via)) { RemoveObject(PCB_TYPE_VIA, via, via, via); changed = true; } @@ -844,7 +844,7 @@ if (!function) return 1; if (strcasecmp(function, "Selected") == 0) - flags = SELECTEDFLAG; + flags = PCB_FLAG_SELECTED; else { units = delta; delta = function; @@ -918,7 +918,7 @@ if (!function) return 1; if (strcasecmp(function, "Selected") == 0) - flags = SELECTEDFLAG; + flags = PCB_FLAG_SELECTED; else { units = delta; delta = function; Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 2508) +++ trunk/src/polygon.c (revision 2509) @@ -580,7 +580,7 @@ return NULL; half = (thick + 1) / 2; d = sqrt(SQUARE(l->Point1.X - l->Point2.X) + SQUARE(l->Point1.Y - l->Point2.Y)); - if (!TEST_FLAG(SQUAREFLAG, l)) + if (!TEST_FLAG(PCB_FLAG_SQUARE, l)) if (d == 0) /* line is a point */ return CirclePoly(l->Point1.X, l->Point1.Y, half); if (d != 0) { @@ -592,7 +592,7 @@ dx = half; dy = 0; } - if (TEST_FLAG(SQUAREFLAG, l)) { /* take into account the ends */ + if (TEST_FLAG(PCB_FLAG_SQUARE, l)) { /* take into account the ends */ l->Point1.X -= dy; l->Point1.Y += dx; l->Point2.X += dy; @@ -604,7 +604,7 @@ return 0; v[0] = l->Point2.X - dx; v[1] = l->Point2.Y - dy; - if (TEST_FLAG(SQUAREFLAG, l)) + if (TEST_FLAG(PCB_FLAG_SQUARE, l)) poly_InclVertex(contour->head.prev, poly_CreateNode(v)); else frac_circle(contour, l->Point2.X, l->Point2.Y, v, 2); @@ -613,7 +613,7 @@ poly_InclVertex(contour->head.prev, poly_CreateNode(v)); v[0] = l->Point1.X + dx; v[1] = l->Point1.Y + dy; - if (TEST_FLAG(SQUAREFLAG, l)) + if (TEST_FLAG(PCB_FLAG_SQUARE, l)) poly_InclVertex(contour->head.prev, poly_CreateNode(v)); else frac_circle(contour, l->Point1.X, l->Point1.Y, v, 2); @@ -737,7 +737,7 @@ { int size; - if (TEST_FLAG(SQUAREFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) { if (GET_SQUARE(pin) <= 1) { size = (thick + 1) / 2; return RoundRect(pin->X - size, pin->X + size, pin->Y - size, pin->Y + size, (clear + 1) / 2); @@ -750,7 +750,7 @@ } else { size = (thick + clear + 1) / 2; - if (TEST_FLAG(OCTAGONFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) { return OctagonPoly(pin->X, pin->Y, size + size, GET_SQUARE(pin)); } } @@ -800,7 +800,7 @@ { POLYAREA *np; - if (!TEST_FLAG(CLEARLINEFLAG, line)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line)) return 0; if (!(np = LinePoly(line, line->Thickness + line->Clearance))) return -1; @@ -811,7 +811,7 @@ { POLYAREA *np; - if (!TEST_FLAG(CLEARLINEFLAG, arc)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc)) return 0; if (!(np = ArcPoly(arc, arc->Thickness + arc->Clearance))) return -1; @@ -823,7 +823,7 @@ POLYAREA *np; const BoxType *b = &text->BoundingBox; - if (!TEST_FLAG(CLEARLINEFLAG, text)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text)) return 0; if (!(np = RoundRect(b->X1 + PCB->Bloat, b->X2 - PCB->Bloat, b->Y1 + PCB->Bloat, b->Y2 - PCB->Bloat, PCB->Bloat))) return -1; @@ -836,7 +836,7 @@ if (pad->Clearance == 0) return 0; - if (TEST_FLAG(SQUAREFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) { if (!(np = SquarePadPoly(pad, pad->Thickness + pad->Clearance))) return -1; } @@ -915,7 +915,7 @@ /* don't subtract the object that was put back! */ if (b == info->other) return R_DIR_NOT_FOUND; - if (!TEST_FLAG(CLEARLINEFLAG, arc)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc)) return R_DIR_NOT_FOUND; polygon = info->polygon; if (SubtractArc(arc, polygon) < 0) @@ -935,7 +935,7 @@ if (pad->Clearance == 0) return R_DIR_NOT_FOUND; polygon = info->polygon; - if (XOR(TEST_FLAG(ONSOLDERFLAG, pad), !info->solder)) { + if (XOR(TEST_FLAG(PCB_FLAG_ONSOLDER, pad), !info->solder)) { if (SubtractPad(pad, polygon) < 0) longjmp(info->env, 1); return R_DIR_FOUND_CONTINUE; @@ -954,7 +954,7 @@ /* don't subtract the object that was put back! */ if (b == info->other) return R_DIR_NOT_FOUND; - if (!TEST_FLAG(CLEARLINEFLAG, line)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line)) return R_DIR_NOT_FOUND; polygon = info->polygon; @@ -980,7 +980,7 @@ /* don't subtract the object that was put back! */ if (b == info->other) return R_DIR_NOT_FOUND; - if (!TEST_FLAG(CLEARLINEFLAG, text)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text)) return R_DIR_NOT_FOUND; polygon = info->polygon; if (SubtractText(text, polygon) < 0) @@ -1005,7 +1005,7 @@ struct cpInfo info; Cardinal group; - if (!TEST_FLAG(CLEARPOLYFLAG, polygon) + if (!TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon) || GetLayerNumber(Data, Layer) >= max_copper_layer) return 0; group = Group(Data, GetLayerNumber(Data, Layer)); @@ -1104,7 +1104,7 @@ { POLYAREA *np; - if (!TEST_FLAG(CLEARLINEFLAG, arc)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc)) return 0; /* overlap a bit to prevent gaps from rounding errors */ @@ -1122,7 +1122,7 @@ { POLYAREA *np; - if (!TEST_FLAG(CLEARLINEFLAG, line)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line)) return 0; /* overlap a bit to prevent notches from rounding errors */ @@ -1140,7 +1140,7 @@ { POLYAREA *np; - if (!TEST_FLAG(CLEARLINEFLAG, text)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text)) return 0; /* overlap a bit to prevent notches from rounding errors */ @@ -1182,7 +1182,7 @@ if (!p->Clipped) return 0; assert(poly_Valid(p->Clipped)); - if (TEST_FLAG(CLEARPOLYFLAG, p)) + if (TEST_FLAG(PCB_FLAG_CLEARPOLY, p)) clearPoly(Data, layer, p, NULL, 0); else p->NoHolesValid = 0; @@ -1340,9 +1340,9 @@ saveID = polygon->ID; *polygon = Crosshair.AttachedPolygon; polygon->ID = saveID; - SET_FLAG(CLEARPOLYFLAG, polygon); + SET_FLAG(PCB_FLAG_CLEARPOLY, polygon); if (conf_core.editor.full_poly) - SET_FLAG(FULLPOLYFLAG, polygon); + SET_FLAG(PCB_FLAG_FULLPOLY, polygon); memset(&Crosshair.AttachedPolygon, 0, sizeof(PolygonType)); SetPolygonBoundingBox(polygon); if (!CURRENT->polygon_tree) @@ -1451,7 +1451,7 @@ struct plow_info *plow = (struct plow_info *) cl; PolygonTypePtr polygon = (PolygonTypePtr) b; - if (TEST_FLAG(CLEARPOLYFLAG, polygon)) + if (TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon)) return plow->callback(plow->data, plow->layer, polygon, plow->type, plow->ptr1, plow->ptr2); return R_DIR_NOT_FOUND; } @@ -1495,7 +1495,7 @@ case PCB_TYPE_ARC: case PCB_TYPE_TEXT: /* the cast works equally well for lines and arcs */ - if (!TEST_FLAG(CLEARLINEFLAG, (LineTypePtr) ptr2)) + if (!TEST_FLAG(PCB_FLAG_CLEARLINE, (LineTypePtr) ptr2)) return 0; /* silk doesn't plow */ if (GetLayerNumber(Data, (LayerTypePtr) ptr1) >= max_copper_layer) @@ -1510,7 +1510,7 @@ break; case PCB_TYPE_PAD: { - Cardinal group = GetLayerGroupNumberByNumber(TEST_FLAG(ONSOLDERFLAG, (PadType *) ptr2) ? + Cardinal group = GetLayerGroupNumberByNumber(TEST_FLAG(PCB_FLAG_ONSOLDER, (PadType *) ptr2) ? solder_silk_layer : component_silk_layer); GROUP_LOOP(Data, group); { @@ -1681,7 +1681,7 @@ bool many = false; FlagType flags; - if (!poly->Clipped || TEST_FLAG(LOCKFLAG, poly)) + if (!poly->Clipped || TEST_FLAG(PCB_FLAG_LOCK, poly)) return false; if (poly->Clipped->f == poly->Clipped) return false; Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 2508) +++ trunk/src/polygon_act.c (revision 2509) @@ -75,7 +75,7 @@ case F_SelectedObjects: ALLPOLYGON_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, polygon)) + if (TEST_FLAG(PCB_FLAG_SELECTED, polygon)) MorphPolygon(layer, polygon); } ENDALL_LOOP; Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 2508) +++ trunk/src/rats.c (revision 2509) @@ -108,13 +108,13 @@ return false; padlist_foreach(&element->Pad, &it, pad) { - if (NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !TEST_FLAG(DRCFLAG, pad))) { + if (NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !TEST_FLAG(PCB_FLAG_DRC, pad))) { conn->type = PCB_TYPE_PAD; conn->ptr1 = element; conn->ptr2 = pad; - conn->group = TEST_FLAG(ONSOLDERFLAG, pad) ? SLayer : CLayer; + conn->group = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SLayer : CLayer; - if (TEST_FLAG(EDGE2FLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_EDGE2, pad)) { conn->X = pad->Point2.X; conn->Y = pad->Point2.Y; } @@ -127,7 +127,7 @@ } padlist_foreach(&element->Pin, &it, pin) { - if (!TEST_FLAG(HOLEFLAG, pin) && pin->Number && NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !TEST_FLAG(DRCFLAG, pin))) { + if (!TEST_FLAG(PCB_FLAG_HOLE, pin) && pin->Number && NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !TEST_FLAG(PCB_FLAG_DRC, pin))) { conn->type = PCB_TYPE_PIN; conn->ptr1 = element; conn->ptr2 = pin; @@ -198,13 +198,13 @@ ALLPIN_LOOP(PCB->Data); { pin->Spare = NULL; - CLEAR_FLAG(DRCFLAG, pin); + CLEAR_FLAG(PCB_FLAG_DRC, pin); } ENDALL_LOOP; ALLPAD_LOOP(PCB->Data); { pad->Spare = NULL; - CLEAR_FLAG(DRCFLAG, pad); + CLEAR_FLAG(PCB_FLAG_DRC, pad); } ENDALL_LOOP; MENU_LOOP(net_menu); @@ -229,7 +229,7 @@ ENTRY_LOOP(menu); { if (SeekPad(entry, &LastPoint, false)) { - if (TEST_FLAG(DRCFLAG, (PinTypePtr) LastPoint.ptr2)) + if (TEST_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2)) Message(_ ("Error! Element %s pin %s appears multiple times in the netlist file.\n"), NAMEONPCB_NAME((ElementTypePtr) LastPoint.ptr1), @@ -241,7 +241,7 @@ /* indicate expect net */ connection->menu = menu; /* mark as visited */ - SET_FLAG(DRCFLAG, (PinTypePtr) LastPoint.ptr2); + SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2); if (LastPoint.type == PCB_TYPE_PIN) ((PinTypePtr) LastPoint.ptr2)->Spare = (void *) menu; else @@ -257,7 +257,7 @@ /* indicate expect net */ connection->menu = menu; /* mark as visited */ - SET_FLAG(DRCFLAG, (PinTypePtr) LastPoint.ptr2); + SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) LastPoint.ptr2); if (LastPoint.type == PCB_TYPE_PIN) ((PinTypePtr) LastPoint.ptr2)->Spare = (void *) menu; else @@ -271,12 +271,12 @@ /* clear all visit marks */ ALLPIN_LOOP(PCB->Data); { - CLEAR_FLAG(DRCFLAG, pin); + CLEAR_FLAG(PCB_FLAG_DRC, pin); } ENDALL_LOOP; ALLPAD_LOOP(PCB->Data); { - CLEAR_FLAG(DRCFLAG, pad); + CLEAR_FLAG(PCB_FLAG_DRC, pad); } ENDALL_LOOP; return (Wantlist); @@ -319,8 +319,8 @@ ALLPIN_LOOP(PCB->Data); { ElementType *e = pin->Element; -/* TODO: should be: !TEST_FLAG(NONETLISTFLAG, (ElementType *)pin->Element)*/ - if ((TEST_FLAG(DRCFLAG, pin)) && (!(e->Flags.f & NONETLISTFLAG))) { +/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pin->Element)*/ + if ((TEST_FLAG(PCB_FLAG_DRC, pin)) && (!(e->Flags.f & PCB_FLAG_NONETLIST))) { warn = true; if (!pin->Spare) { Message(_("Warning! Net \"%s\" is shorted to %s pin %s\n"), @@ -350,8 +350,8 @@ ALLPAD_LOOP(PCB->Data); { ElementType *e = pad->Element; -/* TODO: should be: !TEST_FLAG(NONETLISTFLAG, (ElementType *)pad->Element)*/ - if ((TEST_FLAG(DRCFLAG, pad)) && (!(e->Flags.f & NONETLISTFLAG)) && (!(e->Name->Flags.f & NONETLISTFLAG))) { +/* TODO: should be: !TEST_FLAG(PCB_FLAG_NONETLIST, (ElementType *)pad->Element)*/ + if ((TEST_FLAG(PCB_FLAG_DRC, pad)) && (!(e->Flags.f & PCB_FLAG_NONETLIST)) && (!(e->Name->Flags.f & PCB_FLAG_NONETLIST))) { warn = true; if (!pad->Spare) { Message(_("Warning! Net \"%s\" is shorted to %s pad %s\n"), @@ -401,14 +401,14 @@ a = &Netl->Net[m]; ResetConnections(false); RatFindHook(a->Connection[0].type, a->Connection[0].ptr1, a->Connection[0].ptr2, a->Connection[0].ptr2, false, AndRats); - /* now anybody connected to the first point has DRCFLAG set */ + /* now anybody connected to the first point has PCB_FLAG_DRC set */ /* so move those to this subnet */ - CLEAR_FLAG(DRCFLAG, (PinTypePtr) a->Connection[0].ptr2); + CLEAR_FLAG(PCB_FLAG_DRC, (PinTypePtr) a->Connection[0].ptr2); for (n = m + 1; n < Netl->NetN; n++) { b = &Netl->Net[n]; /* There can be only one connection in net b */ - if (TEST_FLAG(DRCFLAG, (PinTypePtr) b->Connection[0].ptr2)) { - CLEAR_FLAG(DRCFLAG, (PinTypePtr) b->Connection[0].ptr2); + if (TEST_FLAG(PCB_FLAG_DRC, (PinTypePtr) b->Connection[0].ptr2)) { + CLEAR_FLAG(PCB_FLAG_DRC, (PinTypePtr) b->Connection[0].ptr2); TransferNet(Netl, b, a); /* back up since new subnet is now at old index */ n--; @@ -419,7 +419,7 @@ /* don't add non-manhattan lines, the auto-router can't route to them */ ALLLINE_LOOP(PCB->Data); { - if (TEST_FLAG(DRCFLAG, line) + if (TEST_FLAG(PCB_FLAG_DRC, line) && ((line->Point1.X == line->Point2.X) || (line->Point1.Y == line->Point2.Y))) { conn = GetConnectionMemory(a); @@ -444,7 +444,7 @@ /* add polygons so the auto-router can see them as targets */ ALLPOLYGON_LOOP(PCB->Data); { - if (TEST_FLAG(DRCFLAG, polygon)) { + if (TEST_FLAG(PCB_FLAG_DRC, polygon)) { conn = GetConnectionMemory(a); /* make point on a vertex */ conn->X = polygon->Clipped->contours->head.point[0]; @@ -459,7 +459,7 @@ ENDALL_LOOP; VIA_LOOP(PCB->Data); { - if (TEST_FLAG(DRCFLAG, via)) { + if (TEST_FLAG(PCB_FLAG_DRC, via)) { conn = GetConnectionMemory(a); conn->X = via->X; conn->Y = via->Y; @@ -611,7 +611,7 @@ secondpoint->X, secondpoint->Y, firstpoint->group, secondpoint->group, conf_core.appearance.rat_thickness, NoFlags())) != NULL) { if (distance == 0) - SET_FLAG(VIAFLAG, line); + SET_FLAG(PCB_FLAG_VIA, line); AddObjectToCreateUndoList(PCB_TYPE_RATLINE, line, line, line); DrawRat(line); changed = true; @@ -662,7 +662,7 @@ changed = false; /* initialize finding engine */ InitConnectionLookup(); - SaveFindFlag(DRCFLAG); + SaveFindFlag(PCB_FLAG_DRC); Nets = (NetListTypePtr) calloc(1, sizeof(NetListType)); /* now we build another netlist (Nets) for each * net in Wantlist that shows how it actually looks now, @@ -680,7 +680,7 @@ { CONNECTION_LOOP(net); { - if (!SelectedOnly || TEST_FLAG(SELECTEDFLAG, (PinTypePtr) connection->ptr2)) { + if (!SelectedOnly || TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) connection->ptr2)) { lonesome = GetNetMemory(Nets); onepin = GetConnectionMemory(lonesome); *onepin = *connection; @@ -747,7 +747,7 @@ } /* initialize finding engine */ InitConnectionLookup(); - SaveFindFlag(DRCFLAG); + SaveFindFlag(PCB_FLAG_DRC); /* now we build another netlist (Nets) for each * net in Wantlist that shows how it actually looks now, * then fill in any missing connections with rat lines. @@ -765,7 +765,7 @@ Nets = GetNetListMemory(&result); CONNECTION_LOOP(net); { - if (!SelectedOnly || TEST_FLAG(SELECTEDFLAG, (PinTypePtr) connection->ptr2)) { + if (!SelectedOnly || TEST_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) connection->ptr2)) { lonesome = GetNetMemory(Nets); onepin = GetConnectionMemory(lonesome); *onepin = *connection; @@ -831,7 +831,7 @@ } /* will work for pins to since the FLAG is common */ - group1 = (TEST_FLAG(ONSOLDERFLAG, (PadTypePtr) ptr2) ? + group1 = (TEST_FLAG(PCB_FLAG_ONSOLDER, (PadTypePtr) ptr2) ? GetLayerGroupNumberByNumber(solder_silk_layer) : GetLayerGroupNumberByNumber(component_silk_layer)); strcpy(name1, ConnectionName(found, ptr1, ptr2)); found = SearchObjectByLocation(PCB_TYPE_PAD | PCB_TYPE_PIN, &ptr1, &ptr2, &ptr3, @@ -844,7 +844,7 @@ Message(_("You must name the ending element first\n")); return (NULL); } - group2 = (TEST_FLAG(ONSOLDERFLAG, (PadTypePtr) ptr2) ? + group2 = (TEST_FLAG(PCB_FLAG_ONSOLDER, (PadTypePtr) ptr2) ? GetLayerGroupNumberByNumber(solder_silk_layer) : GetLayerGroupNumberByNumber(component_silk_layer)); name2 = ConnectionName(found, ptr1, ptr2); Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 2508) +++ trunk/src/rats_act.c (revision 2509) @@ -89,7 +89,7 @@ shorty = NULL; RAT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, line)) + if (TEST_FLAG(PCB_FLAG_SELECTED, line)) continue; len = SQUARE(line->Point1.X - line->Point2.X) + SQUARE(line->Point1.Y - line->Point2.Y); if (len < small) { @@ -100,7 +100,7 @@ END_LOOP; if (shorty) { AddObjectToFlagUndoList(PCB_TYPE_RATLINE, shorty, shorty, shorty); - SET_FLAG(SELECTEDFLAG, shorty); + SET_FLAG(PCB_FLAG_SELECTED, shorty); DrawRat(shorty); Draw(); CenterDisplay((shorty->Point2.X + shorty->Point1.X) / 2, (shorty->Point2.Y + shorty->Point1.Y) / 2); @@ -148,7 +148,7 @@ case F_Find: { gui->get_coords(_("Click on a connection"), &x, &y); - LookupConnection(x, y, true, 1, FOUNDFLAG); + LookupConnection(x, y, true, 1, PCB_FLAG_FOUND); break; } Index: trunk/src/rats_patch.c =================================================================== --- trunk/src/rats_patch.c (revision 2508) +++ trunk/src/rats_patch.c (revision 2509) @@ -373,7 +373,7 @@ /* check if we have elements selected and quit if not */ ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { found = 1; break; } @@ -408,7 +408,7 @@ /* action: replace selected elements */ ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { a[0] = fpname; a[1] = element->Name[1].TextString; a[2] = element->Name[2].TextString; Index: trunk/src/remove.c =================================================================== --- trunk/src/remove.c (revision 2508) +++ trunk/src/remove.c (revision 2509) @@ -536,7 +536,7 @@ Bulk = true; RAT_LOOP(PCB->Data); { - if ((!selected) || TEST_FLAG(SELECTEDFLAG, line)) { + if ((!selected) || TEST_FLAG(PCB_FLAG_SELECTED, line)) { changed = true; RemoveRat(line); } Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 2508) +++ trunk/src/rotate.c (revision 2509) @@ -120,7 +120,7 @@ { BYTE number; - number = TEST_FLAG(ONSOLDERFLAG, Text) ? (4 - Number) & 3 : Number; + number = TEST_FLAG(PCB_FLAG_ONSOLDER, Text) ? (4 - Number) & 3 : Number; RotateBoxLowLevel(&Text->BoundingBox, X, Y, Number); ROTATE(Text->X, Text->Y, X, Y, Number); @@ -336,7 +336,7 @@ ptr = Crosshair.AttachedObject.Rubberband; while (Crosshair.AttachedObject.RubberbandN) { changed = true; - CLEAR_FLAG(RUBBERENDFLAG, ptr->Line); + CLEAR_FLAG(PCB_FLAG_RUBBEREND, ptr->Line); AddObjectToRotateUndoList(PCB_TYPE_LINE_POINT, ptr->Layer, ptr->Line, ptr->MovedPoint, CenterX, CenterY, Steps); EraseLine(ptr->Line); if (ptr->Layer) { @@ -374,7 +374,7 @@ int type; void *ptr1, *ptr2, *ptr3; if ((type = SearchScreen(X, Y, ROTATE_TYPES, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) { - if (TEST_FLAG(LOCKFLAG, (ArcTypePtr) ptr2)) { + if (TEST_FLAG(PCB_FLAG_LOCK, (ArcTypePtr) ptr2)) { Message(_("Sorry, the object is locked\n")); return; } Index: trunk/src/rubberband.c =================================================================== --- trunk/src/rubberband.c (revision 2508) +++ trunk/src/rubberband.c (revision 2509) @@ -72,7 +72,7 @@ t = line->Thickness / 2; - if (TEST_FLAG(LOCKFLAG, line)) + if (TEST_FLAG(PCB_FLAG_LOCK, line)) return R_DIR_NOT_FOUND; if (line == i->line) return R_DIR_NOT_FOUND; @@ -192,7 +192,7 @@ info.box.Y2 = MAX(Pad->Point1.Y, Pad->Point2.Y) + half; info.radius = 0; info.line = NULL; - i = TEST_FLAG(ONSOLDERFLAG, Pad) ? solder_silk_layer : component_silk_layer; + i = TEST_FLAG(PCB_FLAG_ONSOLDER, Pad) ? solder_silk_layer : component_silk_layer; group = GetLayerGroupNumberByNumber(i); /* check all visible layers in the same group */ @@ -262,7 +262,7 @@ struct rinfo info; Cardinal i; - i = TEST_FLAG(ONSOLDERFLAG, Pad) ? solder_silk_layer : component_silk_layer; + i = TEST_FLAG(PCB_FLAG_ONSOLDER, Pad) ? solder_silk_layer : component_silk_layer; info.group = GetLayerGroupNumberByNumber(i); info.pad = Pad; info.type = PCB_TYPE_PAD; @@ -308,7 +308,7 @@ info.box.Y1 = Pin->Y - t; info.box.Y2 = Pin->Y + t; info.line = NULL; - if (TEST_FLAG(SQUAREFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_SQUARE, Pin)) info.radius = 0; else { info.radius = t; @@ -375,9 +375,9 @@ */ LINE_LOOP(layer); { - if (TEST_FLAG(LOCKFLAG, line)) + if (TEST_FLAG(PCB_FLAG_LOCK, line)) continue; - if (TEST_FLAG(CLEARLINEFLAG, line)) + if (TEST_FLAG(PCB_FLAG_CLEARLINE, line)) continue; thick = (line->Thickness + 1) / 2; if (IsPointInPolygon(line->Point1.X, line->Point1.Y, thick, Polygon)) Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 2508) +++ trunk/src/search.c (revision 2509) @@ -75,7 +75,7 @@ void **ptr1, **ptr2, **ptr3; bool BackToo; double area; - int locked; /* This will be zero or LOCKFLAG */ + int locked; /* This will be zero or PCB_FLAG_LOCK */ }; static r_dir_t pinorvia_callback(const BoxType * box, void *cl) @@ -105,7 +105,7 @@ info.ptr1 = (void **) Via; info.ptr2 = (void **) Dummy1; info.ptr3 = (void **) Dummy2; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(PCB->Data->via_tree, &SearchBox, NULL, pinorvia_callback, &info, NULL) != R_DIR_NOT_FOUND) return true; @@ -126,7 +126,7 @@ info.ptr1 = (void **) Element; info.ptr2 = (void **) Pin; info.ptr3 = (void **) Dummy; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(PCB->Data->pin_tree, &SearchBox, NULL, pinorvia_callback, &info, NULL) != R_DIR_NOT_FOUND) return true; @@ -166,7 +166,7 @@ info.ptr1 = (void **) Element; info.ptr2 = (void **) Pad; info.ptr3 = (void **) Dummy; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; info.BackToo = (BackToo && PCB->InvisibleObjectsOn); if (r_search(PCB->Data->pad_tree, &SearchBox, NULL, pad_callback, &info, NULL) != R_DIR_NOT_FOUND) return true; @@ -207,7 +207,7 @@ info.Line = Line; info.Point = (PointTypePtr *) Dummy; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; *Layer = SearchLayer; if (r_search(SearchLayer->line_tree, &SearchBox, NULL, line_callback, &info, NULL) != R_DIR_NOT_FOUND) @@ -224,7 +224,7 @@ if (TEST_FLAG(i->locked, line)) return R_DIR_NOT_FOUND; - if (TEST_FLAG(VIAFLAG, line) ? + if (TEST_FLAG(PCB_FLAG_VIA, line) ? (Distance(line->Point1.X, line->Point1.Y, PosX, PosY) <= line->Thickness * 2 + SearchRadius) : IsPointOnLine(PosX, PosY, SearchRadius, line)) { *i->ptr1 = *i->ptr2 = *i->ptr3 = line; @@ -243,7 +243,7 @@ info.ptr1 = (void **) Line; info.ptr2 = (void **) Dummy1; info.ptr3 = (void **) Dummy2; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(PCB->Data->rat_tree, &SearchBox, NULL, rat_callback, &info, NULL) != R_DIR_NOT_FOUND) return true; @@ -280,7 +280,7 @@ info.Arc = Arc; info.Dummy = Dummy; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; *Layer = SearchLayer; if (r_search(SearchLayer->arc_tree, &SearchBox, NULL, arc_callback, &info, NULL) != R_DIR_NOT_FOUND) @@ -313,7 +313,7 @@ *Layer = SearchLayer; info.ptr2 = (void **) Text; info.ptr3 = (void **) Dummy; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(SearchLayer->text_tree, &SearchBox, NULL, text_callback, &info, NULL) != R_DIR_NOT_FOUND) return true; @@ -346,7 +346,7 @@ *Layer = SearchLayer; info.ptr2 = (void **) Polygon; info.ptr3 = (void **) Dummy; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(SearchLayer->polygon_tree, &SearchBox, NULL, polygon_callback, &info, NULL) != R_DIR_NOT_FOUND) return true; @@ -393,7 +393,7 @@ info.Point = Point; *Point = NULL; info.least = MAX_LINE_POINT_DISTANCE + SearchRadius; - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(SearchLayer->line_tree, &SearchBox, NULL, linepoint_callback, &info, NULL)) return true; return false; @@ -440,7 +440,7 @@ if (TEST_FLAG(i->locked, text)) return R_DIR_NOT_FOUND; - if ((FRONT(element) || i->BackToo) && !TEST_FLAG(HIDENAMEFLAG, element) && POINT_IN_BOX(PosX, PosY, &text->BoundingBox)) { + if ((FRONT(element) || i->BackToo) && !TEST_FLAG(PCB_FLAG_HIDENAME, element) && POINT_IN_BOX(PosX, PosY, &text->BoundingBox)) { /* use the text with the smallest bounding box */ newarea = (text->BoundingBox.X2 - text->BoundingBox.X1) * (double) (text->BoundingBox.Y2 - text->BoundingBox.Y1); if (newarea < i->area) { @@ -469,7 +469,7 @@ info.ptr3 = (void **) Dummy; info.area = SQUARE(MAX_COORD); info.BackToo = (BackToo && PCB->InvisibleObjectsOn); - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(PCB->Data->name_tree[NAME_INDEX()], &SearchBox, NULL, name_callback, &info, NULL)) return true; } @@ -514,7 +514,7 @@ info.ptr3 = (void **) Dummy2; info.area = SQUARE(MAX_COORD); info.BackToo = (BackToo && PCB->InvisibleObjectsOn); - info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : LOCKFLAG; + info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(PCB->Data->element_tree, &SearchBox, NULL, element_callback, &info, NULL)) return true; } @@ -527,7 +527,7 @@ bool IsPointOnPin(Coord X, Coord Y, Coord Radius, PinTypePtr pin) { Coord t = PIN_SIZE(pin) / 2; - if (TEST_FLAG(SQUAREFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) { BoxType b; b.X1 = pin->X - t; @@ -823,7 +823,7 @@ /* now pad.Point2.X = r; pad.Point2.Y = 0; */ /* take into account the ends */ - if (TEST_FLAG(SQUAREFLAG, Pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, Pad)) { r += Pad->Thickness; X += t2; } @@ -830,7 +830,7 @@ if (Y < 0) Y = -Y; /* range value is evident now */ - if (TEST_FLAG(SQUAREFLAG, Pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, Pad)) { if (X <= 0) { if (Y <= t2) range = -X; Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 2508) +++ trunk/src/select.c (revision 2509) @@ -63,12 +63,12 @@ bool changed = true; type = SearchScreen(Crosshair.X, Crosshair.Y, SELECT_TYPES, &ptr1, &ptr2, &ptr3); - if (type == PCB_TYPE_NONE || TEST_FLAG(LOCKFLAG, (PinTypePtr) ptr2)) + if (type == PCB_TYPE_NONE || TEST_FLAG(PCB_FLAG_LOCK, (PinTypePtr) ptr2)) return (false); switch (type) { case PCB_TYPE_VIA: AddObjectToFlagUndoList(PCB_TYPE_VIA, ptr1, ptr1, ptr1); - TOGGLE_FLAG(SELECTEDFLAG, (PinTypePtr) ptr1); + TOGGLE_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) ptr1); DrawVia((PinTypePtr) ptr1); break; @@ -78,7 +78,7 @@ layer = (LayerTypePtr) ptr1; AddObjectToFlagUndoList(PCB_TYPE_LINE, ptr1, ptr2, ptr2); - TOGGLE_FLAG(SELECTEDFLAG, line); + TOGGLE_FLAG(PCB_FLAG_SELECTED, line); DrawLine(layer, line); break; } @@ -88,7 +88,7 @@ RatTypePtr rat = (RatTypePtr) ptr2; AddObjectToFlagUndoList(PCB_TYPE_RATLINE, ptr1, ptr1, ptr1); - TOGGLE_FLAG(SELECTEDFLAG, rat); + TOGGLE_FLAG(PCB_FLAG_SELECTED, rat); DrawRat(rat); break; } @@ -99,7 +99,7 @@ layer = (LayerTypePtr) ptr1; AddObjectToFlagUndoList(PCB_TYPE_ARC, ptr1, ptr2, ptr2); - TOGGLE_FLAG(SELECTEDFLAG, arc); + TOGGLE_FLAG(PCB_FLAG_SELECTED, arc); DrawArc(layer, arc); break; } @@ -110,7 +110,7 @@ layer = (LayerTypePtr) ptr1; AddObjectToFlagUndoList(PCB_TYPE_TEXT, ptr1, ptr2, ptr2); - TOGGLE_FLAG(SELECTEDFLAG, text); + TOGGLE_FLAG(PCB_FLAG_SELECTED, text); DrawText(layer, text); break; } @@ -121,7 +121,7 @@ layer = (LayerTypePtr) ptr1; AddObjectToFlagUndoList(PCB_TYPE_POLYGON, ptr1, ptr2, ptr2); - TOGGLE_FLAG(SELECTEDFLAG, poly); + TOGGLE_FLAG(PCB_FLAG_SELECTED, poly); DrawPolygon(layer, poly); /* changing memory order no longer effects draw order */ break; @@ -129,13 +129,13 @@ case PCB_TYPE_PIN: AddObjectToFlagUndoList(PCB_TYPE_PIN, ptr1, ptr2, ptr2); - TOGGLE_FLAG(SELECTEDFLAG, (PinTypePtr) ptr2); + TOGGLE_FLAG(PCB_FLAG_SELECTED, (PinTypePtr) ptr2); DrawPin((PinTypePtr) ptr2); break; case PCB_TYPE_PAD: AddObjectToFlagUndoList(PCB_TYPE_PAD, ptr1, ptr2, ptr2); - TOGGLE_FLAG(SELECTEDFLAG, (PadTypePtr) ptr2); + TOGGLE_FLAG(PCB_FLAG_SELECTED, (PadTypePtr) ptr2); DrawPad((PadTypePtr) ptr2); break; @@ -147,7 +147,7 @@ ELEMENTTEXT_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text); - TOGGLE_FLAG(SELECTEDFLAG, text); + TOGGLE_FLAG(PCB_FLAG_SELECTED, text); } END_LOOP; DrawElementName(element); @@ -162,24 +162,24 @@ PIN_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); - TOGGLE_FLAG(SELECTEDFLAG, pin); + TOGGLE_FLAG(PCB_FLAG_SELECTED, pin); } END_LOOP; PAD_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad); - TOGGLE_FLAG(SELECTEDFLAG, pad); + TOGGLE_FLAG(PCB_FLAG_SELECTED, pad); } END_LOOP; ELEMENTTEXT_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text); - TOGGLE_FLAG(SELECTEDFLAG, text); + TOGGLE_FLAG(PCB_FLAG_SELECTED, text); } END_LOOP; AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element); - TOGGLE_FLAG(SELECTEDFLAG, element); - if (PCB->ElementOn && ((TEST_FLAG(ONSOLDERFLAG, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)) + TOGGLE_FLAG(PCB_FLAG_SELECTED, element); + if (PCB->ElementOn && ((TEST_FLAG(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)) if (PCB->ElementOn) { DrawElementName(element); DrawElementPackage(element); @@ -214,7 +214,7 @@ do { \ if (len == NULL) { \ AddObjectToFlagUndoList (undo_type, p1, obj, obj); \ - ASSIGN_FLAG (SELECTEDFLAG, Flag, obj); \ + ASSIGN_FLAG (PCB_FLAG_SELECTED, Flag, obj); \ } \ else { \ if (used >= alloced) { \ @@ -236,7 +236,7 @@ if (PCB->RatOn || !Flag) RAT_LOOP(PCB->Data); { - if (LINE_NEAR_BOX((LineTypePtr) line, Box) && !TEST_FLAG(LOCKFLAG, line) && TEST_FLAG(SELECTEDFLAG, line) != Flag) { + if (LINE_NEAR_BOX((LineTypePtr) line, Box) && !TEST_FLAG(PCB_FLAG_LOCK, line) && TEST_FLAG(PCB_FLAG_SELECTED, line) != Flag) { append(PCB_TYPE_RATLINE, line, line); if (PCB->RatOn) DrawRat(line); @@ -261,8 +261,8 @@ LINE_LOOP(layer); { if (LINE_NEAR_BOX(line, Box) - && !TEST_FLAG(LOCKFLAG, line) - && TEST_FLAG(SELECTEDFLAG, line) != Flag) { + && !TEST_FLAG(PCB_FLAG_LOCK, line) + && TEST_FLAG(PCB_FLAG_SELECTED, line) != Flag) { append(PCB_TYPE_LINE, layer, line); if (layer->On) DrawLine(layer, line); @@ -272,8 +272,8 @@ ARC_LOOP(layer); { if (ARC_NEAR_BOX(arc, Box) - && !TEST_FLAG(LOCKFLAG, arc) - && TEST_FLAG(SELECTEDFLAG, arc) != Flag) { + && !TEST_FLAG(PCB_FLAG_LOCK, arc) + && TEST_FLAG(PCB_FLAG_SELECTED, arc) != Flag) { append(PCB_TYPE_ARC, layer, arc); if (layer->On) DrawArc(layer, arc); @@ -284,8 +284,8 @@ { if (!Flag || TEXT_IS_VISIBLE(PCB, layer, text)) { if (TEXT_NEAR_BOX(text, Box) - && !TEST_FLAG(LOCKFLAG, text) - && TEST_FLAG(SELECTEDFLAG, text) != Flag) { + && !TEST_FLAG(PCB_FLAG_LOCK, text) + && TEST_FLAG(PCB_FLAG_SELECTED, text) != Flag) { append(PCB_TYPE_TEXT, layer, text); if (TEXT_IS_VISIBLE(PCB, layer, text)) DrawText(layer, text); @@ -296,8 +296,8 @@ POLYGON_LOOP(layer); { if (POLYGON_NEAR_BOX(polygon, Box) - && !TEST_FLAG(LOCKFLAG, polygon) - && TEST_FLAG(SELECTEDFLAG, polygon) != Flag) { + && !TEST_FLAG(PCB_FLAG_LOCK, polygon) + && TEST_FLAG(PCB_FLAG_SELECTED, polygon) != Flag) { append(PCB_TYPE_POLYGON, layer, polygon); if (layer->On) DrawPolygon(layer, polygon); @@ -313,11 +313,11 @@ { bool gotElement = false; if ((PCB->ElementOn || !Flag) - && !TEST_FLAG(LOCKFLAG, element) - && ((TEST_FLAG(ONSOLDERFLAG, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)) { + && !TEST_FLAG(PCB_FLAG_LOCK, element) + && ((TEST_FLAG(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)) { if (BOX_NEAR_BOX(&ELEMENT_TEXT(PCB, element).BoundingBox, Box) - && !TEST_FLAG(LOCKFLAG, &ELEMENT_TEXT(PCB, element)) - && TEST_FLAG(SELECTEDFLAG, &ELEMENT_TEXT(PCB, element)) != Flag) { + && !TEST_FLAG(PCB_FLAG_LOCK, &ELEMENT_TEXT(PCB, element)) + && TEST_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element)) != Flag) { /* select all names of element */ ELEMENTTEXT_LOOP(element); { @@ -328,11 +328,11 @@ DrawElementName(element); } if ((PCB->PinOn || !Flag) && ELEMENT_NEAR_BOX(element, Box)) - if (TEST_FLAG(SELECTEDFLAG, element) != Flag) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element) != Flag) { append(PCB_TYPE_ELEMENT, element, element); PIN_LOOP(element); { - if (TEST_FLAG(SELECTEDFLAG, pin) != Flag) { + if (TEST_FLAG(PCB_FLAG_SELECTED, pin) != Flag) { append(PCB_TYPE_PIN, element, pin); if (PCB->PinOn) DrawPin(pin); @@ -341,7 +341,7 @@ END_LOOP; PAD_LOOP(element); { - if (TEST_FLAG(SELECTEDFLAG, pad) != Flag) { + if (TEST_FLAG(PCB_FLAG_SELECTED, pad) != Flag) { append(PCB_TYPE_PAD, element, pad); if (PCB->PinOn) DrawPad(pad); @@ -353,11 +353,11 @@ gotElement = true; } } - if ((PCB->PinOn || !Flag) && !TEST_FLAG(LOCKFLAG, element) && !gotElement) { + if ((PCB->PinOn || !Flag) && !TEST_FLAG(PCB_FLAG_LOCK, element) && !gotElement) { PIN_LOOP(element); { if ((VIA_OR_PIN_NEAR_BOX(pin, Box) - && TEST_FLAG(SELECTEDFLAG, pin) != Flag)) { + && TEST_FLAG(PCB_FLAG_SELECTED, pin) != Flag)) { append(PCB_TYPE_PIN, element, pin); if (PCB->PinOn) DrawPin(pin); @@ -367,8 +367,8 @@ PAD_LOOP(element); { if (PAD_NEAR_BOX(pad, Box) - && TEST_FLAG(SELECTEDFLAG, pad) != Flag - && (TEST_FLAG(ONSOLDERFLAG, pad) == SWAP_IDENT || PCB->InvisibleObjectsOn || !Flag)) { + && TEST_FLAG(PCB_FLAG_SELECTED, pad) != Flag + && (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == SWAP_IDENT || PCB->InvisibleObjectsOn || !Flag)) { append(PCB_TYPE_PAD, element, pad); if (PCB->PinOn) DrawPad(pad); @@ -384,8 +384,8 @@ VIA_LOOP(PCB->Data); { if (VIA_OR_PIN_NEAR_BOX(via, Box) - && !TEST_FLAG(LOCKFLAG, via) - && TEST_FLAG(SELECTEDFLAG, via) != Flag) { + && !TEST_FLAG(PCB_FLAG_LOCK, via) + && TEST_FLAG(PCB_FLAG_SELECTED, via) != Flag) { append(PCB_TYPE_VIA, via, via); if (PCB->ViaOn) DrawVia(via); @@ -512,10 +512,10 @@ if (type & PCB_TYPE_LINE && F->Line) VISIBLELINE_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, line)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line); - CLEAR_FLAG(SELECTEDFLAG, line); + CLEAR_FLAG(PCB_FLAG_SELECTED, line); } F->Line(layer, line); changed = true; @@ -527,10 +527,10 @@ if (type & PCB_TYPE_ARC && F->Arc) VISIBLEARC_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, arc)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, arc)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc); - CLEAR_FLAG(SELECTEDFLAG, arc); + CLEAR_FLAG(PCB_FLAG_SELECTED, arc); } F->Arc(layer, arc); changed = true; @@ -542,10 +542,10 @@ if (type & PCB_TYPE_TEXT && F->Text) ALLTEXT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, text) && TEXT_IS_VISIBLE(PCB, layer, text)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, text) && TEXT_IS_VISIBLE(PCB, layer, text)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_TEXT, layer, text, text); - CLEAR_FLAG(SELECTEDFLAG, text); + CLEAR_FLAG(PCB_FLAG_SELECTED, text); } F->Text(layer, text); changed = true; @@ -557,10 +557,10 @@ if (type & PCB_TYPE_POLYGON && F->Polygon) VISIBLEPOLYGON_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, polygon)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, polygon)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon); - CLEAR_FLAG(SELECTEDFLAG, polygon); + CLEAR_FLAG(PCB_FLAG_SELECTED, polygon); } F->Polygon(layer, polygon); changed = true; @@ -572,10 +572,10 @@ if (type & PCB_TYPE_ELEMENT && PCB->ElementOn && F->Element) ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element); - CLEAR_FLAG(SELECTEDFLAG, element); + CLEAR_FLAG(PCB_FLAG_SELECTED, element); } F->Element(element); changed = true; @@ -585,10 +585,10 @@ if (type & PCB_TYPE_ELEMENT_NAME && PCB->ElementOn && F->ElementName) ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, &ELEMENT_TEXT(PCB, element))) { + if (TEST_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element))) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, &ELEMENT_TEXT(PCB, element), &ELEMENT_TEXT(PCB, element)); - CLEAR_FLAG(SELECTEDFLAG, &ELEMENT_TEXT(PCB, element)); + CLEAR_FLAG(PCB_FLAG_SELECTED, &ELEMENT_TEXT(PCB, element)); } F->ElementName(element); changed = true; @@ -601,10 +601,10 @@ { PIN_LOOP(element); { - if (TEST_FLAG(SELECTEDFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, pin)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); - CLEAR_FLAG(SELECTEDFLAG, pin); + CLEAR_FLAG(PCB_FLAG_SELECTED, pin); } F->Pin(element, pin); changed = true; @@ -619,10 +619,10 @@ { PAD_LOOP(element); { - if (TEST_FLAG(SELECTEDFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, pad)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad); - CLEAR_FLAG(SELECTEDFLAG, pad); + CLEAR_FLAG(PCB_FLAG_SELECTED, pad); } F->Pad(element, pad); changed = true; @@ -636,10 +636,10 @@ if (type & PCB_TYPE_VIA && PCB->ViaOn && F->Via) VIA_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, via)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, via)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via); - CLEAR_FLAG(SELECTEDFLAG, via); + CLEAR_FLAG(PCB_FLAG_SELECTED, via); } F->Via(via); changed = true; @@ -650,10 +650,10 @@ if (type & PCB_TYPE_RATLINE && PCB->RatOn && F->Rat) RAT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, line)) { if (Reset) { AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line); - CLEAR_FLAG(SELECTEDFLAG, line); + CLEAR_FLAG(PCB_FLAG_SELECTED, line); } F->Rat(line); changed = true; @@ -679,9 +679,9 @@ if (PCB->RatOn) RAT_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_FOUND, line)) { AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line); - ASSIGN_FLAG(SELECTEDFLAG, Flag, line); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, line); DrawRat(line); changed = true; } @@ -690,9 +690,9 @@ VISIBLELINE_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, line) && !TEST_FLAG(LOCKFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_FOUND, line) && !TEST_FLAG(PCB_FLAG_LOCK, line)) { AddObjectToFlagUndoList(PCB_TYPE_LINE, layer, line, line); - ASSIGN_FLAG(SELECTEDFLAG, Flag, line); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, line); DrawLine(layer, line); changed = true; } @@ -700,9 +700,9 @@ ENDALL_LOOP; VISIBLEARC_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, arc) && !TEST_FLAG(LOCKFLAG, arc)) { + if (TEST_FLAG(PCB_FLAG_FOUND, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc)) { AddObjectToFlagUndoList(PCB_TYPE_ARC, layer, arc, arc); - ASSIGN_FLAG(SELECTEDFLAG, Flag, arc); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, arc); DrawArc(layer, arc); changed = true; } @@ -710,9 +710,9 @@ ENDALL_LOOP; VISIBLEPOLYGON_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, polygon) && !TEST_FLAG(LOCKFLAG, polygon)) { + if (TEST_FLAG(PCB_FLAG_FOUND, polygon) && !TEST_FLAG(PCB_FLAG_LOCK, polygon)) { AddObjectToFlagUndoList(PCB_TYPE_POLYGON, layer, polygon, polygon); - ASSIGN_FLAG(SELECTEDFLAG, Flag, polygon); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, polygon); DrawPolygon(layer, polygon); changed = true; } @@ -722,9 +722,9 @@ if (PCB->PinOn && PCB->ElementOn) { ALLPIN_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, element) && TEST_FLAG(FOUNDFLAG, pin)) { + if (!TEST_FLAG(PCB_FLAG_LOCK, element) && TEST_FLAG(PCB_FLAG_FOUND, pin)) { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); - ASSIGN_FLAG(SELECTEDFLAG, Flag, pin); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pin); DrawPin(pin); changed = true; } @@ -732,9 +732,9 @@ ENDALL_LOOP; ALLPAD_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, element) && TEST_FLAG(FOUNDFLAG, pad)) { + if (!TEST_FLAG(PCB_FLAG_LOCK, element) && TEST_FLAG(PCB_FLAG_FOUND, pad)) { AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad); - ASSIGN_FLAG(SELECTEDFLAG, Flag, pad); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pad); DrawPad(pad); changed = true; } @@ -745,9 +745,9 @@ if (PCB->ViaOn) VIA_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, via) && !TEST_FLAG(LOCKFLAG, via)) { + if (TEST_FLAG(PCB_FLAG_FOUND, via) && !TEST_FLAG(PCB_FLAG_LOCK, via)) { AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via); - ASSIGN_FLAG(SELECTEDFLAG, Flag, via); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, via); DrawVia(via); changed = true; } @@ -852,12 +852,12 @@ if (Type & PCB_TYPE_TEXT) ALLTEXT_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, text) + if (!TEST_FLAG(PCB_FLAG_LOCK, text) && TEXT_IS_VISIBLE(PCB, layer, text) && text->TextString && REGEXEC(text->TextString) - && TEST_FLAG(SELECTEDFLAG, text) != Flag) { + && TEST_FLAG(PCB_FLAG_SELECTED, text) != Flag) { AddObjectToFlagUndoList(PCB_TYPE_TEXT, layer, text, text); - ASSIGN_FLAG(SELECTEDFLAG, Flag, text); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, text); DrawText(layer, text); changed = true; } @@ -867,29 +867,29 @@ if (PCB->ElementOn && (Type & PCB_TYPE_ELEMENT)) ELEMENT_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, element) - && ((TEST_FLAG(ONSOLDERFLAG, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn) - && TEST_FLAG(SELECTEDFLAG, element) != Flag) { + if (!TEST_FLAG(PCB_FLAG_LOCK, element) + && ((TEST_FLAG(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn) + && TEST_FLAG(PCB_FLAG_SELECTED, element) != Flag) { String name = ELEMENT_NAME(PCB, element); if (name && REGEXEC(name)) { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element); - ASSIGN_FLAG(SELECTEDFLAG, Flag, element); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, element); PIN_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); - ASSIGN_FLAG(SELECTEDFLAG, Flag, pin); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pin); } END_LOOP; PAD_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad); - ASSIGN_FLAG(SELECTEDFLAG, Flag, pad); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pad); } END_LOOP; ELEMENTTEXT_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text); - ASSIGN_FLAG(SELECTEDFLAG, Flag, text); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, text); } END_LOOP; DrawElementName(element); @@ -902,11 +902,11 @@ if (PCB->PinOn && (Type & PCB_TYPE_PIN)) ALLPIN_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, element) + if (!TEST_FLAG(PCB_FLAG_LOCK, element) && pin->Name && REGEXEC(pin->Name) - && TEST_FLAG(SELECTEDFLAG, pin) != Flag) { + && TEST_FLAG(PCB_FLAG_SELECTED, pin) != Flag) { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); - ASSIGN_FLAG(SELECTEDFLAG, Flag, pin); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pin); DrawPin(pin); changed = true; } @@ -915,12 +915,12 @@ if (PCB->PinOn && (Type & PCB_TYPE_PAD)) ALLPAD_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, element) - && ((TEST_FLAG(ONSOLDERFLAG, pad) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn) - && TEST_FLAG(SELECTEDFLAG, pad) != Flag) + if (!TEST_FLAG(PCB_FLAG_LOCK, element) + && ((TEST_FLAG(PCB_FLAG_ONSOLDER, pad) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn) + && TEST_FLAG(PCB_FLAG_SELECTED, pad) != Flag) if (pad->Name && REGEXEC(pad->Name)) { AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad); - ASSIGN_FLAG(SELECTEDFLAG, Flag, pad); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, pad); DrawPad(pad); changed = true; } @@ -929,10 +929,10 @@ if (PCB->ViaOn && (Type & PCB_TYPE_VIA)) VIA_LOOP(PCB->Data); { - if (!TEST_FLAG(LOCKFLAG, via) - && via->Name && REGEXEC(via->Name) && TEST_FLAG(SELECTEDFLAG, via) != Flag) { + if (!TEST_FLAG(PCB_FLAG_LOCK, via) + && via->Name && REGEXEC(via->Name) && TEST_FLAG(PCB_FLAG_SELECTED, via) != Flag) { AddObjectToFlagUndoList(PCB_TYPE_VIA, via, via, via); - ASSIGN_FLAG(SELECTEDFLAG, Flag, via); + ASSIGN_FLAG(PCB_FLAG_SELECTED, Flag, via); DrawVia(via); changed = true; } Index: trunk/src/strflags.c =================================================================== --- trunk/src/strflags.c (revision 2508) +++ trunk/src/strflags.c (revision 2509) @@ -50,30 +50,30 @@ #define N(x) x, sizeof(x)-1 static FlagBitsType object_flagbits[] = { - {PINFLAG, N("pin"), PCB_TYPEMASK_ALL}, - {VIAFLAG, N("via"), PCB_TYPEMASK_ALL}, - {FOUNDFLAG, N("found"), PCB_TYPEMASK_ALL}, - {HOLEFLAG, N("hole"), PCB_TYPEMASK_PIN}, - {RATFLAG, N("rat"), PCB_TYPE_RATLINE}, - {PININPOLYFLAG, N("pininpoly"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, - {CLEARPOLYFLAG, N("clearpoly"), PCB_TYPE_POLYGON}, - {HIDENAMEFLAG, N("hidename"), PCB_TYPE_ELEMENT}, - {DISPLAYNAMEFLAG, N("showname"), PCB_TYPE_ELEMENT}, - {CLEARLINEFLAG, N("clearline"), PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_TEXT}, - {SELECTEDFLAG, N("selected"), PCB_TYPEMASK_ALL}, - {ONSOLDERFLAG, N("onsolder"), PCB_TYPE_ELEMENT | PCB_TYPE_PAD | PCB_TYPE_TEXT}, - {AUTOFLAG, N("auto"), PCB_TYPEMASK_ALL}, - {SQUAREFLAG, N("square"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, - {RUBBERENDFLAG, N("rubberend"), PCB_TYPE_LINE | PCB_TYPE_ARC}, - {WARNFLAG, N("warn"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, - {USETHERMALFLAG, N("usetherm"), PCB_TYPEMASK_PIN | PCB_TYPE_LINE | PCB_TYPE_ARC}, - {OCTAGONFLAG, N("octagon"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, - {DRCFLAG, N("drc"), PCB_TYPEMASK_ALL}, - {LOCKFLAG, N("lock"), PCB_TYPEMASK_ALL}, - {EDGE2FLAG, N("edge2"), PCB_TYPEMASK_ALL}, - {FULLPOLYFLAG, N("fullpoly"), PCB_TYPE_POLYGON}, - {NOPASTEFLAG, N("nopaste"), PCB_TYPE_PAD}, - {NONETLISTFLAG, N("nonetlist"), PCB_TYPEMASK_ALL} + {PCB_FLAG_PIN, N("pin"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_VIA, N("via"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_FOUND, N("found"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_HOLE, N("hole"), PCB_TYPEMASK_PIN}, + {PCB_FLAG_RAT, N("rat"), PCB_TYPE_RATLINE}, + {PCB_FLAG_PININPOLY, N("pininpoly"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, + {PCB_FLAG_CLEARPOLY, N("clearpoly"), PCB_TYPE_POLYGON}, + {PCB_FLAG_HIDENAME, N("hidename"), PCB_TYPE_ELEMENT}, + {PCB_FLAG_DISPLAYNAME, N("showname"), PCB_TYPE_ELEMENT}, + {PCB_FLAG_CLEARLINE, N("clearline"), PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_TEXT}, + {PCB_FLAG_SELECTED, N("selected"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_ONSOLDER, N("onsolder"), PCB_TYPE_ELEMENT | PCB_TYPE_PAD | PCB_TYPE_TEXT}, + {PCB_FLAG_AUTO, N("auto"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_SQUARE, N("square"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, + {PCB_FLAG_RUBBEREND, N("rubberend"), PCB_TYPE_LINE | PCB_TYPE_ARC}, + {PCB_FLAG_WARN, N("warn"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, + {PCB_FLAG_USETHERMAL, N("usetherm"), PCB_TYPEMASK_PIN | PCB_TYPE_LINE | PCB_TYPE_ARC}, + {PCB_FLAG_OCTAGON, N("octagon"), PCB_TYPEMASK_PIN | PCB_TYPE_PAD}, + {PCB_FLAG_DRC, N("drc"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_LOCK, N("lock"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_EDGE2, N("edge2"), PCB_TYPEMASK_ALL}, + {PCB_FLAG_FULLPOLY, N("fullpoly"), PCB_TYPE_POLYGON}, + {PCB_FLAG_NOPASTE, N("nopaste"), PCB_TYPE_PAD}, + {PCB_FLAG_NONETLIST, N("nonetlist"), PCB_TYPEMASK_ALL} }; #undef N @@ -429,13 +429,13 @@ #ifndef FLAG_TEST switch (object_type) { case PCB_TYPE_VIA: - CLEAR_FLAG(VIAFLAG, &fh); + CLEAR_FLAG(PCB_FLAG_VIA, &fh); break; case PCB_TYPE_RATLINE: - CLEAR_FLAG(RATFLAG, &fh); + CLEAR_FLAG(PCB_FLAG_RAT, &fh); break; case PCB_TYPE_PIN: - CLEAR_FLAG(PINFLAG, &fh); + CLEAR_FLAG(PCB_FLAG_PIN, &fh); break; } #endif Index: trunk/src/stub_mincut.c =================================================================== --- trunk/src/stub_mincut.c (revision 2508) +++ trunk/src/stub_mincut.c (revision 2509) @@ -32,9 +32,9 @@ { /* original behavior: just warn at random pins/pads */ if (pin != NULL) - SET_FLAG(WARNFLAG, pin); + SET_FLAG(PCB_FLAG_WARN, pin); if (pad != NULL) - SET_FLAG(WARNFLAG, pad); + SET_FLAG(PCB_FLAG_WARN, pad); stub_rat_proc_shorts_dummy(); } Index: trunk/src/thermal.c =================================================================== --- trunk/src/thermal.c (revision 2508) +++ trunk/src/thermal.c (revision 2509) @@ -362,9 +362,9 @@ if (style == 3) return NULL; /* solid connection no clearance */ pcb = p; - if (TEST_FLAG(SQUAREFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) return square_therm(pin, style); - if (TEST_FLAG(OCTAGONFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) return oct_therm(pin, style); /* must be circular */ switch (style) { Index: trunk/src/thermal.h =================================================================== --- trunk/src/thermal.h (revision 2508) +++ trunk/src/thermal.h (revision 2509) @@ -27,7 +27,7 @@ /* prototypes for thermal routines * * Thermals are normal lines on the layout. The only thing unique - * about them is that they have the USETHERMALFLAG set so that they + * about them is that they have the PCB_FLAG_USETHERMAL set so that they * can be identified as thermals. It is handy for pcb to automatically * make adjustments to the thermals when the user performs certain * operations, and the functions in thermal.h help implement that. Index: trunk/src/undo.h =================================================================== --- trunk/src/undo.h (revision 2508) +++ trunk/src/undo.h (revision 2509) @@ -31,8 +31,8 @@ #include "global.h" -#define DRAW_FLAGS (RATFLAG | SELECTEDFLAG \ - | HIDENAMEFLAG | HOLEFLAG | OCTAGONFLAG | FOUNDFLAG | CLEARLINEFLAG) +#define DRAW_FLAGS (PCB_FLAG_RAT | PCB_FLAG_SELECTED \ + | PCB_FLAG_HIDENAME | PCB_FLAG_HOLE | PCB_FLAG_OCTAGON | PCB_FLAG_FOUND | PCB_FLAG_CLEARLINE) /* different layers */ Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 2508) +++ trunk/src/undo_act.c (revision 2509) @@ -183,8 +183,8 @@ &ptrtmp, &ptr3, Crosshair.AttachedLine.Point2.X, Crosshair.AttachedLine.Point2.Y, 0); ptr2 = (LineTypePtr) ptrtmp; if (conf_core.editor.auto_drc) { - /* undo loses FOUNDFLAG */ - SET_FLAG(FOUNDFLAG, ptr2); + /* undo loses PCB_FLAG_FOUND */ + SET_FLAG(PCB_FLAG_FOUND, ptr2); DrawLine(CURRENT, ptr2); } Crosshair.AttachedLine.Point1.X = Crosshair.AttachedLine.Point2.X = ptr2->Point2.X; Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 2508) +++ trunk/src_plugins/autoplace/autoplace.c (revision 2509) @@ -149,7 +149,7 @@ ConnectionTypePtr c = &(Nets->Net[i].Connection[j]); switch (c->type) { case PCB_TYPE_PAD: - c->group = TEST_FLAG(ONSOLDERFLAG, (ElementTypePtr) c->ptr1) + c->group = TEST_FLAG(PCB_FLAG_ONSOLDER, (ElementTypePtr) c->ptr1) ? SLayer : CLayer; c->X = ((PadTypePtr) c->ptr2)->Point1.X; c->Y = ((PadTypePtr) c->ptr2)->Point1.Y; @@ -175,7 +175,7 @@ PointerListType list = { 0, 0, NULL }; ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, element)) { ElementTypePtr *epp = (ElementTypePtr *) GetPointerMemory(&list); *epp = element; } @@ -361,7 +361,7 @@ BoxTypePtr lastbox = NULL; Coord thickness; Coord clearance; - if (TEST_FLAG(ONSOLDERFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, element)) { thisside = &solderside; otherside = &componentside; } @@ -466,7 +466,7 @@ ELEMENT_LOOP(PCB->Data); { boxpp = (struct ebox **) - GetPointerMemory(TEST_FLAG(ONSOLDERFLAG, element) ? &seboxes : &ceboxes); + GetPointerMemory(TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? &seboxes : &ceboxes); *boxpp = (struct ebox *) malloc(sizeof(**boxpp)); if (*boxpp == NULL) { fprintf(stderr, "malloc() failed in %s\n", __FUNCTION__); @@ -487,7 +487,7 @@ ELEMENT_LOOP(PCB->Data); { boxp = (struct ebox *) - r_find_neighbor(TEST_FLAG(ONSOLDERFLAG, element) ? rt_s : rt_c, &element->VBox, dir[i]); + r_find_neighbor(TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? rt_s : rt_c, &element->VBox, dir[i]); /* score bounding box alignments */ if (!boxp) continue; @@ -592,8 +592,8 @@ /* don't allow exchanging a solderside-side SMD component * with a non-SMD component. */ if ((pinlist_length(&(pt.element->Pin)) != 0 /* non-SMD */ && - TEST_FLAG(ONSOLDERFLAG, pt.other)) || (pinlist_length(&pt.other->Pin) != 0 /* non-SMD */ && - TEST_FLAG(ONSOLDERFLAG, pt.element))) + TEST_FLAG(PCB_FLAG_ONSOLDER, pt.other)) || (pinlist_length(&pt.other->Pin) != 0 /* non-SMD */ && + TEST_FLAG(PCB_FLAG_ONSOLDER, pt.element))) return createPerturbation(selected, T); break; } @@ -647,7 +647,7 @@ MoveElementLowLevel(PCB->Data, pt->element, x2 - x1, y2 - y1); MoveElementLowLevel(PCB->Data, pt->other, x1 - x2, y1 - y2); /* then flip both elements if they are on opposite sides */ - if (TEST_FLAG(ONSOLDERFLAG, pt->element) != TEST_FLAG(ONSOLDERFLAG, pt->other)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, pt->element) != TEST_FLAG(PCB_FLAG_ONSOLDER, pt->other)) { PerturbationType mypt; mypt.element = pt->element; mypt.which = ROTATE; Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 2508) +++ trunk/src_plugins/autoroute/autoroute.c (revision 2509) @@ -608,7 +608,7 @@ (*rbpp)->flags.fixed = 1; (*rbpp)->came_from = ALL; (*rbpp)->style = style; - (*rbpp)->flags.circular = !TEST_FLAG(SQUAREFLAG, pin); + (*rbpp)->flags.circular = !TEST_FLAG(PCB_FLAG_SQUARE, pin); /* circular lists */ InitLists(*rbpp); /* link together */ @@ -626,7 +626,7 @@ { Coord halfthick; routebox_t **rbpp; - int layergroup = (TEST_FLAG(ONSOLDERFLAG, pad) ? back : front); + int layergroup = (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? back : front); assert(0 <= layergroup && layergroup < max_group); assert(PCB->LayerGroups.Number[layergroup] > 0); rbpp = (routebox_t **) GetPointerMemory(&layergroupboxes[layergroup]); @@ -746,7 +746,7 @@ rb->flags.nonstraight = is_not_rectangle; rb->layer = layer; rb->came_from = ALL; - if (TEST_FLAG(CLEARPOLYFLAG, polygon)) { + if (TEST_FLAG(PCB_FLAG_CLEARPOLY, polygon)) { rb->flags.clear_poly = 1; if (!is_not_rectangle) rb->type = PLANE; @@ -930,7 +930,7 @@ * * this saves on searching the trees to find the nets */ - /* use the DRCFLAG to mark objects as they are entered */ + /* use the PCB_FLAG_DRC to mark objects as they are entered */ ResetConnections(false); Nets = CollectSubnets(false); { @@ -949,7 +949,7 @@ CONNECTION_LOOP(net); { routebox_t *rb = NULL; - SET_FLAG(DRCFLAG, (PinTypePtr) connection->ptr2); + SET_FLAG(PCB_FLAG_DRC, (PinTypePtr) connection->ptr2); if (connection->type == PCB_TYPE_LINE) { LineType *line = (LineType *) connection->ptr2; @@ -1039,8 +1039,8 @@ /* add pins and pads of elements */ ALLPIN_LOOP(PCB->Data); { - if (TEST_FLAG(DRCFLAG, pin)) - CLEAR_FLAG(DRCFLAG, pin); + if (TEST_FLAG(PCB_FLAG_DRC, pin)) + CLEAR_FLAG(PCB_FLAG_DRC, pin); else AddPin(layergroupboxes, pin, false, rd->styles[rd->max_styles]); } @@ -1047,8 +1047,8 @@ ENDALL_LOOP; ALLPAD_LOOP(PCB->Data); { - if (TEST_FLAG(DRCFLAG, pad)) - CLEAR_FLAG(DRCFLAG, pad); + if (TEST_FLAG(PCB_FLAG_DRC, pad)) + CLEAR_FLAG(PCB_FLAG_DRC, pad); else AddPad(layergroupboxes, element, pad, rd->styles[rd->max_styles]); } @@ -1056,8 +1056,8 @@ /* add all vias */ VIA_LOOP(PCB->Data); { - if (TEST_FLAG(DRCFLAG, via)) - CLEAR_FLAG(DRCFLAG, via); + if (TEST_FLAG(PCB_FLAG_DRC, via)) + CLEAR_FLAG(PCB_FLAG_DRC, via); else AddPin(layergroupboxes, via, true, rd->styles[rd->max_styles]); } @@ -1068,8 +1068,8 @@ /* add all (non-rat) lines */ LINE_LOOP(LAYER_PTR(i)); { - if (TEST_FLAG(DRCFLAG, line)) { - CLEAR_FLAG(DRCFLAG, line); + if (TEST_FLAG(PCB_FLAG_DRC, line)) { + CLEAR_FLAG(PCB_FLAG_DRC, line); continue; } /* dice up non-straight lines into many tiny obstacles */ @@ -1101,8 +1101,8 @@ /* add all polygons */ POLYGON_LOOP(LAYER_PTR(i)); { - if (TEST_FLAG(DRCFLAG, polygon)) - CLEAR_FLAG(DRCFLAG, polygon); + if (TEST_FLAG(PCB_FLAG_DRC, polygon)) + CLEAR_FLAG(PCB_FLAG_DRC, polygon); else AddPolygon(layergroupboxes, i, polygon, rd->styles[rd->max_styles]); } @@ -4467,7 +4467,7 @@ /* using CreateDrawn instead of CreateNew concatenates sequential lines */ p->parent.line = CreateDrawnLineOnLayer (layer, b.X1, b.Y1, b.X2, b.Y2, - p->style->Thick, p->style->Clearance * 2, MakeFlags(AUTOFLAG | (conf_core.editor.clear_line ? CLEARLINEFLAG : 0))); + p->style->Thick, p->style->Clearance * 2, MakeFlags(PCB_FLAG_AUTO | (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0))); if (p->parent.line) { AddObjectToCreateUndoList(PCB_TYPE_LINE, layer, p->parent.line, p->parent.line); @@ -4486,7 +4486,7 @@ pp->parent.via = CreateNewVia(PCB->Data, b.X1 + radius, b.Y1 + radius, - pp->style->Diameter, 2 * pp->style->Clearance, 0, pp->style->Hole, NULL, MakeFlags(AUTOFLAG)); + pp->style->Diameter, 2 * pp->style->Clearance, 0, pp->style->Hole, NULL, MakeFlags(PCB_FLAG_AUTO)); assert(pp->parent.via); if (pp->parent.via) { AddObjectToCreateUndoList(PCB_TYPE_VIA, pp->parent.via, pp->parent.via, pp->parent.via); @@ -4556,7 +4556,7 @@ } if (ratlist_length(&PCB->Data->Rat) == 0) return (false); - SaveFindFlag(DRCFLAG); + SaveFindFlag(PCB_FLAG_DRC); rd = CreateRouteData(); if (1) { @@ -4565,7 +4565,7 @@ /* count number of rats selected */ RAT_LOOP(PCB->Data); { - if (!selected || TEST_FLAG(SELECTEDFLAG, line)) + if (!selected || TEST_FLAG(PCB_FLAG_SELECTED, line)) i++; } END_LOOP; @@ -4577,7 +4577,7 @@ /* if only one rat selected, do things the quick way. =) */ if (i == 1) { RAT_LOOP(PCB->Data); - if (!selected || TEST_FLAG(SELECTEDFLAG, line)) { + if (!selected || TEST_FLAG(PCB_FLAG_SELECTED, line)) { /* look up the end points of this rat line */ routebox_t *a; routebox_t *b; @@ -4633,7 +4633,7 @@ /* now merge only those subnets connected by a rat line */ RAT_LOOP(PCB->Data); - if (!selected || TEST_FLAG(SELECTEDFLAG, line)) { + if (!selected || TEST_FLAG(PCB_FLAG_SELECTED, line)) { /* look up the end points of this rat line */ routebox_t *a; routebox_t *b; @@ -4642,7 +4642,7 @@ if (!a || !b) { #ifdef DEBUG_STALE_RATS AddObjectToFlagUndoList(PCB_TYPE_RATLINE, line, line, line); - ASSIGN_FLAG(SELECTEDFLAG, true, line); + ASSIGN_FLAG(PCB_FLAG_SELECTED, true, line); DrawRat(line, 0); #endif /* DEBUG_STALE_RATS */ Message("The rats nest is stale! Aborting autoroute...\n"); Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 2508) +++ trunk/src_plugins/djopt/djopt.c (revision 2509) @@ -57,8 +57,8 @@ #define dprintf if(0)pcb_printf -#define selected(x) TEST_FLAG (SELECTEDFLAG, (x)) -#define autorouted(x) TEST_FLAG (AUTOFLAG, (x)) +#define selected(x) TEST_FLAG (PCB_FLAG_SELECTED, (x)) +#define autorouted(x) TEST_FLAG (PCB_FLAG_AUTO, (x)) #define SB (PCB->Bloat+1) @@ -1008,9 +1008,9 @@ if (o == line_orient(c->lines[1], c2) && o != DIAGONAL) { dprintf("straight %#mD to %#mD to %#mD\n", c0->x, c0->y, c->x, c->y, c2->x, c2->y); if (selected(c->lines[0]->line)) - SET_FLAG(SELECTEDFLAG, c->lines[1]->line); + SET_FLAG(PCB_FLAG_SELECTED, c->lines[1]->line); if (selected(c->lines[1]->line)) - SET_FLAG(SELECTEDFLAG, c->lines[0]->line); + SET_FLAG(PCB_FLAG_SELECTED, c->lines[0]->line); move_corner(c, c2->x, c2->y); } } @@ -2434,7 +2434,7 @@ ALLPAD_LOOP(PCB->Data); { - int layerflag = TEST_FLAG(ONSOLDERFLAG, element) ? LT_SOLDER : LT_COMPONENT; + int layerflag = TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? LT_SOLDER : LT_COMPONENT; if (layer_type[l->layer] != layerflag) continue; @@ -2571,7 +2571,7 @@ END_LOOP; PAD_LOOP(element); { - int layern = TEST_FLAG(ONSOLDERFLAG, pad) ? solder_layer : component_layer; + int layern = TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? solder_layer : component_layer; line_s *ls = (line_s *) malloc(sizeof(line_s)); ls->next = lines; lines = ls; @@ -2617,7 +2617,7 @@ continue; /* don't mess with thermals */ - if (TEST_FLAG(USETHERMALFLAG, line)) + if (TEST_FLAG(PCB_FLAG_USETHERMAL, line)) continue; if (line->Point1.X == line->Point2.X && line->Point1.Y == line->Point2.Y) { Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c (revision 2508) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/create.c (revision 2509) @@ -16,16 +16,16 @@ {1, FL_SHOWNUMBER, SHOWNUMBERFLAG}, {1, FL_LOCALREF, LOCALREFFLAG}, {1, FL_CHECKPLANS, CHECKPLANESFLAG}, - {1, FL_SHOWDRC, SHOWDRCFLAG}, + {1, FL_SHOWDRC, SHOWPCB_FLAG_DRC}, {1, FL_RUBBERBAND, RUBBERBANDFLAG}, {1, FL_DESCRIPTION, DESCRIPTIONFLAG}, {1, FL_NAMEONPCB, NAMEONPCBFLAG}, - {1, FL_AUTODRC, AUTODRCFLAG}, + {1, FL_AUTODRC, AUTOPCB_FLAG_DRC}, {1, FL_ALLDIRECTION, ALLDIRECTIONFLAG}, {1, FL_SWAPSTARTDIR, SWAPSTARTDIRFLAG}, {1, FL_UNIQUENAME, UNIQUENAMEFLAG}, {1, FL_CLEARNEW, CLEARNEWFLAG}, - {1, FL_SNAPPIN, SNAPPINFLAG}, + {1, FL_SNAPPIN, SNAPPCB_FLAG_PIN}, {1, FL_SHOWMASK, SHOWMASKFLAG}, {1, FL_THINDRAW, THINDRAWFLAG}, {1, FL_ORTHOMOVE, ORTHOMOVEFLAG}, @@ -33,7 +33,7 @@ {1, FL_THINDRAWPOLY, THINDRAWPOLYFLAG}, {1, FL_LOCKNAMES, LOCKNAMESFLAG}, {1, FL_ONLYNAMES, ONLYNAMESFLAG}, - {1, FL_NEWFULLPOLY, NEWFULLPOLYFLAG}, + {1, FL_NEWFULLPOLY, NEWPCB_FLAG_FULLPOLY}, {1, FL_HIDENAMES, HIDENAMESFLAG}, #endif Index: trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c =================================================================== --- trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c (revision 2508) +++ trunk/src_plugins/gpmi/pcb-gpmi/gpmi_plugin/gpmi_pkg/layout/search.c (revision 2509) @@ -98,7 +98,7 @@ return s->used; } -/* SELECTEDFLAG */ +/* PCB_FLAG_SELECTED */ typedef struct { int flag; @@ -147,12 +147,12 @@ int layout_search_selected(const char *search_ID, multiple layout_object_mask_t obj_types) { - return layout_search_flag(search_ID, obj_types, SELECTEDFLAG); + return layout_search_flag(search_ID, obj_types, PCB_FLAG_SELECTED); } int layout_search_found(const char *search_ID, multiple layout_object_mask_t obj_types) { - return layout_search_flag(search_ID, obj_types, FOUNDFLAG); + return layout_search_flag(search_ID, obj_types, PCB_FLAG_FOUND); } layout_object_t *layout_search_get(const char *search_ID, int n) Index: trunk/src_plugins/hid_gtk/gui-drc-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-drc-window.c (revision 2508) +++ trunk/src_plugins/hid_gtk/gui-drc-window.c (revision 2509) @@ -78,7 +78,7 @@ static void unset_found_flags(int AndDraw) { - int flag = FOUNDFLAG; + int flag = PCB_FLAG_FOUND; int change = 0; VIA_LOOP(PCB->Data); @@ -200,7 +200,7 @@ continue; } AddObjectToFlagUndoList(object_type, ptr1, ptr2, ptr3); - SET_FLAG(FOUNDFLAG, (AnyObjectType *) ptr2); + SET_FLAG(PCB_FLAG_FOUND, (AnyObjectType *) ptr2); switch (violation->object_type_list[i]) { case PCB_TYPE_LINE: case PCB_TYPE_ARC: Index: trunk/src_plugins/hid_gtk/gui-netlist-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 2508) +++ trunk/src_plugins/hid_gtk/gui-netlist-window.c (revision 2509) @@ -206,7 +206,7 @@ return; AddObjectToFlagUndoList(conn.type, conn.ptr1, conn.ptr2, conn.ptr2); - TOGGLE_FLAG(SELECTEDFLAG, (AnyObjectType *) conn.ptr2); + TOGGLE_FLAG(PCB_FLAG_SELECTED, (AnyObjectType *) conn.ptr2); DrawObject(conn.type, conn.ptr1, conn.ptr2); } @@ -538,7 +538,7 @@ VISIBLELINE_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, line) && !TEST_FLAG(LOCKFLAG, line)) + if (TEST_FLAG(PCB_FLAG_FOUND, line) && !TEST_FLAG(PCB_FLAG_LOCK, line)) RemoveObject(PCB_TYPE_LINE, layer, line, line); } ENDALL_LOOP; @@ -545,7 +545,7 @@ VISIBLEARC_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, arc) && !TEST_FLAG(LOCKFLAG, arc)) + if (TEST_FLAG(PCB_FLAG_FOUND, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc)) RemoveObject(PCB_TYPE_ARC, layer, arc, arc); } ENDALL_LOOP; @@ -553,7 +553,7 @@ if (PCB->ViaOn) VIA_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, via) && !TEST_FLAG(LOCKFLAG, via)) + if (TEST_FLAG(PCB_FLAG_FOUND, via) && !TEST_FLAG(PCB_FLAG_LOCK, via)) RemoveObject(PCB_TYPE_VIA, via, via, via); } END_LOOP; Index: trunk/src_plugins/hid_gtk/gui-pinout-preview.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-pinout-preview.c (revision 2508) +++ trunk/src_plugins/hid_gtk/gui-pinout-preview.c (revision 2509) @@ -73,13 +73,13 @@ CopyElementLowLevel(NULL, &pinout->element, element, FALSE, 0, 0); PIN_LOOP(&pinout->element); { - SET_FLAG(DISPLAYNAMEFLAG, pin); + SET_FLAG(PCB_FLAG_DISPLAYNAME, pin); } END_LOOP; PAD_LOOP(&pinout->element); { - SET_FLAG(DISPLAYNAMEFLAG, pad); + SET_FLAG(PCB_FLAG_DISPLAYNAME, pad); } END_LOOP; Index: trunk/src_plugins/hid_lesstif/netlist.c =================================================================== --- trunk/src_plugins/hid_lesstif/netlist.c (revision 2508) +++ trunk/src_plugins/hid_lesstif/netlist.c (revision 2509) @@ -175,7 +175,7 @@ VISIBLELINE_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, line) && !TEST_FLAG(LOCKFLAG, line)) + if (TEST_FLAG(PCB_FLAG_FOUND, line) && !TEST_FLAG(PCB_FLAG_LOCK, line)) RemoveObject(PCB_TYPE_LINE, layer, line, line); } ENDALL_LOOP; @@ -182,7 +182,7 @@ VISIBLEARC_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, arc) && !TEST_FLAG(LOCKFLAG, arc)) + if (TEST_FLAG(PCB_FLAG_FOUND, arc) && !TEST_FLAG(PCB_FLAG_LOCK, arc)) RemoveObject(PCB_TYPE_ARC, layer, arc, arc); } ENDALL_LOOP; @@ -190,7 +190,7 @@ if (PCB->ViaOn) VIA_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, via) && !TEST_FLAG(LOCKFLAG, via)) + if (TEST_FLAG(PCB_FLAG_FOUND, via) && !TEST_FLAG(PCB_FLAG_LOCK, via)) RemoveObject(PCB_TYPE_VIA, via, via, via); } END_LOOP; Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 2508) +++ trunk/src_plugins/io_pcb/file.c (revision 2509) @@ -229,17 +229,17 @@ /* set binary flags from conf hash; these flags used to be checked with TEST_FLAG() but got moved to the conf system */ - conf_update_pcb_flag(&pcb_flags, "plugins/mincut/enable", ENABLEMINCUTFLAG); + conf_update_pcb_flag(&pcb_flags, "plugins/mincut/enable", ENABLEPCB_FLAG_MINCUT); conf_update_pcb_flag(&pcb_flags, "editor/show_number", SHOWNUMBERFLAG); - conf_update_pcb_flag(&pcb_flags, "editor/show_drc", SHOWDRCFLAG); + conf_update_pcb_flag(&pcb_flags, "editor/show_drc", SHOWPCB_FLAG_DRC); conf_update_pcb_flag(&pcb_flags, "editor/rubber_band_mode", RUBBERBANDFLAG); - conf_update_pcb_flag(&pcb_flags, "editor/auto_drc", AUTODRCFLAG); + conf_update_pcb_flag(&pcb_flags, "editor/auto_drc", AUTOPCB_FLAG_DRC); conf_update_pcb_flag(&pcb_flags, "editor/all_direction_lines", ALLDIRECTIONFLAG); conf_update_pcb_flag(&pcb_flags, "editor/swap_start_direction", SWAPSTARTDIRFLAG); conf_update_pcb_flag(&pcb_flags, "editor/unique_names", UNIQUENAMEFLAG); conf_update_pcb_flag(&pcb_flags, "editor/clear_line", CLEARNEWFLAG); - conf_update_pcb_flag(&pcb_flags, "editor/full_poly", NEWFULLPOLYFLAG); - conf_update_pcb_flag(&pcb_flags, "editor/snap_pin", SNAPPINFLAG); + conf_update_pcb_flag(&pcb_flags, "editor/full_poly", NEWPCB_FLAG_FULLPOLY); + conf_update_pcb_flag(&pcb_flags, "editor/snap_pin", SNAPPCB_FLAG_PIN); conf_update_pcb_flag(&pcb_flags, "editor/orthogonal_moves", ORTHOMOVEFLAG); conf_update_pcb_flag(&pcb_flags, "editor/live_routing", LIVEROUTEFLAG); conf_update_pcb_flag(&pcb_flags, "editor/lock_names", LOCKNAMESFLAG); Index: trunk/src_plugins/io_pcb/flags.c =================================================================== --- trunk/src_plugins/io_pcb/flags.c (revision 2508) +++ trunk/src_plugins/io_pcb/flags.c (revision 2509) @@ -34,17 +34,17 @@ {SHOWNUMBERFLAG, N("shownumber"), 1}, {LOCALREFFLAG, N("localref"), 1}, {CHECKPLANESFLAG, N("checkplanes"), 1}, - {SHOWDRCFLAG, N("showdrc"), 1}, + {SHOWPCB_FLAG_DRC, N("showdrc"), 1}, {RUBBERBANDFLAG, N("rubberband"), 1}, {DESCRIPTIONFLAG, N("description"), 1}, {NAMEONPCBFLAG, N("nameonpcb"), 1}, - {AUTODRCFLAG, N("autodrc"), 1}, + {AUTOPCB_FLAG_DRC, N("autodrc"), 1}, {ALLDIRECTIONFLAG, N("alldirection"), 1}, {SWAPSTARTDIRFLAG, N("swapstartdir"), 1}, {UNIQUENAMEFLAG, N("uniquename"), 1}, {CLEARNEWFLAG, N("clearnew"), 1}, - {NEWFULLPOLYFLAG, N("newfullpoly"), 1}, - {SNAPPINFLAG, N("snappin"), 1}, + {NEWPCB_FLAG_FULLPOLY, N("newfullpoly"), 1}, + {SNAPPCB_FLAG_PIN, N("snappin"), 1}, {SHOWMASKFLAG, N("showmask"), 1}, {THINDRAWFLAG, N("thindraw"), 1}, {ORTHOMOVEFLAG, N("orthomove"), 1}, @@ -53,7 +53,7 @@ {LOCKNAMESFLAG, N("locknames"), 1}, {ONLYNAMESFLAG, N("onlynames"), 1}, {HIDENAMESFLAG, N("hidenames"), 1}, - {ENABLEMINCUTFLAG, N("enablemincut"), 1}, + {ENABLEPCB_FLAG_MINCUT, N("enablemincut"), 1}, }; #undef N Index: trunk/src_plugins/io_pcb/flags.h =================================================================== --- trunk/src_plugins/io_pcb/flags.h (revision 2508) +++ trunk/src_plugins/io_pcb/flags.h (revision 2509) @@ -95,16 +95,16 @@ #define SHOWNUMBERFLAG 0x00000001 #define LOCALREFFLAG 0x00000002 #define CHECKPLANESFLAG 0x00000004 -#define SHOWDRCFLAG 0x00000008 +#define SHOWPCB_FLAG_DRC 0x00000008 #define RUBBERBANDFLAG 0x00000010 #define DESCRIPTIONFLAG 0x00000020 #define NAMEONPCBFLAG 0x00000040 -#define AUTODRCFLAG 0x00000080 +#define AUTOPCB_FLAG_DRC 0x00000080 #define ALLDIRECTIONFLAG 0x00000100 #define SWAPSTARTDIRFLAG 0x00000200 #define UNIQUENAMEFLAG 0x00000400 #define CLEARNEWFLAG 0x00000800 -#define SNAPPINFLAG 0x00001000 +#define SNAPPCB_FLAG_PIN 0x00001000 #define SHOWMASKFLAG 0x00002000 #define THINDRAWFLAG 0x00004000 #define ORTHOMOVEFLAG 0x00008000 @@ -112,6 +112,6 @@ #define THINDRAWPOLYFLAG 0x00020000 #define LOCKNAMESFLAG 0x00040000 #define ONLYNAMESFLAG 0x00080000 -#define NEWFULLPOLYFLAG 0x00100000 +#define NEWPCB_FLAG_FULLPOLY 0x00100000 #define HIDENAMESFLAG 0x00200000 -#define ENABLEMINCUTFLAG 0x00400000 +#define ENABLEPCB_FLAG_MINCUT 0x00400000 Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 2508) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 2509) @@ -2496,17 +2496,17 @@ setlocale(LC_ALL, ""); if ((settings_dest != CFR_invalid) && (retval == 0)) { /* overwrite settings from the flags, mark them not-to-save */ - CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEMINCUTFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWDRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTODRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWFULLPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPINFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 2508) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 2509) @@ -378,17 +378,17 @@ setlocale(LC_ALL, ""); if ((settings_dest != CFR_invalid) && (retval == 0)) { /* overwrite settings from the flags, mark them not-to-save */ - CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEMINCUTFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "plugins/mincut/enable", -1, CONF_BOOL_FLAG(ENABLEPCB_FLAG_MINCUT, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/show_number", -1, CONF_BOOL_FLAG(SHOWNUMBERFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWDRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/show_drc", -1, CONF_BOOL_FLAG(SHOWPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/rubber_band_mode", -1, CONF_BOOL_FLAG(RUBBERBANDFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTODRCFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/auto_drc", -1, CONF_BOOL_FLAG(AUTOPCB_FLAG_DRC, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/all_direction_lines", -1, CONF_BOOL_FLAG(ALLDIRECTIONFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/swap_start_direction", -1, CONF_BOOL_FLAG(SWAPSTARTDIRFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/unique_names", -1, CONF_BOOL_FLAG(UNIQUENAMEFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/clear_line", -1, CONF_BOOL_FLAG(CLEARNEWFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWFULLPOLYFLAG, yy_pcb_flags), POL_OVERWRITE); - CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPINFLAG, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/full_poly", -1, CONF_BOOL_FLAG(NEWPCB_FLAG_FULLPOLY, yy_pcb_flags), POL_OVERWRITE); + CONF_SET(settings_dest, "editor/snap_pin", -1, CONF_BOOL_FLAG(SNAPPCB_FLAG_PIN, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/orthogonal_moves", -1, CONF_BOOL_FLAG(ORTHOMOVEFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/live_routing", -1, CONF_BOOL_FLAG(LIVEROUTEFLAG, yy_pcb_flags), POL_OVERWRITE); CONF_SET(settings_dest, "editor/lock_names", -1, CONF_BOOL_FLAG(LOCKNAMESFLAG, yy_pcb_flags), POL_OVERWRITE); Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 2508) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 2509) @@ -2269,7 +2269,7 @@ #line 970 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { /* eliminate old-style rat-lines */ - if ((IV ((yyvsp[-1].measure)) & RATFLAG) == 0) + if ((IV ((yyvsp[-1].measure)) & PCB_FLAG_RAT) == 0) CreateNewLineOnLayer(Layer, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), OU ((yyvsp[-4].measure)), OU ((yyvsp[-3].measure)), OU ((yyvsp[-2].measure)), 200*GROUNDPLANEFRAME, OldFlags(IV ((yyvsp[-1].measure)))); } @@ -2316,10 +2316,10 @@ case 99: #line 1083 "../../src_plugins/io_pcb/parse_y.y" /* yacc.c:1646 */ { - if ((yyvsp[-1].integer) & ONSILKFLAG) + if ((yyvsp[-1].integer) & PCB_FLAG_ONSILK) { LayerTypePtr lay = &yyData->Layer[yyData->LayerN + - (((yyvsp[-1].integer) & ONSOLDERFLAG) ? SOLDER_LAYER : COMPONENT_LAYER)]; + (((yyvsp[-1].integer) & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)]; CreateNewText(lay ,yyFont, OU ((yyvsp[-6].measure)), OU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), OldFlags((yyvsp[-1].integer))); @@ -2338,14 +2338,14 @@ /* FIXME: shouldn't know about .f */ /* I don't think this matters because anything with hi_format * will have the silk on its own layer in the file rather - * than using the ONSILKFLAG and having it in a copper layer. + * than using the PCB_FLAG_ONSILK and having it in a copper layer. * Thus there is no need for anything besides the 'else' * part of this code. */ - if ((yyvsp[-1].flagtype).f & ONSILKFLAG) + if ((yyvsp[-1].flagtype).f & PCB_FLAG_ONSILK) { LayerTypePtr lay = &yyData->Layer[yyData->LayerN + - (((yyvsp[-1].flagtype).f & ONSOLDERFLAG) ? SOLDER_LAYER : COMPONENT_LAYER)]; + (((yyvsp[-1].flagtype).f & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)]; CreateNewText(lay, yyFont, NU ((yyvsp[-6].measure)), NU ((yyvsp[-5].measure)), (yyvsp[-4].number), (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].flagtype)); } Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 2508) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 2509) @@ -969,7 +969,7 @@ : T_LINE '(' measure measure measure measure measure measure ')' { /* eliminate old-style rat-lines */ - if ((IV ($8) & RATFLAG) == 0) + if ((IV ($8) & PCB_FLAG_RAT) == 0) CreateNewLineOnLayer(Layer, OU ($3), OU ($4), OU ($5), OU ($6), OU ($7), 200*GROUNDPLANEFRAME, OldFlags(IV ($8))); } @@ -1081,10 +1081,10 @@ /* x, y, direction, scale, text, flags */ : T_TEXT '(' measure measure number number STRING INTEGER ')' { - if ($8 & ONSILKFLAG) + if ($8 & PCB_FLAG_ONSILK) { LayerTypePtr lay = &yyData->Layer[yyData->LayerN + - (($8 & ONSOLDERFLAG) ? SOLDER_LAYER : COMPONENT_LAYER)]; + (($8 & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)]; CreateNewText(lay ,yyFont, OU ($3), OU ($4), $5, $6, $7, OldFlags($8)); @@ -1102,14 +1102,14 @@ /* FIXME: shouldn't know about .f */ /* I don't think this matters because anything with hi_format * will have the silk on its own layer in the file rather - * than using the ONSILKFLAG and having it in a copper layer. + * than using the PCB_FLAG_ONSILK and having it in a copper layer. * Thus there is no need for anything besides the 'else' * part of this code. */ - if ($8.f & ONSILKFLAG) + if ($8.f & PCB_FLAG_ONSILK) { LayerTypePtr lay = &yyData->Layer[yyData->LayerN + - (($8.f & ONSOLDERFLAG) ? SOLDER_LAYER : COMPONENT_LAYER)]; + (($8.f & PCB_FLAG_ONSOLDER) ? SOLDER_LAYER : COMPONENT_LAYER)]; CreateNewText(lay, yyFont, NU ($3), NU ($4), $5, $6, $7, $8); } Index: trunk/src_plugins/mincut/rats_mincut.c =================================================================== --- trunk/src_plugins/mincut/rats_mincut.c (revision 2508) +++ trunk/src_plugins/mincut/rats_mincut.c (revision 2509) @@ -122,14 +122,14 @@ if (pin != NULL) { debprintf("short on pin!\n"); - SET_FLAG(WARNFLAG, pin); + SET_FLAG(PCB_FLAG_WARN, pin); x = pin->X; y = pin->Y; } else if (pad != NULL) { debprintf("short on pad!\n"); - SET_FLAG(WARNFLAG, pad); - if (TEST_FLAG(EDGE2FLAG, pad)) { + SET_FLAG(PCB_FLAG_WARN, pad); + if (TEST_FLAG(PCB_FLAG_EDGE2, pad)) { x = pad->Point2.X; y = pad->Point2.Y; } @@ -147,11 +147,11 @@ num_short_conns = 0; short_conns_maxid = 0; - /* perform a search using MINCUTFLAG, calling back proc_short_cb() with the connections */ + /* perform a search using PCB_FLAG_MINCUT, calling back proc_short_cb() with the connections */ old_cb = find_callback; find_callback = proc_short_cb; - SaveFindFlag(MINCUTFLAG); - LookupConnection(x, y, false, 1, MINCUTFLAG); + SaveFindFlag(PCB_FLAG_MINCUT); + LookupConnection(x, y, false, 1, PCB_FLAG_MINCUT); debprintf("- alloced for %d\n", (short_conns_maxid + 1)); lut_by_oid = calloc(sizeof(short_conn_t *), (short_conns_maxid + 1)); @@ -308,7 +308,7 @@ s = lut_by_gid[solution[i]]; debprintf("%d %p", solution[i], s); if (s != NULL) { - SET_FLAG(WARNFLAG, s->to); + SET_FLAG(PCB_FLAG_WARN, s->to); debprintf(" -> %d", s->to->ID); } debprintf("\n"); @@ -369,9 +369,9 @@ next = n->next; if (n->pin != NULL) - SET_FLAG(WARNFLAG, n->pin); + SET_FLAG(PCB_FLAG_WARN, n->pin); if (n->pad != NULL) - SET_FLAG(WARNFLAG, n->pad); + SET_FLAG(PCB_FLAG_WARN, n->pad); /* run only if net is not ignored */ Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 2508) +++ trunk/src_plugins/puller/puller.c (revision 2509) @@ -735,7 +735,7 @@ { int inside_p; int t = (pin->Thickness + 1) / 2; - if (TEST_FLAG(SQUAREFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) inside_p = (x >= pin->X - t && x <= pin->X + t && y >= pin->Y - t && y <= pin->Y + t); else inside_p = (Distance(pin->X, pin->Y, x, y) <= t); @@ -802,7 +802,7 @@ pcb_printf("pad %#mD - %#mD t %#mS vs %#mD\n", pad->Point1.X, pad->Point1.Y, pad->Point2.X, pad->Point2.Y, pad->Thickness, x, y); t = (pad->Thickness + 1) / 2; - if (TEST_FLAG(SQUAREFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) { inside_p = (x >= MIN(pad->Point1.X - t, pad->Point2.X - t) && x <= MAX(pad->Point1.X + t, pad->Point2.X + t) && y >= MIN(pad->Point1.Y - t, pad->Point2.Y - t) @@ -848,7 +848,7 @@ int intersect; double p1_d, p2_d; - if (TEST_FLAG(ONSOLDERFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) { if (!current_is_solder) return R_DIR_NOT_FOUND; } @@ -903,7 +903,7 @@ Extra *e = ARC2EXTRA(arc); int hits; - if (TEST_FLAG(ONSOLDERFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) { if (!current_is_solder) return R_DIR_NOT_FOUND; } @@ -1561,7 +1561,7 @@ /* FIXME: we lump octagonal pins in with square; safe, but not optimal. */ - if (TEST_FLAG(SQUAREFLAG, p) || TEST_FLAG(OCTAGONFLAG, p)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, p) || TEST_FLAG(PCB_FLAG_OCTAGON, p)) { gp_point(p->X - t2, p->Y - t2, 0, 0); gp_point(p->X - t2, p->Y + t2, 0, 0); gp_point(p->X + t2, p->Y + t2, 0, 0); @@ -1581,7 +1581,7 @@ if (p == start_pinpad || p == end_pinpad) return R_DIR_NOT_FOUND; - if (TEST_FLAG(ONSOLDERFLAG, p)) { + if (TEST_FLAG(PCB_FLAG_ONSOLDER, p)) { if (!current_is_solder) return R_DIR_NOT_FOUND; } @@ -1592,7 +1592,7 @@ /* FIXME: we lump octagonal pads in with square; safe, but not optimal. I don't think we even support octagonal pads. */ - if (TEST_FLAG(SQUAREFLAG, p) || TEST_FLAG(OCTAGONFLAG, p)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, p) || TEST_FLAG(PCB_FLAG_OCTAGON, p)) { if (p->Point1.X == p->Point2.X) { int y1 = MIN(p->Point1.Y, p->Point2.Y) - t2; int y2 = MAX(p->Point1.Y, p->Point2.Y) + t2; @@ -1944,7 +1944,7 @@ #if 0 if (fa > M_PI / 2 || fa < -M_PI / 2) { - SET_FLAG(FOUNDFLAG, line); + SET_FLAG(PCB_FLAG_FOUND, line); longjmp(abort_buf, 1); } #endif @@ -2274,9 +2274,9 @@ printf("puller! %s\n", argc > 0 ? argv[0] : ""); if (argc > 0 && strcasecmp(argv[0], "selected") == 0) - select_flags = SELECTEDFLAG; + select_flags = PCB_FLAG_SELECTED; if (argc > 0 && strcasecmp(argv[0], "found") == 0) - select_flags = FOUNDFLAG; + select_flags = PCB_FLAG_FOUND; printf("optimizing...\n"); /* This canonicalizes all the lines, and cleans up near-misses. */ Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 2508) +++ trunk/src_plugins/renumber/renumber.c (revision 2509) @@ -143,7 +143,7 @@ lock_cnt = 0; ELEMENT_LOOP(PCB->Data); { - if (TEST_FLAG(LOCKFLAG, element->Name) || TEST_FLAG(LOCKFLAG, element)) { + if (TEST_FLAG(PCB_FLAG_LOCK, element->Name) || TEST_FLAG(PCB_FLAG_LOCK, element)) { /* * add to the list of locked elements which we won't try to * renumber and whose reference designators are now reserved. Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 2508) +++ trunk/src_plugins/report/report.c (revision 2509) @@ -148,13 +148,13 @@ } #endif via = (PinTypePtr) ptr2; - if (TEST_FLAG(HOLEFLAG, via)) + if (TEST_FLAG(PCB_FLAG_HOLE, via)) report = pcb_strdup_printf("%m+VIA ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" "It is a pure hole of diameter %$mS.\n" "Name = \"%s\"." "%s", USER_UNITMASK, via->ID, flags_to_string(via->Flags, PCB_TYPE_VIA), - via->X, via->Y, via->DrillingHole, EMPTY(via->Name), TEST_FLAG(LOCKFLAG, via) ? "It is LOCKED.\n" : ""); + via->X, via->Y, via->DrillingHole, EMPTY(via->Name), TEST_FLAG(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : ""); else report = pcb_strdup_printf("%m+VIA ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" @@ -170,7 +170,7 @@ via->Clearance / 2, (via->Thickness - via->DrillingHole) / 2, via->Mask, - (via->Mask - via->Thickness) / 2, EMPTY(via->Name), TEST_FLAG(LOCKFLAG, via) ? "It is LOCKED.\n" : ""); + (via->Mask - via->Thickness) / 2, EMPTY(via->Name), TEST_FLAG(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_PIN: @@ -192,7 +192,7 @@ break; } END_LOOP; - if (TEST_FLAG(HOLEFLAG, Pin)) + if (TEST_FLAG(PCB_FLAG_HOLE, Pin)) report = pcb_strdup_printf("%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" "It is a mounting hole. Drill width = %$mS.\n" @@ -199,7 +199,7 @@ "It is owned by element %$mS.\n" "%s", USER_UNITMASK, Pin->ID, flags_to_string(Pin->Flags, PCB_TYPE_PIN), Pin->X, Pin->Y, Pin->DrillingHole, - EMPTY(element->Name[1].TextString), TEST_FLAG(LOCKFLAG, Pin) ? "It is LOCKED.\n" : ""); + EMPTY(element->Name[1].TextString), TEST_FLAG(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : ""); else report = pcb_strdup_printf( "%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" @@ -218,7 +218,7 @@ Pin->Mask, (Pin->Mask - Pin->Thickness) / 2, EMPTY(Pin->Name), - EMPTY(element->Name[1].TextString), EMPTY(Pin->Number), TEST_FLAG(LOCKFLAG, Pin) ? "It is LOCKED.\n" : ""); + EMPTY(element->Name[1].TextString), EMPTY(Pin->Number), TEST_FLAG(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_LINE: @@ -244,7 +244,7 @@ line->Point2.X, line->Point2.Y, line->Point2.ID, line->Thickness, line->Clearance / 2, GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), - UNKNOWN(line->Number), TEST_FLAG(LOCKFLAG, line) ? "It is LOCKED.\n" : ""); + UNKNOWN(line->Number), TEST_FLAG(PCB_FLAG_LOCK, line) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_RATLINE: @@ -297,7 +297,7 @@ Arc->BoundingBox.X2, Arc->BoundingBox.Y2, box->X1, box->Y1, box->X2, box->Y2, - GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), TEST_FLAG(LOCKFLAG, Arc) ? "It is LOCKED.\n" : ""); + GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), TEST_FLAG(PCB_FLAG_LOCK, Arc) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_POLYGON: @@ -323,7 +323,7 @@ Polygon->BoundingBox.X2, Polygon->BoundingBox.Y2, Polygon->PointN, Polygon->PointMax - Polygon->PointN, Polygon->HoleIndexN, - GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), TEST_FLAG(LOCKFLAG, Polygon) ? "It is LOCKED.\n" : ""); + GetLayerNumber(PCB->Data, (LayerTypePtr) ptr1), TEST_FLAG(PCB_FLAG_LOCK, Polygon) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_PAD: @@ -370,8 +370,8 @@ EMPTY(Pad->Name), EMPTY(element->Name[1].TextString), EMPTY(Pad->Number), - TEST_FLAG(ONSOLDERFLAG, - Pad) ? "solder (bottom)" : "component", TEST_FLAG(LOCKFLAG, Pad) ? "It is LOCKED.\n" : ""); + TEST_FLAG(PCB_FLAG_ONSOLDER, + Pad) ? "solder (bottom)" : "component", TEST_FLAG(PCB_FLAG_LOCK, Pad) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_ELEMENT: @@ -401,10 +401,10 @@ EMPTY(element->Name[2].TextString), SCALE_TEXT(FONT_CAPHEIGHT, element->Name[1].Scale), element->Name[1].X, element->Name[1].Y, - TEST_FLAG(HIDENAMEFLAG, element) ? ",\n but it's hidden" : "", + TEST_FLAG(PCB_FLAG_HIDENAME, element) ? ",\n but it's hidden" : "", element->MarkX, element->MarkY, - TEST_FLAG(ONSOLDERFLAG, element) ? "solder (bottom)" : "component", - TEST_FLAG(LOCKFLAG, element) ? "It is LOCKED.\n" : ""); + TEST_FLAG(PCB_FLAG_ONSOLDER, element) ? "solder (bottom)" : "component", + TEST_FLAG(PCB_FLAG_LOCK, element) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_TEXT: @@ -441,7 +441,7 @@ text->TextString, text->Direction, text->BoundingBox.X1, text->BoundingBox.Y1, text->BoundingBox.X2, text->BoundingBox.Y2, - (type == PCB_TYPE_TEXT) ? laynum : "It is an element name.", TEST_FLAG(LOCKFLAG, text) ? "It is LOCKED.\n" : ""); + (type == PCB_TYPE_TEXT) ? laynum : "It is an element name.", TEST_FLAG(PCB_FLAG_LOCK, text) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_LINE_POINT: @@ -488,13 +488,13 @@ { PIN_LOOP(element); { - if (TEST_FLAG(FOUNDFLAG, pin)) + if (TEST_FLAG(PCB_FLAG_FOUND, pin)) pcb_append_printf(&list, "%s-%s,%c", NAMEONPCB_NAME(element), pin->Number, ((col++ % (conf_report.plugins.report.columns + 1)) == conf_report.plugins.report.columns) ? '\n' : ' '); } END_LOOP; PAD_LOOP(element); { - if (TEST_FLAG(FOUNDFLAG, pad)) + if (TEST_FLAG(PCB_FLAG_FOUND, pad)) pcb_append_printf(&list, "%s-%s,%c", NAMEONPCB_NAME(element), pad->Number, ((col++ % (conf_report.plugins.report.columns + 1)) == conf_report.plugins.report.columns) ? '\n' : ' '); } END_LOOP; @@ -520,11 +520,11 @@ /* NB: The third argument here, 'false' ensures LookupConnection * does not add its changes to the undo system. */ - LookupConnection(x, y, false, PCB->Grid, FOUNDFLAG); + LookupConnection(x, y, false, PCB->Grid, PCB_FLAG_FOUND); ALLLINE_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, line)) { + if (TEST_FLAG(PCB_FLAG_FOUND, line)) { double l; int dx, dy; dx = line->Point1.X - line->Point2.X; @@ -538,7 +538,7 @@ ALLARC_LOOP(PCB->Data); { - if (TEST_FLAG(FOUNDFLAG, arc)) { + if (TEST_FLAG(PCB_FLAG_FOUND, arc)) { double l; /* FIXME: we assume width==height here */ l = M_PI * 2 * arc->Width * fabs(arc->Delta) / 360.0; @@ -664,7 +664,7 @@ { PIN_LOOP(element); { - if (TEST_FLAG(FOUNDFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_FOUND, pin)) { int ni, nei; char *ename = element->Name[NAMEONPCB_INDEX].TextString; char *pname = pin->Number; @@ -685,7 +685,7 @@ END_LOOP; PAD_LOOP(element); { - if (TEST_FLAG(FOUNDFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_FOUND, pad)) { int ni, nei; char *ename = element->Name[NAMEONPCB_INDEX].TextString; char *pname = pad->Number; Index: trunk/src_plugins/toporouter/toporouter.c =================================================================== --- trunk/src_plugins/toporouter/toporouter.c (revision 2508) +++ trunk/src_plugins/toporouter/toporouter.c (revision 2509) @@ -602,7 +602,7 @@ else { if (box->type == PIN || box->type == VIA) { PinType *pin = (PinType *) box->data; - if (TEST_FLAG(SQUAREFLAG, pin) || TEST_FLAG(OCTAGONFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pin) || TEST_FLAG(PCB_FLAG_OCTAGON, pin)) { return 0.; } /* return ((PinType *)box->data)->Thickness + 1.;*/ @@ -610,7 +610,7 @@ } else if (box->type == PAD) { PadType *pad = (PadType *) box->data; - if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y && !TEST_FLAG(SQUAREFLAG, pad)) { + if (pad->Point1.X == pad->Point2.X && pad->Point1.Y == pad->Point2.Y && !TEST_FLAG(PCB_FLAG_SQUARE, pad)) { return pad->Thickness; } return 0.; @@ -1822,7 +1822,7 @@ { PAD_LOOP(element); { - if ((l - r->layers == back && TEST_FLAG(ONSOLDERFLAG, pad)) || (l - r->layers == front && !TEST_FLAG(ONSOLDERFLAG, pad))) { + if ((l - r->layers == back && TEST_FLAG(PCB_FLAG_ONSOLDER, pad)) || (l - r->layers == front && !TEST_FLAG(PCB_FLAG_ONSOLDER, pad))) { t = (gdouble) pad->Thickness / 2.0f; x[0] = pad->Point1.X; @@ -1831,7 +1831,7 @@ y[1] = pad->Point2.Y; - if (TEST_FLAG(SQUAREFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pad)) { /* Square or oblong pad. Four points and four constraint edges are * used */ @@ -1990,7 +1990,7 @@ x = pin->X; y = pin->Y; - if (TEST_FLAG(SQUAREFLAG, pin)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, pin)) { vlist = rect_with_attachments(pin_rad(pin), x - t, y - t, x - t, y + t, x + t, y + t, x + t, y - t, l - r->layers); bbox = toporouter_bbox_create(l - r->layers, vlist, PIN, pin); @@ -2000,7 +2000,7 @@ bbox->point = GTS_POINT(insert_vertex(r, l, x, y, bbox)); } - else if (TEST_FLAG(OCTAGONFLAG, pin)) { + else if (TEST_FLAG(PCB_FLAG_OCTAGON, pin)) { /* TODO: Handle octagon pins */ fprintf(stderr, "No support for octagon pins yet\n"); } @@ -2023,7 +2023,7 @@ x = via->X; y = via->Y; - if (TEST_FLAG(SQUAREFLAG, via)) { + if (TEST_FLAG(PCB_FLAG_SQUARE, via)) { vlist = rect_with_attachments(pin_rad((PinType *) via), x - t, y - t, x - t, y + t, x + t, y + t, x + t, y - t, l - r->layers); @@ -2034,7 +2034,7 @@ bbox->point = GTS_POINT(insert_vertex(r, l, x, y, bbox)); } - else if (TEST_FLAG(OCTAGONFLAG, via)) { + else if (TEST_FLAG(PCB_FLAG_OCTAGON, via)) { /* TODO: Handle octagon vias */ fprintf(stderr, "No support for octagon vias yet\n"); } @@ -5536,7 +5536,7 @@ gdouble d = 0.; LineTypePtr line; line = CreateDrawnLineOnLayer(LAYER_PTR(layer), x0, y0, x1, y1, - thickness, clearance, MakeFlags(AUTOFLAG | (TEST_FLAG(CLEARNEWFLAG, PCB) ? CLEARLINEFLAG : 0))); + thickness, clearance, MakeFlags(PCB_FLAG_AUTO | (TEST_FLAG(CLEARNEWFLAG, PCB) ? PCB_FLAG_CLEARLINE : 0))); if (line) { AddObjectToCreateUndoList(PCB_TYPE_LINE, LAYER_PTR(layer), line, line); @@ -5585,7 +5585,7 @@ arc = CreateNewArcOnLayer(LAYER_PTR(layer), vx(a->centre), vy(a->centre), a->r, a->r, sa, da, thickness, clearance, - MakeFlags(AUTOFLAG | (TEST_FLAG(CLEARNEWFLAG, PCB) ? CLEARLINEFLAG : 0))); + MakeFlags(PCB_FLAG_AUTO | (TEST_FLAG(CLEARNEWFLAG, PCB) ? PCB_FLAG_CLEARLINE : 0))); if (arc) { AddObjectToCreateUndoList(PCB_TYPE_ARC, LAYER_PTR(layer), arc, arc); @@ -8069,7 +8069,7 @@ void acquire_twonets(toporouter_t * r) { RAT_LOOP(PCB->Data); - if (TEST_FLAG(SELECTEDFLAG, line)) + if (TEST_FLAG(PCB_FLAG_SELECTED, line)) import_route(r, line); END_LOOP; @@ -8151,7 +8151,7 @@ ALLPAD_LOOP(PCB->Data); { - if (TEST_FLAG(SELECTEDFLAG, pad)) { + if (TEST_FLAG(PCB_FLAG_SELECTED, pad)) { PinTypePtr via; LineTypePtr line; Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 2508) +++ trunk/src_plugins/vendordrill/vendor.c (revision 2509) @@ -327,7 +327,7 @@ tot++; if (via->DrillingHole != vendorDrillMap(via->DrillingHole)) { /* only change unlocked vias */ - if (!TEST_FLAG(LOCKFLAG, via)) { + if (!TEST_FLAG(PCB_FLAG_LOCK, via)) { if (ChangeObject2ndSize(PCB_TYPE_VIA, via, NULL, NULL, vendorDrillMap(via->DrillingHole), true, false)) changed++; else { @@ -357,7 +357,7 @@ { tot++; if (pin->DrillingHole != vendorDrillMap(pin->DrillingHole)) { - if (!TEST_FLAG(LOCKFLAG, pin)) { + if (!TEST_FLAG(PCB_FLAG_LOCK, pin)) { if (ChangeObject2ndSize(PCB_TYPE_PIN, element, pin, NULL, vendorDrillMap(pin->DrillingHole), true, false)) changed++; else { @@ -611,7 +611,7 @@ } } - if (noskip && TEST_FLAG(LOCKFLAG, element)) { + if (noskip && TEST_FLAG(PCB_FLAG_LOCK, element)) { Message(_("Vendor mapping skipped because element %s is locked\n"), UNKNOWN(NAMEONPCB_NAME(element))); noskip = 0; }