Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4876) +++ trunk/doc-rnd/hacking/renames (revision 4877) @@ -313,3 +313,15 @@ TOGGLE_FLAG -> PCB_FLAG_TOGGLE ASSIGN_FLAG -> PCB_FLAG_ASSIGN TEST_FLAGS -> PCB_FLAGS_TEST +CHANGE_FLAG -> PCB_FLAG_CHANGE +FLAGS_EQUAL -> PCB_FLAG_EQ +THERMFLAG -> PCB_FLAG_THERM +TEST_THERM -> PCB_FLAG_THERM_TEST +GET_THERM -> PCB_FLAG_THERM_GET +CLEAR_THERM -> PCB_FLAG_THERM_CLEAR +ASSIGN_THERM -> PCB_FLAG_THERM_ASSIGN +GET_SQUARE -> PCB_FLAG_SQUARE_GET +CLEAR_SQUARE -> PCB_FLAG_SQUARE_CLEAR +ASSIGN_SQUARE -> PCB_FLAG_SQUARE_ASSIGN +GET_INTCONN -> PCB_FLAG_INTCONN_GET +TEST_ANY_THERMS -> PCB_FLAG_THERM_TEST_ANY Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4876) +++ trunk/src/action_helper.c (revision 4877) @@ -724,13 +724,13 @@ if (((type = SearchScreen(Note.X, Note.Y, PCB_TYPEMASK_PIN, &ptr1, &ptr2, &ptr3)) != PCB_TYPE_NONE) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, (pcb_pin_t *) ptr3)) { if (gui->shift_is_pressed()) { - int tstyle = GET_THERM(INDEXOFCURRENT, (pcb_pin_t *) ptr3); + int tstyle = PCB_FLAG_THERM_GET(INDEXOFCURRENT, (pcb_pin_t *) ptr3); tstyle++; if (tstyle > 5) tstyle = 1; pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, tstyle); } - else if (GET_THERM(INDEXOFCURRENT, (pcb_pin_t *) ptr3)) + else if (PCB_FLAG_THERM_GET(INDEXOFCURRENT, (pcb_pin_t *) ptr3)) pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, 0); else pcb_chg_obj_thermal(type, ptr1, ptr2, ptr3, PCB->ThermStyle); Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4876) +++ trunk/src/buffer.c (revision 4877) @@ -556,18 +556,18 @@ /* move the thermal flags with the layers */ ALLPIN_LOOP(Buffer->Data); { - t1 = TEST_THERM(snumber, pin); - t2 = TEST_THERM(cnumber, pin); - ASSIGN_THERM(snumber, t2, pin); - ASSIGN_THERM(cnumber, t1, pin); + t1 = PCB_FLAG_THERM_TEST(snumber, pin); + t2 = PCB_FLAG_THERM_TEST(cnumber, pin); + PCB_FLAG_THERM_ASSIGN(snumber, t2, pin); + PCB_FLAG_THERM_ASSIGN(cnumber, t1, pin); } ENDALL_LOOP; VIA_LOOP(Buffer->Data); { - t1 = TEST_THERM(snumber, via); - t2 = TEST_THERM(cnumber, via); - ASSIGN_THERM(snumber, t2, via); - ASSIGN_THERM(cnumber, t1, via); + t1 = PCB_FLAG_THERM_TEST(snumber, via); + t2 = PCB_FLAG_THERM_TEST(cnumber, via); + PCB_FLAG_THERM_ASSIGN(snumber, t2, via); + PCB_FLAG_THERM_ASSIGN(cnumber, t1, via); } END_LOOP; } Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 4876) +++ trunk/src/change_act.c (revision 4877) @@ -840,7 +840,7 @@ type = SearchScreen(x, y, CHANGESQUARE_TYPES, &ptr1, &ptr2, &ptr3); if (ptr3 != NULL) { - int qstyle = GET_SQUARE((pcb_pin_t *) ptr3); + int qstyle = PCB_FLAG_SQUARE_GET((pcb_pin_t *) ptr3); qstyle++; if (qstyle > 17) qstyle = 0; Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 4876) +++ trunk/src/find_geo.c (revision 4877) @@ -629,8 +629,8 @@ pcb_box_t b1, b2; int shape1, shape2; - shape1 = GET_SQUARE(PV1); - shape2 = GET_SQUARE(PV2); + shape1 = PCB_FLAG_SQUARE_GET(PV1); + shape2 = PCB_FLAG_SQUARE_GET(PV2); if ((shape1 > 1) || (shape2 > 1)) { pcb_polyarea_t *pl1, *pl2; @@ -668,7 +668,7 @@ pcb_bool pcb_intersect_line_pin(pcb_pin_t *PV, pcb_line_t *Line) { if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, PV)) { - int shape = GET_SQUARE(PV); + int shape = PCB_FLAG_SQUARE_GET(PV); if (shape <= 1) { /* the original square case */ /* IsLineInRectangle already has Bloat factor */ Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4876) +++ trunk/src/find_lookup.c (revision 4877) @@ -350,7 +350,7 @@ * be on an edge such that it doesn't actually touch. */ if (!PCB_FLAG_TEST(TheFlag, polygon) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, &i->pv) && - (TEST_THERM(i->layer, &i->pv) || !PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon) + (PCB_FLAG_THERM_TEST(i->layer, &i->pv) || !PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, polygon) || !i->pv.Clearance)) { double wide = MAX(0.5 * i->pv.Thickness + Bloat, 0); if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, &i->pv)) { @@ -363,7 +363,7 @@ longjmp(i->env, 1); } else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, &i->pv)) { - pcb_polyarea_t *oct = OctagonPoly(i->pv.X, i->pv.Y, i->pv.Thickness / 2, GET_SQUARE(&i->pv)); + pcb_polyarea_t *oct = OctagonPoly(i->pv.X, i->pv.Y, i->pv.Thickness / 2, PCB_FLAG_SQUARE_GET(&i->pv)); if (isects(oct, polygon, pcb_true) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); @@ -569,12 +569,12 @@ /* Internal connection: if pins in the same element have the same internal connection group number, they are connected */ - ic = GET_INTCONN(orig_pin); + ic = PCB_FLAG_INTCONN_GET(orig_pin); if ((info.pv.Element != NULL) && (ic > 0)) { pcb_element_t *e = info.pv.Element; PIN_LOOP(e); { - if ((orig_pin != pin) && (ic == GET_INTCONN(pin))) { + if ((orig_pin != pin) && (ic == PCB_FLAG_INTCONN_GET(pin))) { if (!PCB_FLAG_TEST(TheFlag, pin)) ADD_PV_TO_LIST(pin, PCB_TYPE_PIN, orig_pin, FCT_INTERNAL); } @@ -666,7 +666,7 @@ /* note that holes in polygons are ok, so they don't generate warnings. */ if (!PCB_FLAG_TEST(TheFlag, pv) && !PCB_FLAG_TEST(PCB_FLAG_HOLE, pv) && - (TEST_THERM(i->layer, pv) || !PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, &i->polygon) || !pv->Clearance)) { + (PCB_FLAG_THERM_TEST(i->layer, pv) || !PCB_FLAG_TEST(PCB_FLAG_CLEARPOLY, &i->polygon) || !pv->Clearance)) { if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pv)) { pcb_coord_t x1, x2, y1, y2; x1 = pv->X - (PIN_SIZE(pv) + 1 + Bloat) / 2; @@ -678,7 +678,7 @@ longjmp(i->env, 1); } else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv)) { - pcb_polyarea_t *oct = OctagonPoly(pv->X, pv->Y, PIN_SIZE(pv) / 2, GET_SQUARE(pv)); + pcb_polyarea_t *oct = OctagonPoly(pv->X, pv->Y, PIN_SIZE(pv) / 2, PCB_FLAG_SQUARE_GET(pv)); if (isects(oct, &i->polygon, pcb_true) && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER)) longjmp(i->env, 1); } @@ -1222,7 +1222,7 @@ /* Internal connection: if pads in the same element have the same internal connection group number, they are connected */ - ic = GET_INTCONN(Pad); + ic = PCB_FLAG_INTCONN_GET(Pad); if ((Pad->Element != NULL) && (ic > 0)) { pcb_element_t *e = Pad->Element; pcb_pad_t *orig_pad = Pad; @@ -1244,7 +1244,7 @@ if (tlayer >= 0) { PAD_LOOP(e); { - if ((orig_pad != pad) && (ic == GET_INTCONN(pad))) { + if ((orig_pad != pad) && (ic == PCB_FLAG_INTCONN_GET(pad))) { int padlayer = PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER; /*fprintf(stderr, "layergroup1: %d {%d %d %d} %d \n", tlayer, PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad), SOLDER_LAYER, COMPONENT_LAYER, padlayer);*/ if ((!PCB_FLAG_TEST(TheFlag, pad)) && (tlayer != padlayer)) { Index: trunk/src/flag.h =================================================================== --- trunk/src/flag.h (revision 4876) +++ trunk/src/flag.h (revision 4877) @@ -119,7 +119,7 @@ PCB_CHGFLG_TOGGLE } pcb_change_flag_t; -#define CHANGE_FLAG(how, F, P) \ +#define PCB_FLAG_CHANGE(how, F, P) \ do { \ switch(how) { \ case PCB_CHGFLG_CLEAR: PCB_FLAG_CLEAR(F, P); break; \ @@ -128,24 +128,24 @@ } \ } while(0) -#define FLAGS_EQUAL(F1,F2) (memcmp (&F1, &F2, sizeof(pcb_flag_t)) == 0) +#define PCB_FLAG_EQ(F1,F2) (memcmp (&F1, &F2, sizeof(pcb_flag_t)) == 0) -#define THERMFLAG(L) (0xf << (4 *((L) % 2))) +#define PCB_FLAG_THERM(L) (0xf << (4 *((L) % 2))) -#define TEST_THERM(L,P) ((P)->Flags.t[(L)/2] & THERMFLAG(L) ? 1 : 0) -#define GET_THERM(L,P) (((P)->Flags.t[(L)/2] >> (4 * ((L) % 2))) & 0xf) -#define CLEAR_THERM(L,P) (P)->Flags.t[(L)/2] &= ~THERMFLAG(L) -#define ASSIGN_THERM(L,V,P) (P)->Flags.t[(L)/2] = ((P)->Flags.t[(L)/2] & ~THERMFLAG(L)) | ((V) << (4 * ((L) % 2))) +#define PCB_FLAG_THERM_TEST(L,P) ((P)->Flags.t[(L)/2] & PCB_FLAG_THERM(L) ? 1 : 0) +#define PCB_FLAG_THERM_GET(L,P) (((P)->Flags.t[(L)/2] >> (4 * ((L) % 2))) & 0xf) +#define PCB_FLAG_THERM_CLEAR(L,P) (P)->Flags.t[(L)/2] &= ~PCB_FLAG_THERM(L) +#define PCB_FLAG_THERM_ASSIGN(L,V,P) (P)->Flags.t[(L)/2] = ((P)->Flags.t[(L)/2] & ~PCB_FLAG_THERM(L)) | ((V) << (4 * ((L) % 2))) -#define GET_SQUARE(P) ((P)->Flags.q) -#define CLEAR_SQUARE(P) (P)->Flags.q = 0 -#define ASSIGN_SQUARE(V,P) (P)->Flags.q = V +#define PCB_FLAG_SQUARE_GET(P) ((P)->Flags.q) +#define PCB_FLAG_SQUARE_CLEAR(P) (P)->Flags.q = 0 +#define PCB_FLAG_SQUARE_ASSIGN(V,P) (P)->Flags.q = V -#define GET_INTCONN(P) ((P)->Flags.int_conn_grp) +#define PCB_FLAG_INTCONN_GET(P) ((P)->Flags.int_conn_grp) extern int pcb_mem_any_set(unsigned char *, int); -#define TEST_ANY_THERMS(P) pcb_mem_any_set((P)->Flags.t, sizeof((P)->Flags.t)) +#define PCB_FLAG_THERM_TEST_ANY(P) pcb_mem_any_set((P)->Flags.t, sizeof((P)->Flags.t)) #endif Index: trunk/src/flag_str.c =================================================================== --- trunk/src/flag_str.c (revision 4876) +++ trunk/src/flag_str.c (revision 4877) @@ -350,7 +350,7 @@ if (flen == 7 && memcmp(fp, "thermal", 7) == 0) { for (i = 0; i < MAX_LAYER && i < num_layers; i++) if (layers[i]) - ASSIGN_THERM(i, layers[i], &rv); + PCB_FLAG_THERM_ASSIGN(i, layers[i], &rv); } else if (flen == 5 && memcmp(fp, "shape", 5) == 0) { rv.Flags.q = atoi(fp + 6); @@ -458,11 +458,11 @@ PCB_FLAG_CLEAR(flagbits[i].mask, &fh); } - if (TEST_ANY_THERMS(&fh)) { + if (PCB_FLAG_THERM_TEST_ANY(&fh)) { len += sizeof("thermal()"); for (i = 0; i < MAX_LAYER; i++) - if (TEST_THERM(i, &fh)) - len += printed_int_length(i, GET_THERM(i, &fh)) + 1; + if (PCB_FLAG_THERM_TEST(i, &fh)) + len += printed_int_length(i, PCB_FLAG_THERM_GET(i, &fh)) + 1; } if (flags.q > 0) { @@ -496,7 +496,7 @@ PCB_FLAG_CLEAR(flagbits[i].mask, &fh); } - if (TEST_ANY_THERMS(&fh)) { + if (PCB_FLAG_THERM_TEST_ANY(&fh)) { if (bp != buf + 1) *bp++ = ','; strcpy(bp, "thermal"); @@ -503,8 +503,8 @@ bp += strlen("thermal"); grow_layer_list(0); for (i = 0; i < MAX_LAYER; i++) - if (TEST_THERM(i, &fh)) - set_layer_list(i, GET_THERM(i, &fh)); + if (PCB_FLAG_THERM_TEST(i, &fh)) + set_layer_list(i, PCB_FLAG_THERM_GET(i, &fh)); strcpy(bp, print_layer_list()); bp += strlen(bp); } Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 4876) +++ trunk/src/hid_draw_helpers.c (revision 4877) @@ -361,7 +361,7 @@ if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pv)) { /* use the original code for now */ - if ((GET_SQUARE(pv) == 0) || (GET_SQUARE(pv) == 1)) { + if ((PCB_FLAG_SQUARE_GET(pv) == 0) || (PCB_FLAG_SQUARE_GET(pv) == 1)) { pcb_coord_t l = pv->X - r; pcb_coord_t b = pv->Y - r; pcb_coord_t r = l + w; @@ -369,7 +369,7 @@ gui->fill_rect(fg_gc, l, b, r, t); } else - draw_square_pin_poly(fg_gc, pv->X, pv->Y, w, pcb_false, GET_SQUARE(pv)); + draw_square_pin_poly(fg_gc, pv->X, pv->Y, w, pcb_false, PCB_FLAG_SQUARE_GET(pv)); } else if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pv)) draw_octagon_poly(fg_gc, pv->X, pv->Y, w, pcb_false); Index: trunk/src/move.c =================================================================== --- trunk/src/move.c (revision 4876) +++ trunk/src/move.c (revision 4877) @@ -173,7 +173,7 @@ int oi = old_index, ni = new_index; if (old_index != -1) - t1 = GET_THERM(old_index, pin); + t1 = PCB_FLAG_THERM_GET(old_index, pin); if (oi == -1) oi = MAX_LAYER - 1; /* inserting a layer */ @@ -182,17 +182,17 @@ if (oi < ni) { for (i = oi; i < ni; i++) - ASSIGN_THERM(i, GET_THERM(i + 1, pin), pin); + PCB_FLAG_THERM_ASSIGN(i, PCB_FLAG_THERM_GET(i + 1, pin), pin); } else { for (i = oi; i > ni; i--) - ASSIGN_THERM(i, GET_THERM(i - 1, pin), pin); + PCB_FLAG_THERM_ASSIGN(i, PCB_FLAG_THERM_GET(i - 1, pin), pin); } if (new_index != -1) - ASSIGN_THERM(new_index, t1, pin); + PCB_FLAG_THERM_ASSIGN(new_index, t1, pin); else - ASSIGN_THERM(ni, 0, pin); + PCB_FLAG_THERM_ASSIGN(ni, 0, pin); } static void move_all_thermals(int old_index, int new_index) Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 4876) +++ trunk/src/obj_pad.c (revision 4877) @@ -309,8 +309,8 @@ else pn = conf_core.editor.show_number ? pad->Number : pad->Name; - if (GET_INTCONN(pad) > 0) - pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, GET_INTCONN(pad)); + if (PCB_FLAG_INTCONN_GET(pad) > 0) + pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, PCB_FLAG_INTCONN_GET(pad)); else strcpy(buff, pn); text.TextString = buff; Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 4876) +++ trunk/src/obj_pinvia.c (revision 4877) @@ -208,7 +208,7 @@ { pcb_coord_t width; - if ((GET_SQUARE(Pin) > 1) && (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pin))) { + if ((PCB_FLAG_SQUARE_GET(Pin) > 1) && (PCB_FLAG_TEST(PCB_FLAG_SQUARE, Pin))) { pcb_polyarea_t *p = PinPoly(Pin, PIN_SIZE(Pin), Pin->Clearance); poly_bbox(p, &Pin->BoundingBox); poly_Free(&p); @@ -263,9 +263,9 @@ RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Via); AddObjectToFlagUndoList(PCB_TYPE_VIA, Via, Via, Via); if (!ctx->chgtherm.style) /* remove the thermals */ - CLEAR_THERM(INDEXOFCURRENT, Via); + PCB_FLAG_THERM_CLEAR(INDEXOFCURRENT, Via); else - ASSIGN_THERM(INDEXOFCURRENT, ctx->chgtherm.style, Via); + PCB_FLAG_THERM_ASSIGN(INDEXOFCURRENT, ctx->chgtherm.style, Via); AddObjectToClearPolyUndoList(PCB_TYPE_VIA, Via, Via, Via, pcb_true); ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Via); DrawVia(Via); @@ -279,9 +279,9 @@ RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin); AddObjectToFlagUndoList(PCB_TYPE_PIN, element, Pin, Pin); if (!ctx->chgtherm.style) /* remove the thermals */ - CLEAR_THERM(INDEXOFCURRENT, Pin); + PCB_FLAG_THERM_CLEAR(INDEXOFCURRENT, Pin); else - ASSIGN_THERM(INDEXOFCURRENT, ctx->chgtherm.style, Pin); + PCB_FLAG_THERM_ASSIGN(INDEXOFCURRENT, ctx->chgtherm.style, Pin); AddObjectToClearPolyUndoList(PCB_TYPE_PIN, element, Pin, Pin, pcb_true); ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, CURRENT, Pin); DrawPin(Pin); @@ -506,7 +506,7 @@ AddObjectToClearPolyUndoList(PCB_TYPE_VIA, NULL, Via, Via, pcb_false); RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, NULL, Via); AddObjectToFlagUndoList(PCB_TYPE_VIA, NULL, Via, Via); - ASSIGN_SQUARE(ctx->chgsize.absolute, Via); + PCB_FLAG_SQUARE_ASSIGN(ctx->chgsize.absolute, Via); if (ctx->chgsize.absolute == 0) PCB_FLAG_CLEAR(PCB_FLAG_SQUARE, Via); else @@ -527,7 +527,7 @@ AddObjectToClearPolyUndoList(PCB_TYPE_PIN, Element, Pin, Pin, pcb_false); RestoreToPolygon(PCB->Data, PCB_TYPE_PIN, Element, Pin); AddObjectToFlagUndoList(PCB_TYPE_PIN, Element, Pin, Pin); - ASSIGN_SQUARE(ctx->chgsize.absolute, Pin); + PCB_FLAG_SQUARE_ASSIGN(ctx->chgsize.absolute, Pin); if (ctx->chgsize.absolute == 0) PCB_FLAG_CLEAR(PCB_FLAG_SQUARE, Pin); else @@ -814,8 +814,8 @@ else pn = EMPTY(conf_core.editor.show_number ? pv->Number : pv->Name); - if (GET_INTCONN(pv) > 0) - pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, GET_INTCONN(pv)); + if (PCB_FLAG_INTCONN_GET(pv) > 0) + pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, PCB_FLAG_INTCONN_GET(pv)); else strcpy(buff, pn); text.TextString = buff; Index: trunk/src/obj_pinvia_therm.c =================================================================== --- trunk/src/obj_pinvia_therm.c (revision 4876) +++ trunk/src/obj_pinvia_therm.c (revision 4877) @@ -315,8 +315,8 @@ pcb_coord_t t = 0.5 * pcb->ThermScale * pin->Clearance; pcb_coord_t w = pin->Thickness + pin->Clearance; - p = OctagonPoly(pin->X, pin->Y, w, GET_SQUARE(pin)); - p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, GET_SQUARE(pin)); + p = OctagonPoly(pin->X, pin->Y, w, PCB_FLAG_SQUARE_GET(pin)); + p2 = OctagonPoly(pin->X, pin->Y, pin->Thickness, PCB_FLAG_SQUARE_GET(pin)); /* make full clearance ring */ poly_Boolean_free(p, p2, &m, PBO_SUB); switch (style) { @@ -357,7 +357,7 @@ { pcb_arc_t a; pcb_polyarea_t *pa, *arc; - pcb_cardinal_t style = GET_THERM(laynum, pin); + pcb_cardinal_t style = PCB_FLAG_THERM_GET(laynum, pin); if (style == 3) return NULL; /* solid connection no clearance */ Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 4876) +++ trunk/src/obj_poly.c (revision 4877) @@ -411,14 +411,14 @@ { struct mptlc *d = (struct mptlc *) cl; pcb_pin_t *pin = (pcb_pin_t *) b; - if (!TEST_THERM(d->snum, pin) || !IsPointInPolygon(pin->X, pin->Y, pin->Thickness + pin->Clearance + 2, d->polygon)) + if (!PCB_FLAG_THERM_TEST(d->snum, pin) || !IsPointInPolygon(pin->X, pin->Y, pin->Thickness + pin->Clearance + 2, d->polygon)) return R_DIR_NOT_FOUND; if (d->type == PCB_TYPE_PIN) AddObjectToFlagUndoList(PCB_TYPE_PIN, pin->Element, pin, pin); else AddObjectToFlagUndoList(PCB_TYPE_VIA, pin, pin, pin); - ASSIGN_THERM(d->dnum, GET_THERM(d->snum, pin), pin); - CLEAR_THERM(d->snum, pin); + PCB_FLAG_THERM_ASSIGN(d->dnum, PCB_FLAG_THERM_GET(d->snum, pin), pin); + PCB_FLAG_THERM_CLEAR(d->snum, pin); return R_DIR_FOUND_CONTINUE; } Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4876) +++ trunk/src/polygon.c (revision 4877) @@ -738,13 +738,13 @@ int size; if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) { - if (GET_SQUARE(pin) <= 1) { + if (PCB_FLAG_SQUARE_GET(pin) <= 1) { size = (thick + 1) / 2; return RoundRect(pin->X - size, pin->X + size, pin->Y - size, pin->Y + size, (clear + 1) / 2); } else { size = (thick + clear + 1) / 2; - return OctagonPoly(pin->X, pin->Y, size + size, GET_SQUARE(pin)); + return OctagonPoly(pin->X, pin->Y, size + size, PCB_FLAG_SQUARE_GET(pin)); } } @@ -751,7 +751,7 @@ else { size = (thick + clear + 1) / 2; if (PCB_FLAG_TEST(PCB_FLAG_OCTAGON, pin)) { - return OctagonPoly(pin->X, pin->Y, size + size, GET_SQUARE(pin)); + return OctagonPoly(pin->X, pin->Y, size + size, PCB_FLAG_SQUARE_GET(pin)); } } return CirclePoly(pin->X, pin->Y, size); @@ -766,7 +766,7 @@ static pcb_polyarea_t *pin_clearance_poly(pcb_cardinal_t layernum, pcb_board_t *pcb, pcb_pin_t * pin) { pcb_polyarea_t *np; - if (TEST_THERM(layernum, pin)) + if (PCB_FLAG_THERM_TEST(layernum, pin)) np = ThermPoly(pcb, pin, layernum); else np = PinPoly(pin, PIN_SIZE(pin), pin->Clearance); @@ -784,7 +784,7 @@ i = GetLayerNumber(d, l); np = pin_clearance_poly(i, d->pcb, pin); - if (TEST_THERM(i, pin)) { + if (PCB_FLAG_THERM_TEST(i, pin)) { if (!np) return 0; } @@ -884,7 +884,7 @@ if (pin->Clearance == 0) return R_DIR_NOT_FOUND; i = GetLayerNumber(info->data, info->layer); - if (TEST_THERM(i, pin)) { + if (PCB_FLAG_THERM_TEST(i, pin)) { np = ThermPoly((pcb_board_t *) (info->data->pcb), pin, i); if (!np) return R_DIR_FOUND_CONTINUE; Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 4876) +++ trunk/src/rotate.h (revision 4877) @@ -58,7 +58,7 @@ int _n_; \ for(_n_ = n_in;_n_>0;_n_--) { \ int _old_, _nw_ = 0; \ - _old_ = GET_SQUARE(p); \ + _old_ = PCB_FLAG_SQUARE_GET(p); \ if ((_old_ > 1) && (_old_ < 17)) { \ _old_--; \ if (_old_ & 1) \ @@ -69,7 +69,7 @@ _nw_ |= 4; \ if (_old_ & 4) \ _nw_ |= 1; \ - GET_SQUARE(p) = _nw_+1; \ + PCB_FLAG_SQUARE_GET(p) = _nw_+1; \ } \ } \ } while(0) Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 4876) +++ trunk/src/select.c (revision 4877) @@ -59,23 +59,23 @@ PIN_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_PIN, element, pin, pin); - CHANGE_FLAG(how, PCB_FLAG_SELECTED, pin); + PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, pin); } END_LOOP; PAD_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_PAD, element, pad, pad); - CHANGE_FLAG(how, PCB_FLAG_SELECTED, pad); + PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, pad); } END_LOOP; ELEMENTTEXT_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text); - CHANGE_FLAG(how, PCB_FLAG_SELECTED, text); + PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, text); } END_LOOP; AddObjectToFlagUndoList(PCB_TYPE_ELEMENT, element, element, element); - CHANGE_FLAG(how, PCB_FLAG_SELECTED, element); + PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, element); if (redraw) { if (PCB->ElementOn && ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, element) != 0) == SWAP_IDENT || PCB->InvisibleObjectsOn)) @@ -94,7 +94,7 @@ ELEMENTTEXT_LOOP(element); { AddObjectToFlagUndoList(PCB_TYPE_ELEMENT_NAME, element, text, text); - CHANGE_FLAG(how, PCB_FLAG_SELECTED, text); + PCB_FLAG_CHANGE(how, PCB_FLAG_SELECTED, text); } END_LOOP; Index: trunk/src/undo.c =================================================================== --- trunk/src/undo.c (revision 4876) +++ trunk/src/undo.c (revision 4877) @@ -531,7 +531,7 @@ f1 = pcb_flag_mask(pin->Flags, ~DRAW_FLAGS); f2 = pcb_flag_mask(Entry->Data.Flags, ~DRAW_FLAGS); - if (!FLAGS_EQUAL(f1, f2)) + if (!PCB_FLAG_EQ(f1, f2)) must_redraw = 1; if (andDraw && must_redraw && (ptr1e != NULL)) Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 4876) +++ trunk/src_plugins/autoroute/autoroute.c (revision 4877) @@ -4522,7 +4522,7 @@ AddObjectToClearPolyUndoList(type, pin->Element ? pin->Element : pin, pin, pin, pcb_false); RestoreToPolygon(PCB->Data, PCB_TYPE_VIA, LAYER_PTR(p->layer), pin); AddObjectToFlagUndoList(type, pin->Element ? pin->Element : pin, pin, pin); - ASSIGN_THERM(p->layer, PCB->ThermStyle, pin); + PCB_FLAG_THERM_ASSIGN(p->layer, PCB->ThermStyle, pin); AddObjectToClearPolyUndoList(type, pin->Element ? pin->Element : pin, pin, pin, pcb_true); ClearFromPolygon(PCB->Data, PCB_TYPE_VIA, LAYER_PTR(p->layer), pin); changed = pcb_true; Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 4876) +++ trunk/src_plugins/djopt/djopt.c (revision 4877) @@ -982,7 +982,7 @@ dprintf("via check: line[0] layer %d at %#mD nl %d\n", c->lines[0]->layer, c->x, c->y, c->n_lines); /* We can't delete vias that connect to power planes, or vias that aren't tented (assume they're test points). */ - if (!TEST_ANY_THERMS(c->via) + if (!PCB_FLAG_THERM_TEST_ANY(c->via) && c->via->Mask == 0) { for (i = 1; i < c->n_lines; i++) { if (selected(c->via)) Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 4876) +++ trunk/src_plugins/io_lihata/read.c (revision 4877) @@ -289,7 +289,7 @@ pcb_message(PCB_MSG_ERROR, "#LHT10 Invalid layer name in thermal: '%s'\n", n->name); return -1; } - ASSIGN_THERM(layer, io_lihata_resolve_thermal_style(n->data.text.value), &fh); + PCB_FLAG_THERM_ASSIGN(layer, io_lihata_resolve_thermal_style(n->data.text.value), &fh); } } *f = fh.Flags; Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 4876) +++ trunk/src_plugins/io_lihata/write.c (revision 4877) @@ -172,8 +172,8 @@ lst = lht_dom_node_alloc(LHT_HASH, "thermal"); for(layer = 0; layer < max_copper_layer; layer++) { - if (TEST_ANY_THERMS(&fh)) { - int t = GET_THERM(layer, &fh); + if (PCB_FLAG_THERM_TEST_ANY(&fh)) { + int t = PCB_FLAG_THERM_GET(layer, &fh); if (t != 0) { const char *name; txt = lht_dom_node_alloc(LHT_TEXT, PCB->Data->Layer[layer].Name); Index: trunk/src_plugins/query/query_act.c =================================================================== --- trunk/src_plugins/query/query_act.c (revision 4876) +++ trunk/src_plugins/query/query_act.c (revision 4877) @@ -82,7 +82,7 @@ else if (current->type == PCB_OBJ_ETEXT) pcb_select_element_name(current->data.element, sel->how, 0); else - CHANGE_FLAG(sel->how, PCB_FLAG_SELECTED, current->data.anyobj); + PCB_FLAG_CHANGE(sel->how, PCB_FLAG_SELECTED, current->data.anyobj); sel->cnt++; } } Index: trunk/tests/strflags/tester.c =================================================================== --- trunk/tests/strflags/tester.c (revision 4876) +++ trunk/tests/strflags/tester.c (revision 4877) @@ -102,13 +102,13 @@ if (otype & PCB_TYPEMASK_PIN) for (i = 0; i < MAX_LAYER; i++) if (random() & 4) - ASSIGN_THERM(i, 3, &fh); + PCB_FLAG_THERM_ASSIGN(i, 3, &fh); str = flags_to_string(fh.Flags, otype); new_flags = string_to_flags(str, 0); count++; - if (FLAGS_EQUAL(fh.Flags, new_flags)) + if (PCB_FLAG_EQ(fh.Flags, new_flags)) continue; dump_flag(&fh.Flags); printf(" "); @@ -141,7 +141,7 @@ new_flags = string_to_pcbflags(str, 0); count++; - if (FLAGS_EQUAL(fh.Flags, new_flags)) + if (PCB_FLAG_EQ(fh.Flags, new_flags)) continue; dump_flag(&fh.Flags);