Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4906) +++ trunk/doc-rnd/hacking/renames (revision 4907) @@ -441,3 +441,10 @@ DeleteLibraryMenuMemory -> pcb_lib_menu_free CreateNewNet -> pcb_lib_net_new CreateNewConnection -> pcb_lib_conn_new +ENTRIES -> PCB_ENTRIES +UNKNOWN -> PCB_UNKNOWN +NSTRCMP -> PCB_NSTRCMP +EMPTY -> PCB_EMPTY +EMPTY_STRING_P -> PCB_EMPTY_STRING_P +XOR -> PCB_XOR +SQUARE -> PCB_SQUARE Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4906) +++ trunk/src/action_helper.c (revision 4907) @@ -630,7 +630,7 @@ wx = Note.X - Crosshair.AttachedBox.Point1.X; wy = Note.Y - Crosshair.AttachedBox.Point1.Y; - if (XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { + if (PCB_XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { Crosshair.AttachedBox.Point2.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * SGNZ(wx); sa = (wx >= 0) ? 0 : 180; #ifdef ARC45 Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 4906) +++ trunk/src/buffer.c (revision 4907) @@ -636,7 +636,7 @@ pcb_layer_t *sourcelayer = &PCB_PASTEBUFFER->Data->Layer[i], *destlayer = LAYER_PTR(i); if (destlayer->On) { - changed = changed || (!LAYER_IS_EMPTY(sourcelayer)); + changed = changed || (!LAYER_IS_PCB_EMPTY(sourcelayer)); LINE_LOOP(sourcelayer); { CopyLine(&ctx, destlayer, line); Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 4906) +++ trunk/src/change.c (revision 4907) @@ -1176,35 +1176,35 @@ } switch (Type) { case PCB_TYPE_LINE: - name = gui->prompt_for(_("Linename:"), EMPTY(((pcb_line_t *) Ptr2)->Number)); + name = gui->prompt_for(_("Linename:"), PCB_EMPTY(((pcb_line_t *) Ptr2)->Number)); break; case PCB_TYPE_VIA: - name = gui->prompt_for(_("Vianame:"), EMPTY(((pcb_pin_t *) Ptr2)->Name)); + name = gui->prompt_for(_("Vianame:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name)); break; case PCB_TYPE_PIN: if (pinnum) - sprintf(msg, _("%s Pin Number:"), EMPTY(((pcb_pin_t *) Ptr2)->Number)); + sprintf(msg, _("%s Pin Number:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Number)); else - sprintf(msg, _("%s Pin Name:"), EMPTY(((pcb_pin_t *) Ptr2)->Number)); - name = gui->prompt_for(msg, EMPTY(((pcb_pin_t *) Ptr2)->Name)); + sprintf(msg, _("%s Pin Name:"), PCB_EMPTY(((pcb_pin_t *) Ptr2)->Number)); + name = gui->prompt_for(msg, PCB_EMPTY(((pcb_pin_t *) Ptr2)->Name)); break; case PCB_TYPE_PAD: if (pinnum) - sprintf(msg, _("%s Pad Number:"), EMPTY(((pcb_pad_t *) Ptr2)->Number)); + sprintf(msg, _("%s Pad Number:"), PCB_EMPTY(((pcb_pad_t *) Ptr2)->Number)); else - sprintf(msg, _("%s Pad Name:"), EMPTY(((pcb_pad_t *) Ptr2)->Number)); - name = gui->prompt_for(msg, EMPTY(((pcb_pad_t *) Ptr2)->Name)); + sprintf(msg, _("%s Pad Name:"), PCB_EMPTY(((pcb_pad_t *) Ptr2)->Number)); + name = gui->prompt_for(msg, PCB_EMPTY(((pcb_pad_t *) Ptr2)->Name)); break; case PCB_TYPE_TEXT: - name = gui->prompt_for(_("Enter text:"), EMPTY(((pcb_text_t *) Ptr2)->TextString)); + name = gui->prompt_for(_("Enter text:"), PCB_EMPTY(((pcb_text_t *) Ptr2)->TextString)); break; case PCB_TYPE_ELEMENT: - name = gui->prompt_for(_("Elementname:"), EMPTY(ELEMENT_NAME(PCB, (pcb_element_t *) Ptr2))); + name = gui->prompt_for(_("Elementname:"), PCB_EMPTY(ELEMENT_NAME(PCB, (pcb_element_t *) Ptr2))); break; } if (name) { Index: trunk/src/change_act.c =================================================================== --- trunk/src/change_act.c (revision 4906) +++ trunk/src/change_act.c (revision 4907) @@ -171,15 +171,15 @@ pcb_bool(*set_object) (int, void *, void *, void *); pcb_bool(*set_selected) (int); - if (NSTRCMP(flag_name, "square") == 0) { + if (PCB_NSTRCMP(flag_name, "square") == 0) { set_object = value ? pcb_set_obj_square : pcb_clr_obj_square; set_selected = value ? pcb_set_selected_square : pcb_clr_selected_square; } - else if (NSTRCMP(flag_name, "octagon") == 0) { + else if (PCB_NSTRCMP(flag_name, "octagon") == 0) { set_object = value ? pcb_set_obj_octagon : pcb_clr_obj_octagon; set_selected = value ? pcb_set_selected_octagon : pcb_clr_selected_octagon; } - else if (NSTRCMP(flag_name, "join") == 0) { + else if (PCB_NSTRCMP(flag_name, "join") == 0) { /* Note: these are backwards, because the flag is "clear" but the command is "join". */ set_object = value ? pcb_clr_obj_join : pcb_set_obj_join; @@ -571,10 +571,10 @@ ELEMENT_LOOP(PCB->Data); { - if (NSTRCMP(refdes, NAMEONPCB_NAME(element)) == 0) { + if (PCB_NSTRCMP(refdes, NAMEONPCB_NAME(element)) == 0) { PIN_LOOP(element); { - if (NSTRCMP(pinnum, pin->Number) == 0) { + if (PCB_NSTRCMP(pinnum, pin->Number) == 0) { AddObjectToChangeNameUndoList(PCB_TYPE_PIN, NULL, NULL, pin, pin->Name); /* * Note: we can't free() pin->Name first because @@ -589,7 +589,7 @@ PAD_LOOP(element); { - if (NSTRCMP(pinnum, pad->Number) == 0) { + if (PCB_NSTRCMP(pinnum, pad->Number) == 0) { AddObjectToChangeNameUndoList(PCB_TYPE_PAD, NULL, NULL, pad, pad->Name); /* * Note: we can't free() pad->Name first because @@ -690,7 +690,7 @@ /* change the layout's name */ case F_Layout: - name = gui->prompt_for(_("Enter the layout name:"), EMPTY(PCB->Name)); + name = gui->prompt_for(_("Enter the layout name:"), PCB_EMPTY(PCB->Name)); /* NB: ChangeLayoutName takes ownership of the passed memory */ if (name && pcb_board_change_name(name)) SetChangedFlag(pcb_true); @@ -698,7 +698,7 @@ /* change the name of the active layer */ case F_Layer: - name = gui->prompt_for(_("Enter the layer name:"), EMPTY(CURRENT->Name)); + name = gui->prompt_for(_("Enter the layer name:"), PCB_EMPTY(CURRENT->Name)); /* NB: ChangeLayerName takes ownership of the passed memory */ if (name && pcb_layer_change_name(CURRENT, name)) SetChangedFlag(pcb_true); Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 4906) +++ trunk/src/conf_act.c (revision 4907) @@ -53,7 +53,7 @@ { const char *cmd = argc > 0 ? argv[0] : 0; - if (NSTRCMP(cmd, "set") == 0) { + if (PCB_NSTRCMP(cmd, "set") == 0) { const char *path, *val; conf_policy_t pol = POL_OVERWRITE; conf_role_t role = CFR_invalid; @@ -96,7 +96,7 @@ } } - else if (NSTRCMP(cmd, "iseq") == 0) { + else if (PCB_NSTRCMP(cmd, "iseq") == 0) { const char *path, *val; int res; gds_t nval; @@ -124,7 +124,7 @@ return res; } - else if (NSTRCMP(cmd, "toggle") == 0) { + else if (PCB_NSTRCMP(cmd, "toggle") == 0) { conf_native_t *n = conf_get_field(argv[1]); const char *new_value; conf_role_t role = CFR_invalid; @@ -165,7 +165,7 @@ conf_update(argv[1]); } - else if (NSTRCMP(cmd, "reset") == 0) { + else if (PCB_NSTRCMP(cmd, "reset") == 0) { conf_role_t role; role = conf_role_parse(argv[1]); if (role == CFR_invalid) { Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 4906) +++ trunk/src/crosshair.c (revision 4907) @@ -144,7 +144,7 @@ return; arc.X = Crosshair.AttachedBox.Point1.X; arc.Y = Crosshair.AttachedBox.Point1.Y; - if (XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { + if (PCB_XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { arc.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * SGNZ(wx); sa = (wx >= 0) ? 0 : 180; #ifdef ARC45 @@ -190,7 +190,7 @@ dx = x2 - x1; dy = y2 - y1; if (dx != 0 || dy != 0) - h = 0.5 * thick / sqrt(SQUARE(dx) + SQUARE(dy)); + h = 0.5 * thick / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); else h = 0.0; ox = dy * h + 0.5 * SGN(dy); Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 4906) +++ trunk/src/data.c (revision 4907) @@ -263,7 +263,7 @@ hasNoObjects = (pinlist_length(&Data->Via) == 0); hasNoObjects &= (elementlist_length(&Data->Element) == 0); for (i = 0; i < max_copper_layer + 2; i++) - hasNoObjects = hasNoObjects && LAYER_IS_EMPTY(&(Data->Layer[i])); + hasNoObjects = hasNoObjects && LAYER_IS_PCB_EMPTY(&(Data->Layer[i])); return (hasNoObjects); } Index: trunk/src/find_debug.c =================================================================== --- trunk/src/find_debug.c (revision 4906) +++ trunk/src/find_debug.c (revision 4907) @@ -33,11 +33,11 @@ static void PrintElementNameList(pcb_element_t *Element, FILE * FP) { fputc('(', FP); - PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(Element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(DESCRIPTION_NAME(Element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(Element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(NAMEONPCB_NAME(Element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(Element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(VALUE_NAME(Element))); fputc(')', FP); fputc('\n', FP); } @@ -89,7 +89,7 @@ if (IsFirst) { ptr = PADLIST_ENTRY(Layer, 0); if (ptr != NULL) - PrintConnectionListEntry((char *) UNKNOWN(ptr->Name), NULL, pcb_true, FP); + PrintConnectionListEntry((char *) PCB_UNKNOWN(ptr->Name), NULL, pcb_true, FP); else printf("Skipping NULL ptr in 1st part of PrintPadConnections\n"); } @@ -100,7 +100,7 @@ for (i = IsFirst ? 1 : 0; i < PadList[Layer].Number; i++) { ptr = PADLIST_ENTRY(Layer, i); if (ptr != NULL) - PrintConnectionListEntry((char *) EMPTY(ptr->Name), (pcb_element_t *) ptr->Element, pcb_false, FP); + PrintConnectionListEntry((char *) PCB_EMPTY(ptr->Name), (pcb_element_t *) ptr->Element, pcb_false, FP); else printf("Skipping NULL ptr in 2nd part of PrintPadConnections\n"); } @@ -121,7 +121,7 @@ if (IsFirst) { /* the starting pin */ pv = PVLIST_ENTRY(0); - PrintConnectionListEntry((char *) EMPTY(pv->Name), NULL, pcb_true, FP); + PrintConnectionListEntry((char *) PCB_EMPTY(pv->Name), NULL, pcb_true, FP); } /* we maybe have to start with i=1 if we are handling the @@ -130,6 +130,6 @@ for (i = IsFirst ? 1 : 0; i < PVList.Number; i++) { /* get the elements name or assume that its a via */ pv = PVLIST_ENTRY(i); - PrintConnectionListEntry((char *) EMPTY(pv->Name), (pcb_element_t *) pv->Element, pcb_false, FP); + PrintConnectionListEntry((char *) PCB_EMPTY(pv->Name), (pcb_element_t *) pv->Element, pcb_false, FP); } } Index: trunk/src/find_drc.c =================================================================== --- trunk/src/find_drc.c (revision 4906) +++ trunk/src/find_drc.c (revision 4907) @@ -656,7 +656,7 @@ BuildObjectList(&object_count, &object_id_list, &object_type_list); title = _("Element %s has %i silk lines which are too thin"); - name = UNKNOWN(NAMEONPCB_NAME(element)); + name = PCB_UNKNOWN(NAMEONPCB_NAME(element)); /* -4 is for the %s and %i place-holders */ /* +11 is the max printed length for a 32 bit integer */ Index: trunk/src/find_print.c =================================================================== --- trunk/src/find_print.c (revision 4906) +++ trunk/src/find_print.c (revision 4907) @@ -64,7 +64,7 @@ /* write name to list and draw selected object */ fputc('\t', FP); - PrintQuotedString(FP, (char *) EMPTY(pin->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Name)); fputc('\n', FP); PCB_FLAG_SET(PCB_FLAG_SELECTED, pin); DrawPin(pin); @@ -105,7 +105,7 @@ /* write name to list and draw selected object */ fputc('\t', FP); - PrintQuotedString(FP, (char *) EMPTY(pad->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Name)); fputc('\n', FP); PCB_FLAG_SET(PCB_FLAG_SELECTED, pad); @@ -166,7 +166,7 @@ { /* pin might have been checked before, add to list if not */ if (PCB_FLAG_TEST(TheFlag, pin)) { - PrintConnectionListEntry((char *) EMPTY(pin->Name), NULL, pcb_true, FP); + PrintConnectionListEntry((char *) PCB_EMPTY(pin->Name), NULL, pcb_true, FP); fputs("\t\t__CHECKED_BEFORE__\n\t}\n", FP); continue; } @@ -189,7 +189,7 @@ pcb_cardinal_t layer; /* pad might have been checked before, add to list if not */ if (PCB_FLAG_TEST(TheFlag, pad)) { - PrintConnectionListEntry((char *) EMPTY(pad->Name), NULL, pcb_true, FP); + PrintConnectionListEntry((char *) PCB_EMPTY(pad->Name), NULL, pcb_true, FP); fputs("\t\t__CHECKED_BEFORE__\n\t}\n", FP); continue; } Index: trunk/src/flag_str.c =================================================================== --- trunk/src/flag_str.c (revision 4906) +++ trunk/src/flag_str.c (revision 4907) @@ -79,7 +79,7 @@ }; #undef N -const int pcb_object_flagbits_len = ENTRIES(pcb_object_flagbits); +const int pcb_object_flagbits_len = PCB_ENTRIES(pcb_object_flagbits); /* @@ -405,7 +405,7 @@ pcb_flag_t pcb_strflg_s2f(const char *flagstring, int (*error) (const char *msg)) { - return pcb_strflg_common_s2f(flagstring, error, pcb_object_flagbits, ENTRIES(pcb_object_flagbits)); + return pcb_strflg_common_s2f(flagstring, error, pcb_object_flagbits, PCB_ENTRIES(pcb_object_flagbits)); } @@ -536,7 +536,7 @@ char *pcb_strflg_f2s(pcb_flag_t flags, int object_type) { - return pcb_strflg_common_f2s(flags, object_type, pcb_object_flagbits, ENTRIES(pcb_object_flagbits)); + return pcb_strflg_common_f2s(flags, object_type, pcb_object_flagbits, PCB_ENTRIES(pcb_object_flagbits)); } @@ -571,10 +571,10 @@ char *pcb_strflg_board_f2s(pcb_flag_t flags) { - return pcb_strflg_common_f2s(flags, PCB_TYPEMASK_ALL, pcb_flagbits, ENTRIES(pcb_flagbits)); + return pcb_strflg_common_f2s(flags, PCB_TYPEMASK_ALL, pcb_flagbits, PCB_ENTRIES(pcb_flagbits)); } pcb_flag_t pcb_strflg_board_s2f(const char *flagstring, int (*error) (const char *msg)) { - return pcb_strflg_common_s2f(flagstring, error, pcb_flagbits, ENTRIES(pcb_flagbits)); + return pcb_strflg_common_s2f(flagstring, error, pcb_flagbits, PCB_ENTRIES(pcb_flagbits)); } Index: trunk/src/funchash.c =================================================================== --- trunk/src/funchash.c (revision 4906) +++ trunk/src/funchash.c (revision 4907) @@ -61,7 +61,7 @@ void pcb_funchash_init(void) { funchash = htpi_alloc(fh_hash, keyeq); - pcb_funchash_set_table(Functions, ENTRIES(Functions), NULL); + pcb_funchash_set_table(Functions, PCB_ENTRIES(Functions), NULL); } void pcb_funchash_uninit(void) Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 4906) +++ trunk/src/hid_draw_helpers.c (revision 4907) @@ -229,7 +229,7 @@ dx = x2 - x1; dy = y2 - y1; - h = t / sqrt(SQUARE(dx) + SQUARE(dy)); + h = t / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); ox = dy * h + 0.5 * SGN(dy); oy = -(dx * h + 0.5 * SGN(dx)); Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 4906) +++ trunk/src/layer.c (revision 4907) @@ -48,7 +48,7 @@ pcb_bool IsLayerEmpty(pcb_layer_t *layer) { - return LAYER_IS_EMPTY(layer); + return LAYER_IS_PCB_EMPTY(layer); } pcb_bool IsLayerNumEmpty(int num) Index: trunk/src/layer.h =================================================================== --- trunk/src/layer.h (revision 4906) +++ trunk/src/layer.h (revision 4907) @@ -145,7 +145,7 @@ pcb_layer_t *layer = (&data->Layer[(n)]); -#define LAYER_IS_EMPTY(layer) LAYER_IS_EMPTY_((layer)) +#define LAYER_IS_PCB_EMPTY(layer) LAYER_IS_EMPTY_((layer)) #define LAYER_IS_EMPTY_(layer) \ ((linelist_length(&layer->Line) == 0) && (arclist_length(&layer->Arc) == 0) && (polylist_length(&layer->Polygon) == 0) && (textlist_length(&layer->Text) == 0)) Index: trunk/src/library.c =================================================================== --- trunk/src/library.c (revision 4906) +++ trunk/src/library.c (revision 4907) @@ -123,7 +123,7 @@ menu = pcb_lib_menu_new(lib, NULL); menu->Name = pcb_strdup(temp); menu->flag = 1; /* net is enabled by default */ - if (style == NULL || NSTRCMP("(unknown)", style) == 0) + if (style == NULL || PCB_NSTRCMP("(unknown)", style) == 0) menu->Style = NULL; else menu->Style = pcb_strdup(style); Index: trunk/src/macro.h =================================================================== --- trunk/src/macro.h (revision 4906) +++ trunk/src/macro.h (revision 4907) @@ -39,13 +39,13 @@ #define SWAP_IDENT conf_core.editor.show_solder_side #endif -#define ENTRIES(x) (sizeof((x))/sizeof((x)[0])) -#define UNKNOWN(a) ((a) && *(a) ? (a) : "(unknown)") -#define NSTRCMP(a, b) ((a) ? ((b) ? strcmp((a),(b)) : 1) : -1) -#define EMPTY(a) ((a) ? (a) : "") -#define EMPTY_STRING_P(a) ((a) ? (a)[0]==0 : 1) -#define XOR(a,b) (((a) && !(b)) || (!(a) && (b))) -#define SQUARE(x) ((float) (x) * (float) (x)) +#define PCB_ENTRIES(x) (sizeof((x))/sizeof((x)[0])) +#define PCB_UNKNOWN(a) ((a) && *(a) ? (a) : "(unknown)") +#define PCB_NSTRCMP(a, b) ((a) ? ((b) ? strcmp((a),(b)) : 1) : -1) +#define PCB_EMPTY(a) ((a) ? (a) : "") +#define PCB_EMPTY_STRING_P(a) ((a) ? (a)[0]==0 : 1) +#define PCB_XOR(a,b) (((a) && !(b)) || (!(a) && (b))) +#define PCB_SQUARE(x) ((float) (x) * (float) (x)) /* --------------------------------------------------------------------------- * returns the object ID Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4906) +++ trunk/src/obj_elem.c (revision 4907) @@ -889,7 +889,7 @@ for (;;) { ELEMENT_LOOP(Data); { - if (NAMEONPCB_NAME(element) && NSTRCMP(NAMEONPCB_NAME(element), Name) == 0) { + if (NAMEONPCB_NAME(element) && PCB_NSTRCMP(NAMEONPCB_NAME(element), Name) == 0) { Name = BumpName(Name); unique = pcb_false; break; @@ -942,12 +942,12 @@ PIN_LOOP(e); { - if (NSTRCMP(pin->Number, "1") == 0) { + if (PCB_NSTRCMP(pin->Number, "1") == 0) { pin1x = pin->X; pin1y = pin->Y; found_pin1 = 1; } - else if (NSTRCMP(pin->Number, "2") == 0) { + else if (PCB_NSTRCMP(pin->Number, "2") == 0) { pin2x = pin->X; pin2y = pin->Y; found_pin2 = 1; @@ -957,12 +957,12 @@ PAD_LOOP(e); { - if (NSTRCMP(pad->Number, "1") == 0) { + if (PCB_NSTRCMP(pad->Number, "1") == 0) { pin1x = (pad->Point1.X + pad->Point2.X) / 2; pin1y = (pad->Point1.Y + pad->Point2.Y) / 2; found_pin1 = 1; } - else if (NSTRCMP(pad->Number, "2") == 0) { + else if (PCB_NSTRCMP(pad->Number, "2") == 0) { pin2x = (pad->Point1.X + pad->Point2.X) / 2; pin2y = (pad->Point1.Y + pad->Point2.Y) / 2; found_pin2 = 1; Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 4906) +++ trunk/src/obj_line_drcenf.c (revision 4907) @@ -500,7 +500,7 @@ /* shift forces the line lookahead path to refract the alternate way */ shift = gui->shift_is_pressed(); - if (XOR(r1 > r2, shift)) { + if (PCB_XOR(r1 > r2, shift)) { if (conf_core.editor.line_refraction != 0) { if (shift) { if (conf_core.editor.line_refraction !=2) Index: trunk/src/obj_pad.c =================================================================== --- trunk/src/obj_pad.c (revision 4906) +++ trunk/src/obj_pad.c (revision 4907) @@ -305,7 +305,7 @@ const char *pn; if (!pad->Name || !pad->Name[0]) - pn = EMPTY(pad->Number); + pn = PCB_EMPTY(pad->Number); else pn = conf_core.editor.show_number ? pad->Number : pad->Name; Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 4906) +++ trunk/src/obj_pinvia.c (revision 4907) @@ -166,18 +166,18 @@ if (stub_vendorIsElementMappable(Element)) { if (pin->DrillingHole < MIN_PINORVIASIZE) { pcb_message(PCB_MSG_DEFAULT, _("%m+Did not map pin #%s (%s) drill hole because %$mS is below the minimum allowed size\n"), - conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole); + conf_core.editor.grid_unit->allow, PCB_UNKNOWN(Number), PCB_UNKNOWN(Name), pin->DrillingHole); pin->DrillingHole = DrillingHole; } else if (pin->DrillingHole > MAX_PINORVIASIZE) { pcb_message(PCB_MSG_DEFAULT, _("%m+Did not map pin #%s (%s) drill hole because %$mS is above the maximum allowed size\n"), - conf_core.editor.grid_unit->allow, UNKNOWN(Number), UNKNOWN(Name), pin->DrillingHole); + conf_core.editor.grid_unit->allow, PCB_UNKNOWN(Number), PCB_UNKNOWN(Name), pin->DrillingHole); pin->DrillingHole = DrillingHole; } else if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) && (pin->DrillingHole > pin->Thickness - MIN_PINORVIACOPPER)) { pcb_message(PCB_MSG_DEFAULT, _("%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); + conf_core.editor.grid_unit->allow, PCB_UNKNOWN(Number), PCB_UNKNOWN(Name), pin->DrillingHole); pin->DrillingHole = DrillingHole; } } @@ -810,9 +810,9 @@ const char *pn; if (!pv->Name || !pv->Name[0]) - pn = EMPTY(pv->Number); + pn = PCB_EMPTY(pv->Number); else - pn = EMPTY(conf_core.editor.show_number ? pv->Number : pv->Name); + pn = PCB_EMPTY(conf_core.editor.show_number ? pv->Number : pv->Name); if (PCB_FLAG_INTCONN_GET(pv) > 0) pcb_snprintf(buff, sizeof(buff), "%s[%d]", pn, PCB_FLAG_INTCONN_GET(pv)); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4906) +++ trunk/src/object_act.c (revision 4907) @@ -507,7 +507,7 @@ if (PCB_FLAG_TEST(PCB_FLAG_FOUND, element)) { PCB_FLAG_CLEAR(PCB_FLAG_FOUND, element); } - else if (!EMPTY_STRING_P(NAMEONPCB_NAME(element))) { + else if (!PCB_EMPTY_STRING_P(NAMEONPCB_NAME(element))) { /* Unnamed elements should remain untouched */ PCB_FLAG_SET(PCB_FLAG_SELECTED, element); } @@ -670,7 +670,7 @@ ELEMENT_LOOP(PCB->Data); { - if (NSTRCMP(refdes, NAMEONPCB_NAME(element)) == 0) { + if (PCB_NSTRCMP(refdes, NAMEONPCB_NAME(element)) == 0) { e = element; break; } Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 4906) +++ trunk/src/plug_io.c (revision 4907) @@ -809,7 +809,7 @@ const char *p; static gds_t command; - if (EMPTY_STRING_P(conf_core.rc.save_command)) + if (PCB_EMPTY_STRING_P(conf_core.rc.save_command)) return WritePCBFile(Filename, thePcb, fmt, pcb_false); /* setup commandline */ Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4906) +++ trunk/src/polygon.c (revision 4907) @@ -579,7 +579,7 @@ if (thick <= 0) return NULL; half = (thick + 1) / 2; - d = sqrt(SQUARE(l->Point1.X - l->Point2.X) + SQUARE(l->Point1.Y - l->Point2.Y)); + d = sqrt(PCB_SQUARE(l->Point1.X - l->Point2.X) + PCB_SQUARE(l->Point1.Y - l->Point2.Y)); if (!PCB_FLAG_TEST(PCB_FLAG_SQUARE, l)) if (d == 0) /* line is a point */ return CirclePoly(l->Point1.X, l->Point1.Y, half); @@ -637,7 +637,7 @@ int halfthick = (pad->Thickness + 1) / 2; int halfclear = (clear + 1) / 2; - d = sqrt(SQUARE(pad->Point1.X - pad->Point2.X) + SQUARE(pad->Point1.Y - pad->Point2.Y)); + d = sqrt(PCB_SQUARE(pad->Point1.X - pad->Point2.X) + PCB_SQUARE(pad->Point1.Y - pad->Point2.Y)); if (d != 0) { double a = halfthick / d; tx = (t->Point1.Y - t->Point2.Y) * a; @@ -935,7 +935,7 @@ if (pad->Clearance == 0) return R_DIR_NOT_FOUND; polygon = info->polygon; - if (XOR(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad), !info->solder)) { + if (PCB_XOR(PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, pad), !info->solder)) { if (SubtractPad(pad, polygon) < 0) longjmp(info->env, 1); return R_DIR_FOUND_CONTINUE; @@ -1250,13 +1250,13 @@ u = ((X - ptr1->X) * dx + (Y - ptr1->Y) * dy) / (dx * dx + dy * dy); if (u < 0.0) { /* ptr1 is closest point */ - u = SQUARE(X - ptr1->X) + SQUARE(Y - ptr1->Y); + u = PCB_SQUARE(X - ptr1->X) + PCB_SQUARE(Y - ptr1->Y); } else if (u > 1.0) { /* ptr2 is closest point */ - u = SQUARE(X - ptr2->X) + SQUARE(Y - ptr2->Y); + u = PCB_SQUARE(X - ptr2->X) + PCB_SQUARE(Y - ptr2->Y); } else { /* projected intersection is closest point */ - u = SQUARE(X - ptr1->X * (1.0 - u) - u * ptr2->X) + SQUARE(Y - ptr1->Y * (1.0 - u) - u * ptr2->Y); + u = PCB_SQUARE(X - ptr1->X * (1.0 - u) - u * ptr2->X) + PCB_SQUARE(Y - ptr1->Y * (1.0 - u) - u * ptr2->Y); } if (u < mindistance) { mindistance = u; Index: trunk/src/rats.c =================================================================== --- trunk/src/rats.c (revision 4906) +++ trunk/src/rats.c (revision 4907) @@ -116,7 +116,7 @@ return pcb_false; padlist_foreach(&element->Pad, &it, pad) { - if (NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !PCB_FLAG_TEST(PCB_FLAG_DRC, pad))) { + if (PCB_NSTRCMP(PinNum, pad->Number) == 0 && (!Same || !PCB_FLAG_TEST(PCB_FLAG_DRC, pad))) { conn->type = PCB_TYPE_PAD; conn->ptr1 = element; conn->ptr2 = pad; @@ -135,7 +135,7 @@ } padlist_foreach(&element->Pin, &it, pin) { - if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) && pin->Number && NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !PCB_FLAG_TEST(PCB_FLAG_DRC, pin))) { + if (!PCB_FLAG_TEST(PCB_FLAG_HOLE, pin) && pin->Number && PCB_NSTRCMP(PinNum, pin->Number) == 0 && (!Same || !PCB_FLAG_TEST(PCB_FLAG_DRC, pin))) { conn->type = PCB_TYPE_PIN; conn->ptr1 = element; conn->ptr2 = pin; @@ -327,7 +327,7 @@ warn = pcb_true; if (!pin->Spare) { pcb_message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to %s pin %s\n"), - &theNet->Name[2], UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(pin->Number)); + &theNet->Name[2], PCB_UNKNOWN(NAMEONPCB_NAME(element)), PCB_UNKNOWN(pin->Number)); stub_rat_found_short(pin, NULL, &theNet->Name[2]); continue; } @@ -358,7 +358,7 @@ warn = pcb_true; if (!pad->Spare) { pcb_message(PCB_MSG_DEFAULT, _("Warning! Net \"%s\" is shorted to %s pad %s\n"), - &theNet->Name[2], UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(pad->Number)); + &theNet->Name[2], PCB_UNKNOWN(NAMEONPCB_NAME(element)), PCB_UNKNOWN(pad->Number)); stub_rat_found_short(NULL, pad, &theNet->Name[2]); continue; } @@ -588,7 +588,7 @@ theSubnet = next; havepoints = pcb_true; } - else if ((temp = SQUARE(conn1->X - conn2->X) + SQUARE(conn1->Y - conn2->Y)) < distance || !firstpoint) { + else if ((temp = PCB_SQUARE(conn1->X - conn2->X) + PCB_SQUARE(conn1->Y - conn2->Y)) < distance || !firstpoint) { distance = temp; firstpoint = conn1; secondpoint = conn2; @@ -919,9 +919,9 @@ default: return (NULL); } - strcpy(name, UNKNOWN(NAMEONPCB_NAME((pcb_element_t *) ptr1))); + strcpy(name, PCB_UNKNOWN(NAMEONPCB_NAME((pcb_element_t *) ptr1))); strcat(name, "-"); - strcat(name, UNKNOWN(num)); + strcat(name, PCB_UNKNOWN(num)); return (name); } Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 4906) +++ trunk/src/rats_act.c (revision 4907) @@ -89,13 +89,13 @@ SetChangedFlag(pcb_true); break; case F_Close: - small = SQUARE(MAX_COORD); + small = PCB_SQUARE(MAX_COORD); shorty = NULL; RAT_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) continue; - len = SQUARE(line->Point1.X - line->Point2.X) + SQUARE(line->Point1.Y - line->Point2.Y); + len = PCB_SQUARE(line->Point1.X - line->Point2.X) + PCB_SQUARE(line->Point1.Y - line->Point2.Y); if (len < small) { small = len; shorty = line; Index: trunk/src/rtree.c =================================================================== --- trunk/src/rtree.c (revision 4906) +++ trunk/src/rtree.c (revision 4907) @@ -614,8 +614,8 @@ for (i = 0; i < M_SIZE + 1; i++) { float dist1, dist2; - dist1 = SQUARE(a_X - center[i].x) + SQUARE(a_Y - center[i].y); - dist2 = SQUARE(b_X - center[i].x) + SQUARE(b_Y - center[i].y); + dist1 = PCB_SQUARE(a_X - center[i].x) + PCB_SQUARE(a_Y - center[i].y); + dist2 = PCB_SQUARE(b_X - center[i].x) + PCB_SQUARE(b_Y - center[i].y); if (dist1 * (clust_a + M_SIZE / 2) < dist2 * (clust_b + M_SIZE / 2)) { belong[i] = pcb_true; clust_a++; Index: trunk/src/rubberband.c =================================================================== --- trunk/src/rubberband.c (revision 4906) +++ trunk/src/rubberband.c (revision 4907) @@ -139,7 +139,7 @@ if (i->radius < 0) rad = 0; /* require exact match */ else - rad = SQUARE(i->radius + t); + rad = PCB_SQUARE(i->radius + t); x = (i->X - line->Point1.X); x *= x; Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4906) +++ trunk/src/search.c (revision 4907) @@ -465,7 +465,7 @@ info.ptr1 = (void **) Element; info.ptr2 = (void **) Text; info.ptr3 = (void **) Dummy; - info.area = SQUARE(MAX_COORD); + info.area = PCB_SQUARE(MAX_COORD); info.BackToo = (BackToo && PCB->InvisibleObjectsOn); 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)) @@ -510,7 +510,7 @@ info.ptr1 = (void **) Element; info.ptr2 = (void **) Dummy1; info.ptr3 = (void **) Dummy2; - info.area = SQUARE(MAX_COORD); + info.area = PCB_SQUARE(MAX_COORD); info.BackToo = (BackToo && PCB->InvisibleObjectsOn); info.locked = (locked & PCB_TYPE_LOCKED) ? 0 : PCB_FLAG_LOCK; if (r_search(PCB->Data->element_tree, &SearchBox, NULL, element_callback, &info, NULL)) @@ -1309,7 +1309,7 @@ ELEMENT_LOOP(Base); { - if (element->Name[1].TextString && NSTRCMP(element->Name[1].TextString, Name) == 0) { + if (element->Name[1].TextString && PCB_NSTRCMP(element->Name[1].TextString, Name) == 0) { result = element; return (result); } Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 4906) +++ trunk/src_plugins/autoplace/autoplace.c (revision 4907) @@ -496,7 +496,7 @@ continue; factor = 1; if (element->Name[0].TextString && - boxp->element->Name[0].TextString && 0 == NSTRCMP(element->Name[0].TextString, boxp->element->Name[0].TextString)) { + boxp->element->Name[0].TextString && 0 == PCB_NSTRCMP(element->Name[0].TextString, boxp->element->Name[0].TextString)) { delta4 += CostParameter.matching_neighbor_bonus; factor++; } Index: trunk/src_plugins/diag/diag.c =================================================================== --- trunk/src_plugins/diag/diag.c (revision 4906) +++ trunk/src_plugins/diag/diag.c (revision 4907) @@ -47,7 +47,7 @@ { const char *cmd = argc > 0 ? argv[0] : NULL; - if (NSTRCMP(cmd, "native") == 0) { + if (PCB_NSTRCMP(cmd, "native") == 0) { int verbose; const char *prefix = ""; if (argc > 1) @@ -57,7 +57,7 @@ conf_dump(stdout, prefix, verbose, NULL); } - else if (NSTRCMP(cmd, "lihata") == 0) { + else if (PCB_NSTRCMP(cmd, "lihata") == 0) { conf_role_t role; const char *prefix = ""; if (argc <= 1) { Index: trunk/src_plugins/distalign/distalign.c =================================================================== --- trunk/src_plugins/distalign/distalign.c (revision 4906) +++ trunk/src_plugins/distalign/distalign.c (revision 4907) @@ -167,7 +167,7 @@ if (!s) { return K_none; } - for (i = 0; i < ENTRIES(keywords); ++i) { + for (i = 0; i < PCB_ENTRIES(keywords); ++i) { if (keywords[i] && strcasecmp(s, keywords[i]) == 0) return i; } Index: trunk/src_plugins/distaligntext/distaligntext.c =================================================================== --- trunk/src_plugins/distaligntext/distaligntext.c (revision 4906) +++ trunk/src_plugins/distaligntext/distaligntext.c (revision 4907) @@ -89,7 +89,7 @@ if (!s) { return K_none; } - for (i = 0; i < ENTRIES(keywords); ++i) { + for (i = 0; i < PCB_ENTRIES(keywords); ++i) { if (keywords[i] && strcasecmp(s, keywords[i]) == 0) return i; } Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 4906) +++ trunk/src_plugins/djopt/djopt.c (revision 4907) @@ -2601,7 +2601,7 @@ END_LOOP; check(0, 0); - if (NSTRCMP(arg, "splitlines") == 0) { + if (PCB_NSTRCMP(arg, "splitlines") == 0) { if (canonicalize_lines()) IncrementUndoSerialNumber(); return 0; @@ -2648,21 +2648,21 @@ /*dump_all(); */ check(0, 0); - if (NSTRCMP(arg, "debumpify") == 0) + if (PCB_NSTRCMP(arg, "debumpify") == 0) saved += debumpify(); - else if (NSTRCMP(arg, "unjaggy") == 0) + else if (PCB_NSTRCMP(arg, "unjaggy") == 0) saved += unjaggy(); - else if (NSTRCMP(arg, "simple") == 0) + else if (PCB_NSTRCMP(arg, "simple") == 0) saved += simple_optimizations(); - else if (NSTRCMP(arg, "vianudge") == 0) + else if (PCB_NSTRCMP(arg, "vianudge") == 0) saved += vianudge(); - else if (NSTRCMP(arg, "viatrim") == 0) + else if (PCB_NSTRCMP(arg, "viatrim") == 0) saved += viatrim(); - else if (NSTRCMP(arg, "orthopull") == 0) + else if (PCB_NSTRCMP(arg, "orthopull") == 0) saved += orthopull(); - else if (NSTRCMP(arg, "auto") == 0) + else if (PCB_NSTRCMP(arg, "auto") == 0) saved += automagic(); - else if (NSTRCMP(arg, "miter") == 0) + else if (PCB_NSTRCMP(arg, "miter") == 0) saved += miter(); else { printf("unknown command: %s\n", arg); Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 4906) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 4907) @@ -287,7 +287,7 @@ yoff -= TEXT_LINE; text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Author: %s", pcb_author()); yoff -= TEXT_LINE; - text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Title: %s - Fabrication Drawing", UNKNOWN(PCB->Name)); + text_at(gc, PCB_MIL_TO_COORD(2000), yoff, 0, "Title: %s - Fabrication Drawing", PCB_UNKNOWN(PCB->Name)); } static void hid_draw_fab_uninit(void) Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 4906) +++ trunk/src_plugins/export_bboard/bboard.c (revision 4907) @@ -407,7 +407,7 @@ *s2 = 0; offset_in_model = bboard_parse_offset(s2 + 1, &ox, &oy); } - if (!EMPTY_STRING_P(VALUE_NAME(element))) { + if (!PCB_EMPTY_STRING_P(VALUE_NAME(element))) { fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_true); if (!fname) fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_false); @@ -424,7 +424,7 @@ s = pcb_attribute_get(&(element->Attributes), "Footprint::File"); if (s) { - if (!EMPTY_STRING_P(VALUE_NAME(element))) { + if (!PCB_EMPTY_STRING_P(VALUE_NAME(element))) { fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_true); if (!fname) fname = bboard_get_model_filename(s, VALUE_NAME(element), pcb_false); @@ -435,8 +435,8 @@ } if (!fname) { s = DESCRIPTION_NAME(element); - if (!EMPTY_STRING_P(DESCRIPTION_NAME(element))) { - if (!EMPTY_STRING_P(VALUE_NAME(element))) { + if (!PCB_EMPTY_STRING_P(DESCRIPTION_NAME(element))) { + if (!PCB_EMPTY_STRING_P(VALUE_NAME(element))) { fname = bboard_get_model_filename(DESCRIPTION_NAME(element), VALUE_NAME(element), pcb_true); if (!fname) fname = bboard_get_model_filename(DESCRIPTION_NAME(element), VALUE_NAME(element), pcb_false); Index: trunk/src_plugins/export_bom/bom.c =================================================================== --- trunk/src_plugins/export_bom/bom.c (revision 4906) +++ trunk/src_plugins/export_bom/bom.c (revision 4907) @@ -156,7 +156,7 @@ components */ cur = bom; while (cur != NULL) { - if ((NSTRCMP(descr, cur->descr) == 0) && (NSTRCMP(value, cur->value) == 0)) { + if ((PCB_NSTRCMP(descr, cur->descr) == 0) && (PCB_NSTRCMP(value, cur->value) == 0)) { cur->num++; cur->refdes = string_insert(refdes, cur->refdes); break; @@ -240,8 +240,8 @@ ELEMENT_LOOP(PCB->Data); { /* insert this component into the bill of materials list */ - bom = bom_insert((char *) UNKNOWN(NAMEONPCB_NAME(element)), - (char *) UNKNOWN(DESCRIPTION_NAME(element)), (char *) UNKNOWN(VALUE_NAME(element)), bom); + bom = bom_insert((char *) PCB_UNKNOWN(NAMEONPCB_NAME(element)), + (char *) PCB_UNKNOWN(DESCRIPTION_NAME(element)), (char *) PCB_UNKNOWN(VALUE_NAME(element)), bom); } END_LOOP; @@ -257,7 +257,7 @@ fprintf(fp, "# PcbBOM Version 1.0\n"); fprintf(fp, "# Date: %s\n", utcTime); fprintf(fp, "# Author: %s\n", pcb_author()); - fprintf(fp, "# Title: %s - PCB BOM\n", UNKNOWN(PCB->Name)); + fprintf(fp, "# Title: %s - PCB BOM\n", PCB_UNKNOWN(PCB->Name)); fprintf(fp, "# Quantity, Description, Value, RefDes\n"); fprintf(fp, "# --------------------------------------------\n"); Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 4906) +++ trunk/src_plugins/export_dxf/dxf.c (revision 4907) @@ -3824,7 +3824,7 @@ */ cur = dxf; while (cur != NULL) { - if ((NSTRCMP(descr, cur->descr) == 0) && (NSTRCMP(value, cur->value) == 0)) { + if ((PCB_NSTRCMP(descr, cur->descr) == 0) && (PCB_NSTRCMP(value, cur->value) == 0)) { cur->num++; cur->refdes = dxf_string_insert(refdes, cur->refdes); break; @@ -3935,7 +3935,7 @@ strftime(utcTime, sizeof(utcTime), "%c UTC", gmtime(¤ttime)); if (dxf_verbose) { /* report at the beginning of each file */ - fprintf(stderr, "DXF: Board Name: %s, %s \n", UNKNOWN(PCB->Name), UNKNOWN(name)); + fprintf(stderr, "DXF: Board Name: %s, %s \n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(name)); fprintf(stderr, "DXF: Created by: %s.\n", PCB_DXF_HID_VERSION); fprintf(stderr, "DXF: Creation date: %s \n", utcTime); fprintf(stderr, "DXF: File Format according to: AutoCAD R14.\n"); @@ -3963,7 +3963,7 @@ /* * insert the elements into the dxf list. */ - dxf = dxf_insert(UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(DESCRIPTION_NAME(element)), UNKNOWN(VALUE_NAME(element)), dxf); + dxf = dxf_insert(PCB_UNKNOWN(NAMEONPCB_NAME(element)), PCB_UNKNOWN(DESCRIPTION_NAME(element)), PCB_UNKNOWN(VALUE_NAME(element)), dxf); } END_LOOP; /* End of ELEMENT_LOOP */ /* @@ -4023,13 +4023,13 @@ sumx += (double) pin->X; sumy += (double) pin->Y; pin_cnt++; - if (NSTRCMP(pin->Number, "1") == 0) { + if (PCB_NSTRCMP(pin->Number, "1") == 0) { pin1x = (double) pin->X; pin1y = (double) pin->Y; pin1angle = 0.0; found_pin1 = 1; } - else if (NSTRCMP(pin->Number, "2") == 0) { + else if (PCB_NSTRCMP(pin->Number, "2") == 0) { pin2x = (double) pin->X; pin2y = (double) pin->Y; pin2angle = 0.0; @@ -4042,7 +4042,7 @@ sumx += (pad->Point1.X + pad->Point2.X) / 2.0; sumy += (pad->Point1.Y + pad->Point2.Y) / 2.0; pin_cnt++; - if (NSTRCMP(pad->Number, "1") == 0) { + if (PCB_NSTRCMP(pad->Number, "1") == 0) { pin1x = (double) (pad->Point1.X + pad->Point2.X) / 2.0; pin1y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0; /* @@ -4056,7 +4056,7 @@ pin1angle = (180.0 / M_PI) * atan2(pad->Point1.Y - pad->Point2.Y, pad->Point2.X - pad->Point1.X); found_pin1 = 1; } - else if (NSTRCMP(pad->Number, "2") == 0) { + else if (PCB_NSTRCMP(pad->Number, "2") == 0) { pin2x = (double) (pad->Point1.X + pad->Point2.X) / 2.0; pin2y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0; pin2angle = (180.0 / M_PI) * atan2(pad->Point1.Y - pad->Point2.Y, pad->Point2.X - pad->Point1.X); @@ -4091,7 +4091,7 @@ " unable to figure out angle of element\n" " %s because pin #1 is at the centroid of the part\n" " and I could not find pin #2's location.\n" - " Setting to %g degrees.\n", UNKNOWN(NAMEONPCB_NAME(element)), theta); + " Setting to %g degrees.\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), theta); } } else @@ -4104,9 +4104,9 @@ pcb_message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n" " unable to figure out angle because I could\n" " not find pin #1 of element %s.\n" - " Setting to %g degrees.\n", UNKNOWN(NAMEONPCB_NAME(element)), theta); + " Setting to %g degrees.\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), theta); } - dxf_block_name = pcb_strdup(dxf_clean_string(UNKNOWN(DESCRIPTION_NAME(element)))); + dxf_block_name = pcb_strdup(dxf_clean_string(PCB_UNKNOWN(DESCRIPTION_NAME(element)))); if (dxf_metric) { /* convert mils to mm */ dxf_x0 = PCB_COORD_TO_MM(x); @@ -4148,7 +4148,7 @@ pcb_message(PCB_MSG_WARNING, "dxf.c|dxf_export_xref_file ():\n" " unable to figure out angle of dxf block\n" " %s because pcb angle theta is not Cardinal [0.0, 90.0, 180.0, 270.0].\n" - " Setting dxf_rot_angle to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), dxf_rot_angle); + " Setting dxf_rot_angle to %g degrees\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), dxf_rot_angle); } #endif dxf_write_insert(fp, dxf_id_code, dxf_block_name, DXF_DEFAULT_LINETYPE, /* dxf_linetype, */ @@ -4540,7 +4540,7 @@ } if (dxf_verbose) { /* report at the beginning of each file */ - fprintf(stderr, "DXF: Board Name: %s, %s \n", UNKNOWN(PCB->Name), UNKNOWN(name)); + fprintf(stderr, "DXF: Board Name: %s, %s \n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(name)); fprintf(stderr, "DXF: Created by: %s.\n", PCB_DXF_HID_VERSION); fprintf(stderr, "DXF: Creation date: %s \n", utcTime); fprintf(stderr, "DXF: File Format according to: AutoCAD R14.\n"); Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 4906) +++ trunk/src_plugins/export_gcode/gcode.c (revision 4907) @@ -260,7 +260,7 @@ for (n = 0; n < max_copper_layer; n++) { layer = &PCB->Data->Layer[n]; - if (!LAYER_IS_EMPTY(layer)) { + if (!LAYER_IS_PCB_EMPTY(layer)) { /* layer isn't empty */ /* Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 4906) +++ trunk/src_plugins/export_gerber/gerber.c (revision 4907) @@ -552,7 +552,7 @@ pcb_hid_save_and_show_layer_ons(save_ons); for (i = 0; i < max_copper_layer; i++) { pcb_layer_t *layer = PCB->Data->Layer + i; - if (!LAYER_IS_EMPTY(layer)) + if (!LAYER_IS_PCB_EMPTY(layer)) print_group[GetLayerGroupNumberByNumber(i)] = 1; } print_group[GetLayerGroupNumberByNumber(solder_silk_layer)] = 1; @@ -714,7 +714,7 @@ strftime(utcTime, sizeof utcTime, fmt, gmtime(¤ttime)); } /* Print a cute file header at the beginning of each file. */ - fprintf(f, "G04 Title: %s, %s *\r\n", UNKNOWN(PCB->Name), UNKNOWN(name)); + fprintf(f, "G04 Title: %s, %s *\r\n", PCB_UNKNOWN(PCB->Name), PCB_UNKNOWN(name)); fprintf(f, "G04 Creator: pcb-rnd " VERSION " *\r\n"); fprintf(f, "G04 CreationDate: %s *\r\n", utcTime); Index: trunk/src_plugins/export_nelma/nelma.c =================================================================== --- trunk/src_plugins/export_nelma/nelma.c (revision 4906) +++ trunk/src_plugins/export_nelma/nelma.c (revision 4907) @@ -505,7 +505,7 @@ for (n = 0; n < max_copper_layer; n++) { layer = &PCB->Data->Layer[n]; - if (!LAYER_IS_EMPTY(layer)) { + if (!LAYER_IS_PCB_EMPTY(layer)) { /* layer isn't empty */ /* Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 4906) +++ trunk/src_plugins/export_png/png.c (revision 4907) @@ -450,7 +450,7 @@ for (i = 0; i < max_copper_layer; i++) { pcb_layer_t *layer = PCB->Data->Layer + i; - if (!LAYER_IS_EMPTY(layer)) + if (!LAYER_IS_PCB_EMPTY(layer)) print_group[GetLayerGroupNumberByNumber(i)] = 1; } print_group[GetLayerGroupNumberByNumber(solder_silk_layer)] = 1; Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 4906) +++ trunk/src_plugins/export_ps/eps.c (revision 4907) @@ -207,7 +207,7 @@ for (i = 0; i < max_copper_layer; i++) { pcb_layer_t *layer = PCB->Data->Layer + i; if (layer->On) - if (!LAYER_IS_EMPTY(layer)) + if (!LAYER_IS_PCB_EMPTY(layer)) print_group[GetLayerGroupNumberByNumber(i)] = 1; } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 4906) +++ trunk/src_plugins/export_ps/ps.c (revision 4907) @@ -651,7 +651,7 @@ for (i = 0; i < max_copper_layer; i++) { pcb_layer_t *layer = PCB->Data->Layer + i; - if (!LAYER_IS_EMPTY(layer)) + if (!LAYER_IS_PCB_EMPTY(layer)) global.print_group[GetLayerGroupNumberByNumber(i)] = 1; if (strcmp(layer->Name, "outline") == 0 || strcmp(layer->Name, "route") == 0) { Index: trunk/src_plugins/export_test/export_test.c =================================================================== --- trunk/src_plugins/export_test/export_test.c (revision 4906) +++ trunk/src_plugins/export_test/export_test.c (revision 4907) @@ -130,7 +130,7 @@ fprintf(fp, "# PcbXY Version 1.0\n"); fprintf(fp, "# Date: %s\n", utcTime); fprintf(fp, "# Author: %s\n", pcb_author()); - fprintf(fp, "# Title: %s - PCB X-Y\n", UNKNOWN(PCB->Name)); + fprintf(fp, "# Title: %s - PCB X-Y\n", PCB_UNKNOWN(PCB->Name)); fprintf(fp, "# RefDes, Description, Value, X, Y, rotation, top/bottom\n"); fprintf(fp, "# X,Y in %s. rotation in degrees.\n", xy_unit->in_suffix); fprintf(fp, "# --------------------------------------------\n"); @@ -153,8 +153,8 @@ found_pin2 = 0; /* insert this component into the bill of materials list */ - export_test = export_test_insert((char *) UNKNOWN(NAMEONPCB_NAME(element)), - (char *) UNKNOWN(DESCRIPTION_NAME(element)), (char *) UNKNOWN(VALUE_NAME(element)), export_test); + export_test = export_test_insert((char *) PCB_UNKNOWN(NAMEONPCB_NAME(element)), + (char *) PCB_UNKNOWN(DESCRIPTION_NAME(element)), (char *) PCB_UNKNOWN(VALUE_NAME(element)), export_test); /* @@ -171,13 +171,13 @@ sumy += (double) pin->Y; pin_cnt++; - if (NSTRCMP(pin->Number, "1") == 0) { + if (PCB_NSTRCMP(pin->Number, "1") == 0) { pin1x = (double) pin->X; pin1y = (double) pin->Y; pin1angle = 0.0; /* pins have no notion of angle */ found_pin1 = 1; } - else if (NSTRCMP(pin->Number, "2") == 0) { + else if (PCB_NSTRCMP(pin->Number, "2") == 0) { pin2x = (double) pin->X; pin2y = (double) pin->Y; found_pin2 = 1; @@ -191,7 +191,7 @@ sumy += (pad->Point1.Y + pad->Point2.Y) / 2.0; pin_cnt++; - if (NSTRCMP(pad->Number, "1") == 0) { + if (PCB_NSTRCMP(pad->Number, "1") == 0) { pin1x = (double) (pad->Point1.X + pad->Point2.X) / 2.0; pin1y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0; /* @@ -202,7 +202,7 @@ pin1angle = (180.0 / M_PI) * atan2(pad->Point1.Y - pad->Point2.Y, pad->Point2.X - pad->Point1.X); found_pin1 = 1; } - else if (NSTRCMP(pad->Number, "2") == 0) { + else if (PCB_NSTRCMP(pad->Number, "2") == 0) { pin2x = (double) (pad->Point1.X + pad->Point2.X) / 2.0; pin2y = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0; found_pin2 = 1; @@ -235,7 +235,7 @@ ("Printexport_test(): unable to figure out angle of element\n" " %s because pin #1 is at the centroid of the part.\n" " and I could not find pin #2's location\n" - " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta); + " Setting to %g degrees\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), theta); } } else @@ -247,12 +247,12 @@ theta = 0.0; Message ("Printexport_test(): unable to figure out angle because I could\n" - " not find pin #1 of element %s\n" " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta); + " not find pin #1 of element %s\n" " Setting to %g degrees\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), theta); } - name = Cleanexport_testString((char *) UNKNOWN(NAMEONPCB_NAME(element))); - descr = Cleanexport_testString((char *) UNKNOWN(DESCRIPTION_NAME(element))); - value = Cleanexport_testString((char *) UNKNOWN(VALUE_NAME(element))); + name = Cleanexport_testString((char *) PCB_UNKNOWN(NAMEONPCB_NAME(element))); + descr = Cleanexport_testString((char *) PCB_UNKNOWN(DESCRIPTION_NAME(element))); + value = Cleanexport_testString((char *) PCB_UNKNOWN(VALUE_NAME(element))); y = PCB->MaxHeight - y; pcb_fprintf(fp, "%m+%s,\"%s\",\"%s\",%mS,%.2mS,%g,%s\n", @@ -280,7 +280,7 @@ fprintf(fp, "# Pcbexport_test Version 1.0\n"); fprintf(fp, "# Date: %s\n", utcTime); fprintf(fp, "# Author: %s\n", pcb_author()); - fprintf(fp, "# Title: %s - PCB export_test\n", UNKNOWN(PCB->Name)); + fprintf(fp, "# Title: %s - PCB export_test\n", PCB_UNKNOWN(PCB->Name)); fprintf(fp, "# Quantity, Description, Value, RefDes\n"); fprintf(fp, "# --------------------------------------------\n"); Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 4906) +++ trunk/src_plugins/export_xy/xy.c (revision 4907) @@ -175,7 +175,7 @@ fprintf(fp, "# PcbXY Version 1.0\n"); fprintf(fp, "# Date: %s\n", utcTime); fprintf(fp, "# Author: %s\n", pcb_author()); - fprintf(fp, "# Title: %s - PCB X-Y\n", UNKNOWN(PCB->Name)); + fprintf(fp, "# Title: %s - PCB X-Y\n", PCB_UNKNOWN(PCB->Name)); fprintf(fp, "# RefDes, Description, Value, X, Y, rotation, top/bottom\n"); fprintf(fp, "# X,Y in %s. rotation in degrees.\n", xy_unit->in_suffix); fprintf(fp, "# --------------------------------------------\n"); @@ -207,7 +207,7 @@ pin_cnt++; for (rpindex = 0; reference_pin_names[rpindex]; rpindex++) { - if (NSTRCMP(pin->Number, reference_pin_names[rpindex]) == 0) { + if (PCB_NSTRCMP(pin->Number, reference_pin_names[rpindex]) == 0) { pinx[rpindex] = (double) pin->X; piny[rpindex] = (double) pin->Y; pinangle[rpindex] = 0.0; /* pins have no notion of angle */ @@ -224,7 +224,7 @@ pin_cnt++; for (rpindex = 0; reference_pin_names[rpindex]; rpindex++) { - if (NSTRCMP(pad->Number, reference_pin_names[rpindex]) == 0) { + if (PCB_NSTRCMP(pad->Number, reference_pin_names[rpindex]) == 0) { padcentrex = (double) (pad->Point1.X + pad->Point2.X) / 2.0; padcentrey = (double) (pad->Point1.Y + pad->Point2.Y) / 2.0; pinx[rpindex] = padcentrex; @@ -245,7 +245,7 @@ centroidx = sumx / (double) pin_cnt; centroidy = sumy / (double) pin_cnt; - if (NSTRCMP(pcb_attribute_get(&element->Attributes, "xy-centre"), "origin") == 0) { + if (PCB_NSTRCMP(pcb_attribute_get(&element->Attributes, "xy-centre"), "origin") == 0) { x = element->MarkX; y = element->MarkY; } @@ -295,21 +295,21 @@ pcb_message (PCB_MSG_WARNING, "PrintBOM(): unable to figure out angle because I could\n" " not find a suitable reference pin of element %s\n" - " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta); + " Setting to %g degrees\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), theta); } else if (!found_any_not_at_centroid) { pcb_message (PCB_MSG_WARNING, "PrintBOM(): unable to figure out angle of element\n" " %s because the reference pin(s) are at the centroid of the part.\n" - " Setting to %g degrees\n", UNKNOWN(NAMEONPCB_NAME(element)), theta); + " Setting to %g degrees\n", PCB_UNKNOWN(NAMEONPCB_NAME(element)), theta); } } } - name = CleanBOMString((char *) UNKNOWN(NAMEONPCB_NAME(element))); - descr = CleanBOMString((char *) UNKNOWN(DESCRIPTION_NAME(element))); - value = CleanBOMString((char *) UNKNOWN(VALUE_NAME(element))); + name = CleanBOMString((char *) PCB_UNKNOWN(NAMEONPCB_NAME(element))); + descr = CleanBOMString((char *) PCB_UNKNOWN(DESCRIPTION_NAME(element))); + value = CleanBOMString((char *) PCB_UNKNOWN(VALUE_NAME(element))); y = PCB->MaxHeight - y; pcb_fprintf(fp, "%m+%s,\"%s\",\"%s\",%mS,%.2mS,%g,%s\n", Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 4906) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 4907) @@ -175,12 +175,12 @@ l = strlen(subdirentry->d_name); if (!stat(subdirentry->d_name, &buffer) && subdirentry->d_name[0] != '.' - && NSTRCMP(subdirentry->d_name, "CVS") != 0 - && NSTRCMP(subdirentry->d_name, "Makefile") != 0 - && NSTRCMP(subdirentry->d_name, "Makefile.am") != 0 - && NSTRCMP(subdirentry->d_name, "Makefile.in") != 0 && (l < 4 || NSTRCMP(subdirentry->d_name + (l - 4), ".png") != 0) - && (l < 5 || NSTRCMP(subdirentry->d_name + (l - 5), ".html") != 0) - && (l < 4 || NSTRCMP(subdirentry->d_name + (l - 4), ".pcb") != 0)) { + && PCB_NSTRCMP(subdirentry->d_name, "CVS") != 0 + && PCB_NSTRCMP(subdirentry->d_name, "Makefile") != 0 + && PCB_NSTRCMP(subdirentry->d_name, "Makefile.am") != 0 + && PCB_NSTRCMP(subdirentry->d_name, "Makefile.in") != 0 && (l < 4 || PCB_NSTRCMP(subdirentry->d_name + (l - 4), ".png") != 0) + && (l < 5 || PCB_NSTRCMP(subdirentry->d_name + (l - 5), ".html") != 0) + && (l < 4 || PCB_NSTRCMP(subdirentry->d_name + (l - 4), ".pcb") != 0)) { #ifdef DEBUG /* printf("... Found a footprint %s ... \n", subdirentry->d_name); */ Index: trunk/src_plugins/hid_gtk/gui-config.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-config.c (revision 4906) +++ trunk/src_plugins/hid_gtk/gui-config.c (revision 4907) @@ -1429,7 +1429,7 @@ else if (layer == solder_silk_layer) name = _("solder side"); else - name = (gchar *) UNKNOWN(PCB->Data->Layer[layer].Name); + name = (gchar *) PCB_UNKNOWN(PCB->Data->Layer[layer].Name); if (layer >= max_copper_layer) { label = gtk_label_new(name); Index: trunk/src_plugins/hid_gtk/gui-output-events.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-output-events.c (revision 4906) +++ trunk/src_plugins/hid_gtk/gui-output-events.c (revision 4907) @@ -312,7 +312,7 @@ return NULL; if (type == PCB_TYPE_PIN || type == PCB_TYPE_PAD) - elename = (char *) UNKNOWN(NAMEONPCB_NAME((pcb_element_t *) ptr1)); + elename = (char *) PCB_UNKNOWN(NAMEONPCB_NAME((pcb_element_t *) ptr1)); pinname = ConnectionName(type, ptr1, ptr2); Index: trunk/src_plugins/hid_gtk/gui-pinout-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-pinout-window.c (revision 4906) +++ trunk/src_plugins/hid_gtk/gui-pinout-window.c (revision 4907) @@ -55,7 +55,7 @@ if (!element) return; title = g_strdup_printf("%s [%s,%s]", - UNKNOWN(DESCRIPTION_NAME(element)), UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(VALUE_NAME(element))); + PCB_UNKNOWN(DESCRIPTION_NAME(element)), PCB_UNKNOWN(NAMEONPCB_NAME(element)), PCB_UNKNOWN(VALUE_NAME(element))); top_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(top_window), title); Index: trunk/src_plugins/hid_gtk/gui-top-window.c =================================================================== --- trunk/src_plugins/hid_gtk/gui-top-window.c (revision 4906) +++ trunk/src_plugins/hid_gtk/gui-top-window.c (revision 4907) @@ -412,7 +412,7 @@ break; default: /* layers */ *color_string = conf_core.appearance.color.layer[i]; - *text = (char *) UNKNOWN(PCB->Data->Layer[i].Name); + *text = (char *) PCB_UNKNOWN(PCB->Data->Layer[i].Name); *set = PCB->Data->Layer[i].On; break; } Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 4906) +++ trunk/src_plugins/hid_lesstif/main.c (revision 4907) @@ -1024,7 +1024,7 @@ { FILE *f = fopen(filename, "rb"); if (!f) { - if (NSTRCMP(filename, "pcb-background.ppm")) + if (PCB_NSTRCMP(filename, "pcb-background.ppm")) perror(filename); return; } Index: trunk/src_plugins/import_netlist/import_netlist.c =================================================================== --- trunk/src_plugins/import_netlist/import_netlist.c (revision 4906) +++ trunk/src_plugins/import_netlist/import_netlist.c (revision 4907) @@ -64,7 +64,7 @@ pcb_message(PCB_MSG_DEFAULT, _("Importing PCB netlist %s\n"), filename); - if (EMPTY_STRING_P(conf_core.rc.rat_command)) { + if (PCB_EMPTY_STRING_P(conf_core.rc.rat_command)) { fp = fopen(filename, "r"); if (!fp) { pcb_message(PCB_MSG_DEFAULT, "Cannot open %s for reading", filename); Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 4906) +++ trunk/src_plugins/io_kicad/write.c (revision 4907) @@ -577,10 +577,10 @@ pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { /* fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); */ @@ -620,10 +620,10 @@ int copperStartY; /* used for mapping geda copper arcs onto kicad copper lines */ /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { /* fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); */ @@ -692,10 +692,10 @@ pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { /* fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); */ @@ -835,11 +835,11 @@ information fprintf(FP, "\nDS %s ", F2S(element, PCB_TYPE_ELEMENT)); - PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(DESCRIPTION_NAME(element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(NAMEONPCB_NAME(element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(VALUE_NAME(element))); pcb_fprintf(FP, " %mm %mm %mm %mm %d %d %s]\n(\n", element->MarkX, element->MarkY, DESCRIPTION_TEXT(element).X - element->MarkX, @@ -917,7 +917,7 @@ pin->Y - element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pin->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Number)); if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) { fputs(" R ",FP); /* square */ @@ -935,7 +935,7 @@ fputs("Ne 0 \"\"\n",FP); /* library parts have empty net descriptors */ /* - PrintQuotedString(FP, (char *) EMPTY(pin->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Name)); fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN)); */ fputs("$EndPAD\n",FP); @@ -948,7 +948,7 @@ (pad->Point1.Y + pad->Point2.Y)/2- element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pad->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Number)); fputs(" R ",FP); /* rectangular, not a pin */ if ((pad->Point1.X-pad->Point2.X) <= 0 @@ -1161,7 +1161,7 @@ pinlist_foreach(&element->Pin, &it, pin) { fprintf(FP, "%*s", indentation + 2, ""); fputs("(pad ", FP); - PrintQuotedString(FP, (char *) EMPTY(pin->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Number)); if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) { fputs(" thru_hole rect ",FP); /* square */ } else { @@ -1170,7 +1170,7 @@ pcb_fprintf(FP, "(at %.3mm %.3mm)", /* positions of pad */ pin->X - element->MarkX, pin->Y - element->MarkY); - /* PrintQuotedString(FP, (char *) EMPTY(pin->Number)); */ + /* PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Number)); */ pcb_fprintf(FP, " (size %.3mm %.3mm)", pin->Thickness, pin->Thickness); /* height = width */ /* drill details; size */ pcb_fprintf(FP, " (drill %.3mm)\n", pin->DrillingHole); @@ -1185,7 +1185,7 @@ } fprintf(FP, "%*s)\n", indentation + 2, ""); /* - PrintQuotedString(FP, (char *) EMPTY(pin->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Name)); fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN)); */ } @@ -1197,7 +1197,7 @@ (pad->Point1.Y + pad->Point2.Y)/2- element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pad->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Number)); fputs(" R ",FP); /* rectangular, not a pin */ if ((pad->Point1.X-pad->Point2.X) <= 0 @@ -1263,7 +1263,7 @@ pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { int localFlag = 0; polylist_foreach(&layer->Polygon, &it, polygon) { if (polygon->HoleIndexN == 0) { /* no holes defined within polygon, which we implement support for first */ Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 4906) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 4907) @@ -536,10 +536,10 @@ pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { /* fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); */ @@ -581,10 +581,10 @@ int copperStartY; /* used for mapping geda copper arcs onto kicad copper lines */ /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { /* fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); */ @@ -656,10 +656,10 @@ pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { /* fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); */ @@ -795,11 +795,11 @@ information fprintf(FP, "\nDS %s ", F2S(element, PCB_TYPE_ELEMENT)); - PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(DESCRIPTION_NAME(element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(NAMEONPCB_NAME(element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(VALUE_NAME(element))); pcb_fprintf(FP, " %mm %mm %mm %mm %d %d %s]\n(\n", element->MarkX, element->MarkY, DESCRIPTION_TEXT(element).X - element->MarkX, @@ -877,7 +877,7 @@ pin->Y - element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pin->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Number)); if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) { fputs(" R ",FP); /* square */ @@ -895,7 +895,7 @@ fputs("Ne 0 \"\"\n",FP); /* library parts have empty net descriptors */ /* - PrintQuotedString(FP, (char *) EMPTY(pin->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Name)); fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN)); */ fputs("$EndPAD\n",FP); @@ -908,7 +908,7 @@ (pad->Point1.Y + pad->Point2.Y)/2- element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pad->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Number)); fputs(" R ",FP); /* rectangular, not a pin */ if ((pad->Point1.X-pad->Point2.X) <= 0 @@ -1055,7 +1055,7 @@ pin->Y - element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pin->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Number)); if (PCB_FLAG_TEST(PCB_FLAG_SQUARE, pin)) { fputs(" R ",FP); /* square */ @@ -1078,7 +1078,7 @@ fprintf(FP, "Ne 0 \"\"\n"); /* unconnected pads have zero for net */ } /* - PrintQuotedString(FP, (char *) EMPTY(pin->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Name)); fprintf(FP, " %s\n", F2S(pin, PCB_TYPE_PIN)); */ fputs("$EndPAD\n",FP); @@ -1091,7 +1091,7 @@ (pad->Point1.Y + pad->Point2.Y)/2- element->MarkY); fputs("Sh ",FP); /* pin shape descriptor */ - PrintQuotedString(FP, (char *) EMPTY(pad->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Number)); fputs(" R ",FP); /* rectangular, not a pin */ if ((pad->Point1.X-pad->Point2.X) <= 0 @@ -1193,7 +1193,7 @@ pcb_cardinal_t currentLayer = number; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { int localFlag = 0; polylist_foreach(&layer->Polygon, &it, polygon) { if (polygon->HoleIndexN == 0) { /* no holes defined within polygon, which we implement support for first */ Index: trunk/src_plugins/io_lihata/common.c =================================================================== --- trunk/src_plugins/io_lihata/common.c (revision 4906) +++ trunk/src_plugins/io_lihata/common.c (revision 4907) @@ -46,7 +46,7 @@ if (name == NULL) return 0; - for(n = 1; n < ENTRIES(thermal_style); n++) + for(n = 1; n < PCB_ENTRIES(thermal_style); n++) if (strcmp(name, thermal_style[n]) == 0) return n; @@ -59,7 +59,7 @@ const char *io_lihata_thermal_style(int idx) { - if ((idx > 0) && (idx < ENTRIES(thermal_style))) + if ((idx > 0) && (idx < PCB_ENTRIES(thermal_style))) return thermal_style[idx]; return NULL; } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 4906) +++ trunk/src_plugins/io_pcb/file.c (revision 4907) @@ -237,7 +237,7 @@ fprintf(FP, "FileVersion[%i]\n", PCBFileVersionNeeded()); fputs("\nPCB[", FP); - PrintQuotedString(FP, (char *) EMPTY(PCB->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(PCB->Name)); pcb_fprintf(FP, " %[0] %[0]]\n\n", PCB->MaxWidth, PCB->MaxHeight); pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->Grid, PCB->GridOffsetX, PCB->GridOffsetY, conf_core.editor.draw_grid); pcb_fprintf(FP, "Cursor[%[0] %[0] %s]\n", Crosshair.X, Crosshair.Y, c_dtostr(PCB->Zoom)); @@ -301,7 +301,7 @@ pinlist_foreach(&Data->Via, &it, via) { pcb_fprintf(FP, "Via[%[0] %[0] %[0] %[0] %[0] %[0] ", via->X, via->Y, via->Thickness, via->Clearance, via->Mask, via->DrillingHole); - PrintQuotedString(FP, (char *) EMPTY(via->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(via->Name)); fprintf(FP, " %s]\n", F2S(via, PCB_TYPE_VIA)); } } @@ -337,7 +337,7 @@ fprintf(FP, "\tNet("); PrintQuotedString(FP, &menu->Name[2]); fprintf(FP, " "); - PrintQuotedString(FP, (char *) UNKNOWN(menu->Style)); + PrintQuotedString(FP, (char *) PCB_UNKNOWN(menu->Style)); fprintf(FP, ")\n\t(\n"); for (p = 0; p < menu->EntryN; p++) { pcb_lib_entry_t *entry = &menu->Entry[p]; @@ -386,11 +386,11 @@ * both names of an element */ fprintf(FP, "\nElement[%s ", F2S(element, PCB_TYPE_ELEMENT)); - PrintQuotedString(FP, (char *) EMPTY(DESCRIPTION_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(DESCRIPTION_NAME(element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(NAMEONPCB_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(NAMEONPCB_NAME(element))); fputc(' ', FP); - PrintQuotedString(FP, (char *) EMPTY(VALUE_NAME(element))); + PrintQuotedString(FP, (char *) PCB_EMPTY(VALUE_NAME(element))); pcb_fprintf(FP, " %[0] %[0] %[0] %[0] %d %d %s]\n(\n", element->MarkX, element->MarkY, DESCRIPTION_TEXT(element).X - element->MarkX, @@ -402,9 +402,9 @@ pcb_fprintf(FP, "\tPin[%[0] %[0] %[0] %[0] %[0] %[0] ", pin->X - element->MarkX, pin->Y - element->MarkY, pin->Thickness, pin->Clearance, pin->Mask, pin->DrillingHole); - PrintQuotedString(FP, (char *) EMPTY(pin->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Name)); fprintf(FP, " "); - PrintQuotedString(FP, (char *) EMPTY(pin->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pin->Number)); fprintf(FP, " %s]\n", F2S(pin, PCB_TYPE_PIN)); } pinlist_foreach(&element->Pad, &it, pad) { @@ -412,9 +412,9 @@ pad->Point1.X - element->MarkX, pad->Point1.Y - element->MarkY, pad->Point2.X - element->MarkX, pad->Point2.Y - element->MarkY, pad->Thickness, pad->Clearance, pad->Mask); - PrintQuotedString(FP, (char *) EMPTY(pad->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Name)); fprintf(FP, " "); - PrintQuotedString(FP, (char *) EMPTY(pad->Number)); + PrintQuotedString(FP, (char *) PCB_EMPTY(pad->Number)); fprintf(FP, " %s]\n", F2S(pad, PCB_TYPE_PAD)); } linelist_foreach(&element->Line, &it, line) { @@ -445,9 +445,9 @@ pcb_polygon_t *polygon; /* write information about non empty layers */ - if (!LAYER_IS_EMPTY(layer) || (layer->Name && *layer->Name)) { + if (!LAYER_IS_PCB_EMPTY(layer) || (layer->Name && *layer->Name)) { fprintf(FP, "Layer(%i ", (int) Number + 1); - PrintQuotedString(FP, (char *) EMPTY(layer->Name)); + PrintQuotedString(FP, (char *) PCB_EMPTY(layer->Name)); fputs(")\n(\n", FP); WriteAttributeList(FP, &layer->Attributes, "\t"); @@ -463,7 +463,7 @@ } textlist_foreach(&layer->Text, &it, text) { pcb_fprintf(FP, "\tText[%[0] %[0] %d %d ", text->X, text->Y, text->Direction, text->Scale); - PrintQuotedString(FP, (char *) EMPTY(text->TextString)); + PrintQuotedString(FP, (char *) PCB_EMPTY(text->TextString)); fprintf(FP, " %s]\n", F2S(text, PCB_TYPE_TEXT)); } textlist_foreach(&layer->Polygon, &it, polygon) { Index: trunk/src_plugins/io_pcb/parse_l.c =================================================================== --- trunk/src_plugins/io_pcb/parse_l.c (revision 4906) +++ trunk/src_plugins/io_pcb/parse_l.c (revision 4907) @@ -2364,7 +2364,7 @@ #endif if (Pipe == NULL) { - if (EMPTY_STRING_P (Executable)) + if (PCB_EMPTY_STRING_P(Executable)) { l = 2; if ( Path != NULL ) Index: trunk/src_plugins/io_pcb/parse_l.l =================================================================== --- trunk/src_plugins/io_pcb/parse_l.l (revision 4906) +++ trunk/src_plugins/io_pcb/parse_l.l (revision 4907) @@ -223,7 +223,7 @@ #endif if (Pipe == NULL) { - if (EMPTY_STRING_P (Executable)) + if (PCB_EMPTY_STRING_P(Executable)) { l = 2; if ( Path != NULL ) Index: trunk/src_plugins/renumber/renumber.c =================================================================== --- trunk/src_plugins/renumber/renumber.c (revision 4906) +++ trunk/src_plugins/renumber/renumber.c (revision 4907) @@ -151,7 +151,7 @@ */ pcb_fprintf(out, "*WARN* Element \"%s\" at %$md is locked and will not be renumbered.\n", - UNKNOWN(NAMEONPCB_NAME(element)), element->MarkX, element->MarkY); + PCB_UNKNOWN(NAMEONPCB_NAME(element)), element->MarkX, element->MarkY); locked_element_list[lock_cnt] = element; lock_cnt++; } @@ -262,7 +262,7 @@ * elements) names */ for (k = 0; k < lock_cnt; k++) { - if (strcmp(UNKNOWN(NAMEONPCB_NAME(locked_element_list[k])), tmps) == 0) { + if (strcmp(PCB_UNKNOWN(NAMEONPCB_NAME(locked_element_list[k])), tmps) == 0) { ok = 0; break; } Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 4906) +++ trunk/src_plugins/report/report.c (revision 4907) @@ -149,7 +149,7 @@ "It is a pure hole of diameter %$mS.\n" "Name = \"%s\"." "%s", USER_UNITMASK, via->ID, pcb_strflg_f2s(via->Flags, PCB_TYPE_VIA), - via->X, via->Y, via->DrillingHole, EMPTY(via->Name), PCB_FLAG_TEST(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : ""); + via->X, via->Y, via->DrillingHole, PCB_EMPTY(via->Name), PCB_FLAG_TEST(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : ""); else report = pcb_strdup_printf("%m+VIA ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" @@ -165,7 +165,7 @@ via->Clearance / 2, (via->Thickness - via->DrillingHole) / 2, via->Mask, - (via->Mask - via->Thickness) / 2, EMPTY(via->Name), PCB_FLAG_TEST(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : ""); + (via->Mask - via->Thickness) / 2, PCB_EMPTY(via->Name), PCB_FLAG_TEST(PCB_FLAG_LOCK, via) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_PIN: @@ -194,7 +194,7 @@ "It is owned by element %$mS.\n" "%s", USER_UNITMASK, Pin->ID, pcb_strflg_f2s(Pin->Flags, PCB_TYPE_PIN), Pin->X, Pin->Y, Pin->DrillingHole, - EMPTY(element->Name[1].TextString), PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : ""); + PCB_EMPTY(element->Name[1].TextString), PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : ""); else report = pcb_strdup_printf( "%m+PIN ID# %ld; Flags:%s\n" "(X,Y) = %$mD.\n" @@ -212,8 +212,8 @@ (Pin->Thickness - Pin->DrillingHole) / 2, Pin->Mask, (Pin->Mask - Pin->Thickness) / 2, - EMPTY(Pin->Name), - EMPTY(element->Name[1].TextString), EMPTY(Pin->Number), PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : ""); + PCB_EMPTY(Pin->Name), + PCB_EMPTY(element->Name[1].TextString), PCB_EMPTY(Pin->Number), PCB_FLAG_TEST(PCB_FLAG_LOCK, Pin) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_LINE: @@ -239,7 +239,7 @@ line->Point2.X, line->Point2.Y, line->Point2.ID, line->Thickness, line->Clearance / 2, GetLayerNumber(PCB->Data, (pcb_layer_t *) ptr1), - UNKNOWN(line->Number), PCB_FLAG_TEST(PCB_FLAG_LOCK, line) ? "It is LOCKED.\n" : ""); + PCB_UNKNOWN(line->Number), PCB_FLAG_TEST(PCB_FLAG_LOCK, line) ? "It is LOCKED.\n" : ""); break; } case PCB_TYPE_RATLINE: @@ -362,9 +362,9 @@ Pad->Clearance / 2, Pad->Mask, len + Pad->Mask, (Pad->Mask - Pad->Thickness) / 2, - EMPTY(Pad->Name), - EMPTY(element->Name[1].TextString), - EMPTY(Pad->Number), + PCB_EMPTY(Pad->Name), + PCB_EMPTY(element->Name[1].TextString), + PCB_EMPTY(Pad->Number), PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Pad) ? "solder (bottom)" : "component", PCB_FLAG_TEST(PCB_FLAG_LOCK, Pad) ? "It is LOCKED.\n" : ""); break; @@ -391,9 +391,9 @@ element->ID, pcb_strflg_f2s(element->Flags, PCB_TYPE_ELEMENT), element->BoundingBox.X1, element->BoundingBox.Y1, element->BoundingBox.X2, element->BoundingBox.Y2, - EMPTY(element->Name[0].TextString), - EMPTY(element->Name[1].TextString), - EMPTY(element->Name[2].TextString), + PCB_EMPTY(element->Name[0].TextString), + PCB_EMPTY(element->Name[1].TextString), + PCB_EMPTY(element->Name[2].TextString), PCB_SCALE_TEXT(FONT_CAPHEIGHT, element->Name[1].Scale), element->Name[1].X, element->Name[1].Y, PCB_FLAG_TEST(PCB_FLAG_HIDENAME, element) ? ",\n but it's hidden" : "", Index: trunk/src_plugins/teardrops/teardrops.c =================================================================== --- trunk/src_plugins/teardrops/teardrops.c (revision 4906) +++ trunk/src_plugins/teardrops/teardrops.c (revision 4907) @@ -209,10 +209,10 @@ element = (pcb_element_t *) pin->Element; - fprintf(stderr, "Pin %s (%s) at %.6f, %.6f (element %s, %s, %s)\n", EMPTY(pin->Number), EMPTY(pin->Name), + fprintf(stderr, "Pin %s (%s) at %.6f, %.6f (element %s, %s, %s)\n", PCB_EMPTY(pin->Number), PCB_EMPTY(pin->Name), /* 0.01 * pin->X, 0.01 * pin->Y, */ PCB_COORD_TO_MM(pin->X), PCB_COORD_TO_MM(pin->Y), - EMPTY(NAMEONPCB_NAME(element)), EMPTY(VALUE_NAME(element)), EMPTY(DESCRIPTION_NAME(element))); + PCB_EMPTY(NAMEONPCB_NAME(element)), PCB_EMPTY(VALUE_NAME(element)), PCB_EMPTY(DESCRIPTION_NAME(element))); for (layer = 0; layer < max_copper_layer; layer++) { pcb_layer_t *l = &(PCB->Data->Layer[layer]); @@ -256,21 +256,21 @@ fprintf(stderr, "Pad %s (%s) at %.6f, %.6f (element %s, %s, %s) \n", - EMPTY(pad->Number), EMPTY(pad->Name), + PCB_EMPTY(pad->Number), PCB_EMPTY(pad->Name), PCB_COORD_TO_MM((pad->BoundingBox.X1 + pad->BoundingBox.X2) / 2), PCB_COORD_TO_MM((pad->BoundingBox.Y1 + pad->BoundingBox.Y2) / 2), - EMPTY(NAMEONPCB_NAME(element)), EMPTY(VALUE_NAME(element)), EMPTY(DESCRIPTION_NAME(element))); + PCB_EMPTY(NAMEONPCB_NAME(element)), PCB_EMPTY(VALUE_NAME(element)), PCB_EMPTY(DESCRIPTION_NAME(element))); /* fprintf(stderr, */ /* "Pad %s (%s) at ((%.6f, %.6f), (%.6f, %.6f)) (element %s, %s, %s) \n", */ - /* EMPTY (pad->Number), EMPTY (pad->Name), */ + /* PCB_EMPTY(pad->Number), PCB_EMPTY(pad->Name), */ /* PCB_COORD_TO_MM(pad->BoundingBox.X1), */ /* PCB_COORD_TO_MM(pad->BoundingBox.Y1), */ /* PCB_COORD_TO_MM(pad->BoundingBox.X2), */ /* PCB_COORD_TO_MM(pad->BoundingBox.Y2), */ - /* EMPTY (NAMEONPCB_NAME (element)), */ - /* EMPTY (VALUE_NAME (element)), */ - /* EMPTY (DESCRIPTION_NAME (element))); */ + /* PCB_EMPTY(NAMEONPCB_NAME (element)), */ + /* PCB_EMPTY(VALUE_NAME (element)), */ + /* PCB_EMPTY(DESCRIPTION_NAME (element))); */ for (layer = 0; layer < max_copper_layer; layer++) { pcb_layer_t *l = &(PCB->Data->Layer[layer]); Index: trunk/src_plugins/vendordrill/vendor.c =================================================================== --- trunk/src_plugins/vendordrill/vendor.c (revision 4906) +++ trunk/src_plugins/vendordrill/vendor.c (revision 4907) @@ -194,7 +194,7 @@ } /* figure out the vendor name, if specified */ - vendor_name = (char *) UNKNOWN(pcb_hid_cfg_text_value(doc, "vendor")); + vendor_name = (char *) PCB_UNKNOWN(pcb_hid_cfg_text_value(doc, "vendor")); /* figure out the units, if specified */ sval = pcb_hid_cfg_text_value(doc, "/units"); @@ -201,13 +201,13 @@ if (sval == NULL) { sf = PCB_MIL_TO_COORD(1); } - else if ((NSTRCMP(sval, "mil") == 0) || (NSTRCMP(sval, "mils") == 0)) { + else if ((PCB_NSTRCMP(sval, "mil") == 0) || (PCB_NSTRCMP(sval, "mils") == 0)) { sf = PCB_MIL_TO_COORD(1); } - else if ((NSTRCMP(sval, "inch") == 0) || (NSTRCMP(sval, "inches") == 0)) { + else if ((PCB_NSTRCMP(sval, "inch") == 0) || (PCB_NSTRCMP(sval, "inches") == 0)) { sf = PCB_INCH_TO_COORD(1); } - else if (NSTRCMP(sval, "mm") == 0) { + else if (PCB_NSTRCMP(sval, "mm") == 0) { sf = PCB_MM_TO_COORD(1); } else { @@ -219,10 +219,10 @@ rounding_method = ROUND_UP; sval = pcb_hid_cfg_text_value(doc, "/round"); if (sval != NULL) { - if (NSTRCMP(sval, "up") == 0) { + if (PCB_NSTRCMP(sval, "up") == 0) { rounding_method = ROUND_UP; } - else if (NSTRCMP(sval, "nearest") == 0) { + else if (PCB_NSTRCMP(sval, "nearest") == 0) { rounding_method = CLOSEST; } else { @@ -360,9 +360,9 @@ "\tPossible reasons:\n" "\t- pad size too small\n" "\t- new size would be too large or too small\n"), - UNKNOWN(pin->Number), UNKNOWN(pin->Name), + PCB_UNKNOWN(pin->Number), PCB_UNKNOWN(pin->Name), 0.01 * pin->X, 0.01 * pin->Y, - UNKNOWN(NAMEONPCB_NAME(element)), UNKNOWN(VALUE_NAME(element)), UNKNOWN(DESCRIPTION_NAME(element))); + PCB_UNKNOWN(NAMEONPCB_NAME(element)), PCB_UNKNOWN(VALUE_NAME(element)), PCB_UNKNOWN(DESCRIPTION_NAME(element))); } } else { @@ -538,15 +538,15 @@ for(n = res->data.list.first; n != NULL; n = n->next) { if (n->type == LHT_TEXT) { - if (NSTRCMP(n->name, "refdes") == 0) { + if (PCB_NSTRCMP(n->name, "refdes") == 0) { cnt = &n_refdes; lst = &ignore_refdes; } - else if (NSTRCMP(n->name, "value") == 0) { + else if (PCB_NSTRCMP(n->name, "value") == 0) { cnt = &n_value; lst = &ignore_value; } - else if (NSTRCMP(n->name, "descr") == 0) { + else if (PCB_NSTRCMP(n->name, "descr") == 0) { cnt = &n_descr; lst = &ignore_descr; } @@ -578,17 +578,17 @@ noskip = 1; for (i = 0; i < n_refdes; i++) { - if ((NSTRCMP(UNKNOWN(NAMEONPCB_NAME(element)), ignore_refdes[i]) == 0) - || rematch(ignore_refdes[i], UNKNOWN(NAMEONPCB_NAME(element)))) { - pcb_message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because refdes = %s matches %s\n"), UNKNOWN(NAMEONPCB_NAME(element)), ignore_refdes[i]); + if ((PCB_NSTRCMP(PCB_UNKNOWN(NAMEONPCB_NAME(element)), ignore_refdes[i]) == 0) + || rematch(ignore_refdes[i], PCB_UNKNOWN(NAMEONPCB_NAME(element)))) { + pcb_message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because refdes = %s matches %s\n"), PCB_UNKNOWN(NAMEONPCB_NAME(element)), ignore_refdes[i]); noskip = 0; } } if (noskip) for (i = 0; i < n_value; i++) { - if ((NSTRCMP(UNKNOWN(VALUE_NAME(element)), ignore_value[i]) == 0) - || rematch(ignore_value[i], UNKNOWN(VALUE_NAME(element)))) { - pcb_message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because value = %s matches %s\n"), UNKNOWN(VALUE_NAME(element)), ignore_value[i]); + if ((PCB_NSTRCMP(PCB_UNKNOWN(VALUE_NAME(element)), ignore_value[i]) == 0) + || rematch(ignore_value[i], PCB_UNKNOWN(VALUE_NAME(element)))) { + pcb_message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because value = %s matches %s\n"), PCB_UNKNOWN(VALUE_NAME(element)), ignore_value[i]); noskip = 0; } } @@ -595,18 +595,18 @@ if (noskip) for (i = 0; i < n_descr; i++) { - if ((NSTRCMP(UNKNOWN(DESCRIPTION_NAME(element)), ignore_descr[i]) + if ((PCB_NSTRCMP(PCB_UNKNOWN(DESCRIPTION_NAME(element)), ignore_descr[i]) == 0) - || rematch(ignore_descr[i], UNKNOWN(DESCRIPTION_NAME(element)))) { + || rematch(ignore_descr[i], PCB_UNKNOWN(DESCRIPTION_NAME(element)))) { pcb_message(PCB_MSG_DEFAULT, _ ("Vendor mapping skipped because descr = %s matches %s\n"), - UNKNOWN(DESCRIPTION_NAME(element)), ignore_descr[i]); + PCB_UNKNOWN(DESCRIPTION_NAME(element)), ignore_descr[i]); noskip = 0; } } if (noskip && PCB_FLAG_TEST(PCB_FLAG_LOCK, element)) { - pcb_message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because element %s is locked\n"), UNKNOWN(NAMEONPCB_NAME(element))); + pcb_message(PCB_MSG_DEFAULT, _("Vendor mapping skipped because element %s is locked\n"), PCB_UNKNOWN(NAMEONPCB_NAME(element))); noskip = 0; } Index: trunk/tests/strflags/tester.c =================================================================== --- trunk/tests/strflags/tester.c (revision 4906) +++ trunk/tests/strflags/tester.c (revision 4907) @@ -87,7 +87,7 @@ otype = PCB_TYPEMASK_ALL; fh.Flags = empty_flags; - for (i = 0; i < ENTRIES(object_flagbits); i++) { + for (i = 0; i < PCB_ENTRIES(object_flagbits); i++) { if (PCB_FLAG_TEST(object_flagbits[i].mask, &fh)) continue; if ((otype & object_flagbits[i].object_types) == 0) @@ -127,7 +127,7 @@ otype = PCB_TYPEMASK_ALL; fh.Flags = empty_flags; - for (i = 0; i < ENTRIES(pcb_flagbits); i++) { + for (i = 0; i < PCB_ENTRIES(pcb_flagbits); i++) { if (PCB_FLAG_TEST(pcb_flagbits[i].mask, &fh)) continue; if ((random() & 4) == 0)