Makefile should not include testTextCollection.o which is only a testing program
[SXSI/XMLTree.git] / XMLTree.cpp
index ea12fad..b5e53a7 100644 (file)
@@ -1,6 +1,5 @@
-\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
@@ -584,7 +583,7 @@ int XMLTree::OpenDocument(bool empty_texts, int sample_rate_text)
     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
@@ -665,6 +664,7 @@ int XMLTree::NewOpenTag(unsigned char *tagname)
        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
@@ -684,9 +684,7 @@ int XMLTree::NewOpenTag(unsigned char *tagname)
        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