From: Kim Nguyễn Date: Thu, 12 Apr 2012 14:30:54 +0000 (+0200) Subject: Remove suprious debugging macros. X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2FXMLTree.git;a=commitdiff_plain;h=75bcbbef9da31c0e904f3df92022551afb4c571e Remove suprious debugging macros. --- diff --git a/xml-tree-inc.hpp b/xml-tree-inc.hpp index cd8db71..f8ee8b0 100644 --- a/xml-tree-inc.hpp +++ b/xml-tree-inc.hpp @@ -7,17 +7,6 @@ #include -#if 0 -#define ASSERT_NODE(orig, res) do { \ - if (res < -1 || res >= par->n|| (res != -1 && res < orig)) \ - fprintf(stderr, \ - "Assertion failure: original node %i, result %i, line %i\n", \ - orig, res, __LINE__); \ - } while (0) -#else -#define ASSERT_NODE(orig, res) -#endif - inline uint32_t xml_tree::size() const { return tag_seq_len / 2; @@ -100,7 +89,6 @@ inline xml_tree::node_t xml_tree::parent(xml_tree::node_t x) const inline xml_tree::node_t xml_tree::first_child(node_t x) const { xml_tree::node_t result = bp_first_child(this->par, x); - ASSERT_NODE(x, result); return result; } @@ -115,7 +103,6 @@ inline xml_tree::node_t xml_tree::last_child(xml_tree::node_t x) const inline xml_tree::node_t xml_tree::next_sibling(xml_tree::node_t x) const { xml_tree::node_t result = bp_next_sibling(this->par, x); - ASSERT_NODE(x, result); return result; } @@ -185,8 +172,6 @@ inline xml_tree::node_t xml_tree::tagged_child(xml_tree::node_t x, return c; else return tagged_sibling(c, t); - /* ASSERT_NODE(x, result); - return result;*/ } inline xml_tree::node_t xml_tree::tagged_sibling(xml_tree::node_t x, @@ -196,13 +181,10 @@ inline xml_tree::node_t xml_tree::tagged_sibling(xml_tree::node_t x, xml_tree::tag_t stag; while (sibling != xml_tree::NIL) { stag = tag(sibling); - if (stag == t) { - ASSERT_NODE(x, sibling); + if (stag == t) return sibling; - } sibling = next_sibling(sibling); }; - ASSERT_NODE(x, sibling); return sibling; }