From: Kim Nguyễn Date: Wed, 17 Oct 2012 16:43:53 +0000 (+0200) Subject: Revert "Change the get_text() method to return a const char*" X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2FXMLTree.git;a=commitdiff_plain;h=1ecd202ec601b601acca14ece6c9c3c9e494d68f Revert "Change the get_text() method to return a const char*" This reverts commit af91f717c43bc895905b7976528fe505c6a49615. This commit stupidely uses static_cast instead of reinterpret_cast, which breaks the compilation. --- diff --git a/xml-tree.cpp b/xml-tree.cpp index d6b54e8..b33383e 100644 --- a/xml-tree.cpp +++ b/xml-tree.cpp @@ -399,9 +399,9 @@ int32_t xml_tree::text_id(xml_tree::node_t x) const return (int32_t) text_positions->rank1(x) - 1; } -const char* xml_tree::get_text(int32_t id) const +unsigned char* xml_tree::get_text(int32_t id) const { - const char * s = static_cast(text_collection->GetText(id)); + unsigned char * s = text_collection->GetText(id); return s + (s[0] == 1); }