From 1c3300373a43062be9bb8d23faf3c8446f9aa6c5 Mon Sep 17 00:00:00 2001 From: kim Date: Thu, 27 Nov 2008 07:17:07 +0000 Subject: [PATCH] Makefile should not include testTextCollection.o which is only a testing program (and contains a main). XMLTree.h should contain ! git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@18 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- XMLTree.cpp | 10 ++++------ XMLTree.h | 2 +- makefile | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/XMLTree.cpp b/XMLTree.cpp index ea12fad..b5e53a7 100644 --- a/XMLTree.cpp +++ b/XMLTree.cpp @@ -1,6 +1,5 @@ - #include "XMLTree.h" - +#include // functions to convert tag positions to the corresponding tree node and viceversa. // These are implemented in order to be able to change the tree and Tags representations, // without affecting the code so much. @@ -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 npar++; - tags_aux = (TagType *)malloc(sizeof(TagType)); + tags_aux = (TagType *) malloc(sizeof(TagType)); if (!tags_aux) { fprintf(stderr, "Error: not enough memory\n"); return NULLT; @@ -665,6 +664,7 @@ int XMLTree::NewOpenTag(unsigned char *tagname) fprintf(stderr, "Error: not enough memory\n"); return NULLT; } + setbit(par_aux,npar,OP); // marks a new opening parenthesis // transforms the tagname into a tag identifier. If the tag is new, we insert @@ -684,9 +684,7 @@ int XMLTree::NewOpenTag(unsigned char *tagname) TagName[i] = (unsigned char *)malloc(sizeof(unsigned char)*(strlen((const char *)tagname)+1)); strcpy((char *)TagName[i], (const char *)tagname); } - - tags_aux = (TagType *)realloc(tags_aux, sizeof(TagType)*(npar + 1)); - + tags_aux = (TagType *) realloc(tags_aux, sizeof(TagType)*(npar + 1)); if (!tags_aux) { fprintf(stderr, "Error: not enough memory\n"); return NULLT; diff --git a/XMLTree.h b/XMLTree.h index c0dab2b..ba01941 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -333,7 +333,7 @@ public: /** GetText(d): returns the text corresponding to document with * id d. */ uchar* GetText(DocID d) { - Text->GetText(d); + return Text->GetText(d); } /** Save: saves XML tree data structure to file. */ diff --git a/makefile b/makefile index 5db952e..c3a7e94 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ -FLAGS = -O9 -I./libcds/includes/ +FLAGS = -O3 -I./libcds/includes/ OBJECTS=libcds/lib/libcds.a -OBJECTS_TC= TextCollection/BitRank.o TextCollection/dynFMI.o TextCollection/rbtree.o TextCollection/Tools.o TextCollection/bittree.o TextCollection/handle.o TextCollection/testTextCollection.o TextCollection/CSA.o TextCollection/pos.o TextCollection/TextCollection.o +OBJECTS_TC= TextCollection/BitRank.o TextCollection/dynFMI.o TextCollection/rbtree.o TextCollection/Tools.o TextCollection/bittree.o TextCollection/handle.o TextCollection/CSA.o TextCollection/pos.o TextCollection/TextCollection.o all: libcds text_collection XMLTree -- 2.17.1