From: kim Date: Fri, 30 Apr 2010 08:43:46 +0000 (+0000) Subject: Backport changes from the grammar branch X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2FXMLTree.git;a=commitdiff_plain;h=f32808a35be7a1e62830a5972473178014fa44e5 Backport changes from the grammar branch git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@827 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- diff --git a/XMLTree.cpp b/XMLTree.cpp index db9814c..2ebb5a1 100644 --- a/XMLTree.cpp +++ b/XMLTree.cpp @@ -1,9 +1,12 @@ #include "basics.h" -//#include -#include #include "XMLTree.h" #include "timings.h" #include +using std::cout; +using std::endl; +using std::min; +using std::string; + // 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. @@ -255,7 +258,7 @@ XMLTree *XMLTree::Load(int fd, bool load_tc,int sample_factor) XMLTree *XML_Tree; int i; - + buffer[1023] = '\0'; fp = fdopen(fd, "r"); @@ -269,23 +272,21 @@ XMLTree *XMLTree::Load(int fd, bool load_tc,int sample_factor) PRINTTIME("Loading parenthesis struct", Loading); STARTTIMER(); - XML_Tree->TagName = new vector(); - XML_Tree->tIdMap = new std::unordered_map(); - - string s; + XML_Tree->TagName = new std::vector(); + XML_Tree->tIdMap = new std::unordered_map(); + std::string s; int ntags; // Load the tag names ufread(&ntags, sizeof(int), 1, fp); for (i=0; iTagName->push_back(s); + XML_Tree->TagName->push_back(s); XML_Tree->tIdMap->insert(std::make_pair(s,i)); }; @@ -538,22 +539,6 @@ treeNode XMLTree::NextElement(treeNode x) } else return x; } -value XMLTree::CamlFirstElement(value x) -{ - return Val_int(FirstElement(Int_val(x))); -} -value XMLTree::CamlNextElement(value x) -{ - return Val_int(NextElement(Int_val(x))); -} - -extern "C" value caml_cpp_fast_first_element(value xmltree, value node){ - return XMLTREE(xmltree)->CamlFirstElement(node); -} - -extern "C" value caml_cpp_fast_next_element(value xmltree, value node){ - return XMLTREE(xmltree)->CamlNextElement(node); -} // LastChild(x): returns the last child of node x. treeNode XMLTree::LastChild(treeNode x) diff --git a/XMLTree.h b/XMLTree.h index ea7b778..6d11d78 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -20,23 +20,13 @@ #ifndef XMLTREE_H_ #define XMLTREE_H_ -extern "C" { -#define CAML_NAME_SPACE -#include -#include -#define XMLTREE(x) ((XMLTree *)(* (XMLTree**) Data_custom_val(x))) - //#define XMLTREE(x) ((XMLTree*) (x)) -} + + #include #include #include #include "TextCollection/TextCollectionBuilder.h" -#include -#include -#include - - #undef W #undef WW #undef Wminusone @@ -50,7 +40,6 @@ using SXSI::TextCollection; using SXSI::TextCollectionBuilder; - // this constant is used to efficiently compute the child operation in the tree #define OPTD 10 @@ -96,7 +85,7 @@ typedef struct { typedef std::unordered_set TagIdSet; -typedef std::unordered_map TagIdMap; +typedef std::unordered_map TagIdMap; typedef TagIdMap::const_iterator TagIdMapIT; #define REGISTER_TAG(v,h,t) do { (h)->insert(std::make_pair((t),(v)->size()));\ @@ -123,7 +112,7 @@ class XMLTree { bp *Par; /** Mapping from tag identifer to tag name */ - vector *TagName; + std::vector *TagName; TagIdMap * tIdMap; /** Bit vector indicating with a 1 the positions of the non-empty texts. */ @@ -142,7 +131,7 @@ class XMLTree { FILE* stream; int stream_fd; - string * buffer; + std::string * buffer; void myfputs(const char* s, FILE * fp){ buffer->append(s); if (buffer->size() >= 100000){ @@ -181,7 +170,7 @@ class XMLTree { XMLTree(){ buffer = 0;}; // non const pointer are freed by this method. - XMLTree( pb * const par, uint npar, vector * const TN, TagIdMap * const tim, uint *empty_texts_bmp, TagType *tags, + XMLTree( pb * const par, uint npar, std::vector * const TN, TagIdMap * const tim, uint *empty_texts_bmp, TagType *tags, TextCollection * const TC, bool dis_tc); public: @@ -271,7 +260,7 @@ public: * if none. */ treeNode FirstElement(treeNode x); - value CamlFirstElement(value x); + /** LastChild(x): returns the last child of node x. */ treeNode LastChild(treeNode x); @@ -284,7 +273,7 @@ public: * if none. */ treeNode NextElement(treeNode x); - value CamlNextElement(value x); + /** PrevSibling(x): returns the previous sibling of node x, assuming it * exists. */ @@ -511,8 +500,6 @@ public: }; -extern "C" value caml_cpp_fast_first_element(value xmltree, value node); -extern "C" value caml_cpp_fast_next_element(value xmltree, value node); diff --git a/XMLTreeBuilder.cpp b/XMLTreeBuilder.cpp index 595ca79..9f7d060 100644 --- a/XMLTreeBuilder.cpp +++ b/XMLTreeBuilder.cpp @@ -1,6 +1,7 @@ #include "basics.h" #include "XMLTreeBuilder.h" #include "timings.h" +using std::string; XMLTreeBuilder::~XMLTreeBuilder(){ diff --git a/XMLTreeBuilder.h b/XMLTreeBuilder.h index 7dc08a1..055eeda 100644 --- a/XMLTreeBuilder.h +++ b/XMLTreeBuilder.h @@ -22,10 +22,6 @@ #ifndef XMLTREEBUILDER_H_ #define XMLTREEBUILDER_H_ -#include -#include -#include -#include #include "TextCollection/TextCollectionBuilder.h" #undef W #undef WW @@ -33,10 +29,6 @@ #include "XMLTree.h" -#include "bp.h" -#include -#include -#include using SXSI::TextCollection; using SXSI::TextCollectionBuilder; @@ -58,7 +50,7 @@ class XMLTreeBuilder { int npar; /** Mapping from tag identifer to tag name */ - vector *TagName; + std::vector *TagName; TagIdMap * tIdMap; /** Array containing the sequence of tags */ TagType *tags_aux; @@ -69,7 +61,7 @@ class XMLTreeBuilder { /** The texts in the XML document (cached for faster display) */ - vector *CachedText; + std::vector *CachedText; unsigned int *empty_texts_aux; int eta_size; @@ -101,12 +93,12 @@ public: /** NewOpenTag(tagname): indicates the event of finding a new opening tag * in the document. Tag name is given. Returns a non-zero value upon * success, and returns NULLT in case of error. */ - int NewOpenTag(string tagname); + int NewOpenTag(std::string tagname); /** NewClosingTag(tagname): indicates the event of finding a new closing tag * in the document. Tag name is given. Returns a non-zero value upon * success, and returns NULLT in case of error. */ - int NewClosingTag(string tagname); + int NewClosingTag(std::string tagname); /** NewText(s): indicates the event of finding a new text s in * the document. The new text is inserted within the text collection. @@ -115,7 +107,7 @@ public: * the string the sequence '\0x01\0x00' is inserted in the TextCollection * It is ok to do so since a non printable character cannot occur in an XML document */ - int NewText(string text); + int NewText(std::string text); }; diff --git a/basics.h b/basics.h index 7449c11..97cbec1 100644 --- a/basics.h +++ b/basics.h @@ -1,21 +1,21 @@ -#ifndef BASICS_H -#define BASICS_H +#ifndef BASICS_H_ +#define BASICS_H_ + -#include #include #include -#include // for memset +//#include // for memset #include #include #include - +#define B_ERROR(msg) do { fprintf(stderr,"%s\n", msg); exit(1); } while (0) inline void ufread(void *ptr, size_t size, size_t nmemb, FILE *stream) { size_t res; res = fread(ptr,size,nmemb,stream); if (res < nmemb) - throw ("ufread I/O error" ); + B_ERROR ("ufread I/O error" ); return; } @@ -24,7 +24,7 @@ inline void ufwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) size_t res; res = fwrite(ptr,size,nmemb,stream); if (res < nmemb) - throw "ufwrite I/O error"; + B_ERROR("ufwrite I/O error"); return; } @@ -33,7 +33,7 @@ inline void *urealloc(void *ptr, size_t size) void *dest = realloc(ptr,size); //don't fail if we requested size 0 if (dest == NULL && size > 0 ) - throw std::bad_alloc(); + B_ERROR("urealoc error"); return dest; } // realloc and set to 0 @@ -45,10 +45,12 @@ inline void *urecalloc(void *ptr, size_t o_size, size_t n_size) void *dest = realloc(ptr,n_size); //don't fail if we requested size 0 if (dest == NULL && n_size > 0 ) - throw std::bad_alloc(); + B_ERROR("urecalloc error"); // Initialize the new area with 0 void * n_area_start = &(((char*) dest)[o_size]); - memset(n_area_start,0, n_size - o_size); + // memset(n_area_start,0, n_size - o_size); + for(size_t i = 0; i < n_size - o_size;i++) + ((char *) n_area_start)[i] = 0; return dest; } @@ -57,7 +59,7 @@ inline void *ucalloc(size_t nmemb, size_t size) void * dest = calloc(nmemb,size); //don't fail if we requested size 0 if (dest == NULL && nmemb > 0 && size > 0 ) - throw std::bad_alloc(); + B_ERROR("ucalloc error"); return dest; } @@ -65,7 +67,7 @@ inline void *umalloc(size_t size) { void * dest = malloc(size); if (dest == NULL && size > 0) - throw std::bad_alloc(); + B_ERROR("umaloc error"); return dest; } diff --git a/bp.c b/bp.c index 6b7e296..1745621 100644 --- a/bp.c +++ b/bp.c @@ -1,4 +1,7 @@ #include "bp.h" +#include +using std::min; +using std::max; //#define CHECK #define RANDOM @@ -93,14 +96,16 @@ int degtbl2[(2*ETW+1)*(1<(y)?(x):(y)) -#endif typedef struct { @@ -171,4 +165,5 @@ extern int childtbl[(ETW)*(1< #include #include "bp.h" +#ifndef min + #define min(x,y) ((x)<(y)?(x):(y)) +#endif +#ifndef max + #define max(x,y) ((x)>(y)?(x):(y)) +#endif #define NOTFOUND -2 #define CONTINUE -3 diff --git a/libcds/Makefile b/libcds/Makefile index b6a856c..678a108 100644 --- a/libcds/Makefile +++ b/libcds/Makefile @@ -1,5 +1,5 @@ -all: clean libcompact tests +all: clean libcompact doc: diff --git a/libcds/src/basics.h b/libcds/src/basics.h index 3376902..85bfe22 100644 --- a/libcds/src/basics.h +++ b/libcds/src/basics.h @@ -32,7 +32,7 @@ #include #include #include -using namespace std; +////using namespace std; #include #include diff --git a/libcds/src/coders/huffman_codes.cpp b/libcds/src/coders/huffman_codes.cpp index e603133..d11458d 100644 --- a/libcds/src/coders/huffman_codes.cpp +++ b/libcds/src/coders/huffman_codes.cpp @@ -20,6 +20,7 @@ */ #include +using std::max; huffman_codes::huffman_codes(uint * symb, uint n) { uint max_v = 0; diff --git a/libcds/src/static_bitsequence/sdarray.cpp b/libcds/src/static_bitsequence/sdarray.cpp index 258162a..4fe52b2 100644 --- a/libcds/src/static_bitsequence/sdarray.cpp +++ b/libcds/src/static_bitsequence/sdarray.cpp @@ -1,6 +1,7 @@ #include - +using std::min; +using std::max; #if 0 typedef unsigned int qword; #define logD 4 diff --git a/libcds/src/static_bitsequence/static_bitsequence.h b/libcds/src/static_bitsequence/static_bitsequence.h index b150974..d8e3f18 100644 --- a/libcds/src/static_bitsequence/static_bitsequence.h +++ b/libcds/src/static_bitsequence/static_bitsequence.h @@ -31,7 +31,7 @@ #include -using namespace std; +//using namespace std; /** Base class for static bitsequences, contains many abstract functions, so this can't * be instantiated. It includes base implementations for rank0, select0 and select1 based diff --git a/libcds/src/static_bitsequence/static_bitsequence_brw32.cpp b/libcds/src/static_bitsequence/static_bitsequence_brw32.cpp index f671a72..204ce57 100644 --- a/libcds/src/static_bitsequence/static_bitsequence_brw32.cpp +++ b/libcds/src/static_bitsequence/static_bitsequence_brw32.cpp @@ -23,7 +23,8 @@ #include #include // #include - +using std::cout; +using std::endl; ///////////// //Rank(B,i)// diff --git a/libcds/src/static_bitsequence/static_bitsequence_rrr02.cpp b/libcds/src/static_bitsequence/static_bitsequence_rrr02.cpp index 47a382e..18396fa 100644 --- a/libcds/src/static_bitsequence/static_bitsequence_rrr02.cpp +++ b/libcds/src/static_bitsequence/static_bitsequence_rrr02.cpp @@ -20,7 +20,8 @@ */ #include - +using std::min; +using std::max; table_offset * static_bitsequence_rrr02::E = NULL; static_bitsequence_rrr02::static_bitsequence_rrr02() { diff --git a/libcds/src/static_bitsequence/static_bitsequence_rrr02.h b/libcds/src/static_bitsequence/static_bitsequence_rrr02.h index 3327672..e50d273 100644 --- a/libcds/src/static_bitsequence/static_bitsequence_rrr02.h +++ b/libcds/src/static_bitsequence/static_bitsequence_rrr02.h @@ -31,7 +31,7 @@ #include #include -using namespace std; +//using namespace std; /** Implementation of Raman, Raman and Rao's [1] proposal for rank/select capable * data structures, it achieves space nH_0, O(sample_rate) time for rank and O(log len) diff --git a/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp b/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp index f073e69..793b7af 100644 --- a/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp +++ b/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.cpp @@ -20,7 +20,8 @@ */ #include - +using std::min; +using std::max; #define VARS_NEEDED uint C_len = len/BLOCK_SIZE_LIGHT + (len%BLOCK_SIZE_LIGHT!=0);\ uint C_field_bits = bits(BLOCK_SIZE_LIGHT);\ uint O_len = uint_len(1,O_bits_len);\ diff --git a/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.h b/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.h index 15da0a9..2a5d57f 100644 --- a/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.h +++ b/libcds/src/static_bitsequence/static_bitsequence_rrr02_light.h @@ -31,7 +31,7 @@ #include #include -using namespace std; +//using namespace std; /** Implementation of Raman, Raman and Rao's [1] proposal for rank/select capable * data structures, it achieves space nH_0, O(sample_rate) time for rank and O(log len) diff --git a/libcds/src/static_bitsequence/table_offset.h b/libcds/src/static_bitsequence/table_offset.h index 8f7bdeb..aabebba 100644 --- a/libcds/src/static_bitsequence/table_offset.h +++ b/libcds/src/static_bitsequence/table_offset.h @@ -25,7 +25,7 @@ #include #include -using namespace std; +//using namespace std; /** Universal table required for static_bitsequence_rrr02, Raman, Raman and Rao's [1] * proposal for rank/select capable data structures, it achieves space nH_0, diff --git a/libcds/src/static_sequence/static_sequence.cpp b/libcds/src/static_sequence/static_sequence.cpp index 9e8c0e4..bd86382 100644 --- a/libcds/src/static_sequence/static_sequence.cpp +++ b/libcds/src/static_sequence/static_sequence.cpp @@ -20,6 +20,12 @@ */ #include +using std::max; +using std::min; +using std::cout; +using std::cin; +using std::endl; + static_sequence::static_sequence() {} static_sequence::~static_sequence() {} diff --git a/libcds/src/static_sequence/static_sequence.h b/libcds/src/static_sequence/static_sequence.h index 4fa5da4..594a748 100644 --- a/libcds/src/static_sequence/static_sequence.h +++ b/libcds/src/static_sequence/static_sequence.h @@ -26,14 +26,14 @@ #include #include #include - +using std::vector; #define WVTREE_HDR 2 #define GMR_CHUNK_HDR 3 #define GMR_HDR 4 #define WVTREE_NOPTRS_HDR 5 #define BS_HDR 6 -using namespace std; +//using namespace std; /** Base class for static sequences, contains many abstract functions, so this can't * be instantiated. diff --git a/libcds/src/static_sequence/static_sequence_bs.cpp b/libcds/src/static_sequence/static_sequence_bs.cpp index 83f18c7..f04325e 100644 --- a/libcds/src/static_sequence/static_sequence_bs.cpp +++ b/libcds/src/static_sequence/static_sequence_bs.cpp @@ -1,6 +1,6 @@ #include - +using std::max; static_sequence_bs::static_sequence_bs(uint * seq, uint n, alphabet_mapper * am, static_bitsequence_builder * bmb) { sigma = 0; len = n; diff --git a/libcds/src/static_sequence/static_sequence_gmr.cpp b/libcds/src/static_sequence/static_sequence_gmr.cpp index 9203171..d78518f 100644 --- a/libcds/src/static_sequence/static_sequence_gmr.cpp +++ b/libcds/src/static_sequence/static_sequence_gmr.cpp @@ -20,7 +20,7 @@ */ #include - +using std::max; static_sequence_gmr::static_sequence_gmr(uint * sequence, uint n, uint chunk_length, static_bitsequence_builder * bmb, static_sequence_builder * ssb) { len = n; if(len%chunk_length) len+=chunk_length-len%chunk_length; diff --git a/libcds/src/static_sequence/static_sequence_gmr.h b/libcds/src/static_sequence/static_sequence_gmr.h index 76e0d65..5159dea 100644 --- a/libcds/src/static_sequence/static_sequence_gmr.h +++ b/libcds/src/static_sequence/static_sequence_gmr.h @@ -30,7 +30,7 @@ #include #include -using namespace std; +//using namespace std; class static_sequence_gmr : public static_sequence { public: diff --git a/libcds/src/static_sequence/static_sequence_gmr_chunk.cpp b/libcds/src/static_sequence/static_sequence_gmr_chunk.cpp index d575e99..5eb105e 100644 --- a/libcds/src/static_sequence/static_sequence_gmr_chunk.cpp +++ b/libcds/src/static_sequence/static_sequence_gmr_chunk.cpp @@ -20,6 +20,7 @@ */ #include "static_sequence_gmr_chunk.h" +using std::max; static_sequence_gmr_chunk::static_sequence_gmr_chunk(uint * sequence, uint chunk_length, static_bitsequence_builder *bmb, static_permutation_builder *pmb) { sigma = 0; diff --git a/libcds/src/static_sequence/static_sequence_gmr_chunk.h b/libcds/src/static_sequence/static_sequence_gmr_chunk.h index 9c034f5..8e7a11a 100644 --- a/libcds/src/static_sequence/static_sequence_gmr_chunk.h +++ b/libcds/src/static_sequence/static_sequence_gmr_chunk.h @@ -31,7 +31,7 @@ #include #include -using namespace std; +//using namespace std; /** Implementation of the Chunk of Golynski et al's rank/select * data structure [1]. diff --git a/libcds/src/static_sequence/static_sequence_wvtree.h b/libcds/src/static_sequence/static_sequence_wvtree.h index 5216585..6a112fb 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree.h +++ b/libcds/src/static_sequence/static_sequence_wvtree.h @@ -32,7 +32,7 @@ #include #include -using namespace std; +//using namespace std; /** Wavelet tree implementation using pointers. * diff --git a/libcds/src/static_sequence/static_sequence_wvtree_noptrs.cpp b/libcds/src/static_sequence/static_sequence_wvtree_noptrs.cpp index 9a4d64c..18ddcbd 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree_noptrs.cpp +++ b/libcds/src/static_sequence/static_sequence_wvtree_noptrs.cpp @@ -20,7 +20,8 @@ */ #include - +using std::min; +using std::max; static_sequence_wvtree_noptrs::static_sequence_wvtree_noptrs(uint * symbols, uint n, static_bitsequence_builder * bmb, alphabet_mapper * am, bool deleteSymbols) { this->n=n; this->am=am; diff --git a/libcds/src/static_sequence/static_sequence_wvtree_noptrs.h b/libcds/src/static_sequence/static_sequence_wvtree_noptrs.h index 399f3c2..170cef9 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree_noptrs.h +++ b/libcds/src/static_sequence/static_sequence_wvtree_noptrs.h @@ -30,7 +30,7 @@ #include #include -using namespace std; +//using namespace std; class static_sequence_wvtree_noptrs : public static_sequence { public: diff --git a/libcds/src/static_sequence/wt_coder.h b/libcds/src/static_sequence/wt_coder.h index 5f6d436..c5dc91e 100644 --- a/libcds/src/static_sequence/wt_coder.h +++ b/libcds/src/static_sequence/wt_coder.h @@ -25,7 +25,7 @@ #include #include -using namespace std; +//using namespace std; #define WT_CODER_HUFF_HDR 2 #define WT_CODER_BINARY_HDR 3 diff --git a/libcds/src/static_sequence/wt_coder_binary.cpp b/libcds/src/static_sequence/wt_coder_binary.cpp index e9f37dc..a49efc8 100644 --- a/libcds/src/static_sequence/wt_coder_binary.cpp +++ b/libcds/src/static_sequence/wt_coder_binary.cpp @@ -20,7 +20,8 @@ */ #include - +using std::min; +using std::max; wt_coder_binary::wt_coder_binary(uint * seq, uint n, alphabet_mapper * am) { uint max_v = 0; for(uint i=0;i #include #include +using std::vector; /** Clase for representing internal nodes * diff --git a/libcds/src/utils/alphabet_mapper.h b/libcds/src/utils/alphabet_mapper.h index faef2ff..9867674 100644 --- a/libcds/src/utils/alphabet_mapper.h +++ b/libcds/src/utils/alphabet_mapper.h @@ -28,7 +28,7 @@ #define ALPHABET_MAPPER_NONE_HDR 2 #define ALPHABET_MAPPER_CONT_HDR 3 -using namespace std; +//using namespace std; /** Base class for alphabet mappers * diff --git a/libcds/src/utils/alphabet_mapper_cont.cpp b/libcds/src/utils/alphabet_mapper_cont.cpp index f6a9cb5..776899b 100644 --- a/libcds/src/utils/alphabet_mapper_cont.cpp +++ b/libcds/src/utils/alphabet_mapper_cont.cpp @@ -20,7 +20,7 @@ */ #include - +using std::max; alphabet_mapper_cont::alphabet_mapper_cont(uint * seq, uint n, static_bitsequence_builder *bmb) { uint max_v = 0; for(uint i=0;i #include -using namespace std; +//using namespace std; /** Mapper that doesn't change the value (identity) * diff --git a/libcds/src/utils/alphabet_mapper_none.h b/libcds/src/utils/alphabet_mapper_none.h index 8609914..5484451 100644 --- a/libcds/src/utils/alphabet_mapper_none.h +++ b/libcds/src/utils/alphabet_mapper_none.h @@ -26,7 +26,7 @@ #include #include -using namespace std; +//using namespace std; /** Mapper that doesn't change the value (identity) * diff --git a/libcds/tests/static_sequence_wvtree_test.cpp b/libcds/tests/static_sequence_wvtree_test.cpp index 4470f24..6c2820d 100644 --- a/libcds/tests/static_sequence_wvtree_test.cpp +++ b/libcds/tests/static_sequence_wvtree_test.cpp @@ -29,6 +29,7 @@ #include #include #include "static_sequence_tester.h" +using namespace std; int main(int argc, char ** argv) { if(argc!=6) { diff --git a/makefile b/makefile index 4eae048..ada8264 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,5 @@ -FLAGS =-std=c++0x -O3 -I./libcds/includes/ -I. -fno-PIC +CFLAGS= -g -O0 -I./libcds/includes/ -I. +FLAGS= -std=c++0x $(CFLAGS) LIBCDS_A=libcds/lib/libcds.a OBJECTS_TCO= TextCollection/TextCollection.o TextCollection/TextCollectionBuilder.o TextCollection/TCImplementation.o TextCollection/Tools.o TextCollection/BitRank.o TextCollection/TextStorage.o diff --git a/timings.h b/timings.h index 684d4e9..d4c4935 100644 --- a/timings.h +++ b/timings.h @@ -17,10 +17,10 @@ static unsigned int cBuilding = 0; static struct timeval tmpv1; static struct timeval tmpv2; -static string mem1; -static string mem2; +static std::string mem1; +static std::string mem2; -static void read_procmem(string& memstr) { +static void read_procmem(std::string& memstr) { std::string buf; pid_t pid = getpid(); std::stringstream path;