Index: trunk/src/attrib.c =================================================================== --- trunk/src/attrib.c (revision 4634) +++ trunk/src/attrib.c (revision 4635) @@ -100,20 +100,3 @@ list->List = NULL; list->Max = 0; } - -/* --------------------------------------------------------------------------- - * Add an attribute to a list. - */ -AttributeTypePtr CreateNewAttribute(AttributeListTypePtr list, const char *name, const char *value) -{ -#warning TODO: how is it better than set? check callers, remove this if possible - if (list->Number >= list->Max) { - list->Max += 10; - list->List = (AttributeType *) realloc(list->List, list->Max * sizeof(AttributeType)); - } - list->List[list->Number].name = pcb_strdup_null(name); - list->List[list->Number].value = pcb_strdup_null(value); - list->Number++; - return &list->List[list->Number - 1]; -} - Index: trunk/src/attrib.h =================================================================== --- trunk/src/attrib.h (revision 4634) +++ trunk/src/attrib.h (revision 4635) @@ -57,8 +57,6 @@ /* Simplistic version of Remove. */ #define AttributeRemove(OBJ, name) AttributeRemoveFromList (&(OBJ->Attributes), name) -AttributeTypePtr CreateNewAttribute(AttributeListTypePtr list, const char *name, const char *value); - void FreeAttributeListMemory(AttributeListTypePtr list); #endif Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 4634) +++ trunk/src/obj_elem.c (revision 4635) @@ -552,7 +552,7 @@ END_LOOP; for (i = 0; i < Src->Attributes.Number; i++) - CreateNewAttribute(&Dest->Attributes, Src->Attributes.List[i].name, Src->Attributes.List[i].value); + AttributePutToList(&Dest->Attributes, Src->Attributes.List[i].name, Src->Attributes.List[i].value, 0); Dest->MarkX = Src->MarkX + dx; Dest->MarkY = Src->MarkY + dy; Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 4634) +++ trunk/src/object_act.c (revision 4635) @@ -692,7 +692,7 @@ delete_attr(&e->Attributes, attr); } if (!attr && value) { - CreateNewAttribute(&e->Attributes, name, value); + AttributePutToList(&e->Attributes, name, value, 0); } return 0; Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 4634) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 4635) @@ -2861,7 +2861,7 @@ case 200: #line 1977 "parse_y.y" /* yacc.c:1646 */ { - CreateNewAttribute (attr_list, (yyvsp[-2].string), (yyvsp[-1].string) ? (yyvsp[-1].string) : (char *)""); + AttributePutToList(attr_list, (yyvsp[-2].string), (yyvsp[-1].string) ? (yyvsp[-1].string) : (char *)"", 0); free ((yyvsp[-2].string)); free ((yyvsp[-1].string)); } Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 4634) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 4635) @@ -1975,7 +1975,7 @@ attribute : T_ATTRIBUTE '(' STRING STRING ')' { - CreateNewAttribute (attr_list, $3, $4 ? $4 : (char *)""); + AttributePutToList(attr_list, $3, $4 ? $4 : (char *)"", 0); free ($3); free ($4); }