-\r
#include "XMLTree.h"\r
-\r
+#include <cstring>\r
// functions to convert tag positions to the corresponding tree node and viceversa. \r
// These are implemented in order to be able to change the tree and Tags representations, \r
// without affecting the code so much.\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT;\r
}\r
- setbit(par_aux,npar,OP); // marks a new opening parenthesis for the tree root\r
- npar++;\r
\r
- tags_aux = (TagType *)malloc(sizeof(TagType));\r
+ tags_aux = (TagType *) malloc(sizeof(TagType));\r
if (!tags_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT;\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT; \r
}\r
- setbit(par_aux,npar,CP); \r
- npar++;\r
\r
// creates the data structure for the tree topology\r
Par = (bp *)malloc(sizeof(bp)); \r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT; \r
}\r
+\r
setbit(par_aux,npar,OP); // marks a new opening parenthesis\r
\r
// transforms the tagname into a tag identifier. If the tag is new, we insert\r
TagName[i] = (unsigned char *)malloc(sizeof(unsigned char)*(strlen((const char *)tagname)+1));\r
strcpy((char *)TagName[i], (const char *)tagname);\r
} \r
- \r
- tags_aux = (TagType *)realloc(tags_aux, sizeof(TagType)*(npar + 1));\r
-\r
+ tags_aux = (TagType *) realloc(tags_aux, sizeof(TagType)*(npar + 1));\r
if (!tags_aux) {\r
fprintf(stderr, "Error: not enough memory\n");\r
return NULLT;\r