From fa81dc479801ba1343695d66cdb37d8b80bfae9d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 8 May 2007 02:53:28 +0000 Subject: Added target fullcheck. --- src/amount.cc | 2 +- src/xml.cc | 12 +++--------- src/xml.h | 13 +++++++++---- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/amount.cc b/src/amount.cc index 85ba07f5..274d3001 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -283,7 +283,7 @@ namespace { } if (sign) { - char * newbuf = new char[std::strlen(result ? result : buf) + 1]; + char * newbuf = new char[std::strlen(result ? result : buf) + 2]; newbuf[0] = '-'; std::strcpy(&newbuf[1], result ? result : buf); mpz_set_str(dest, newbuf, 10); diff --git a/src/xml.cc b/src/xml.cc index 219a0162..fbc40560 100644 --- a/src/xml.cc +++ b/src/xml.cc @@ -51,11 +51,6 @@ const char * document_t::ledger_builtins[] = { "transaction" }; -document_t::document_t(node_t * _top) - : stub(this), top(_top ? _top : &stub) { - TRACE_CTOR(xml::document_t, "node_t *, const char **, const int"); -} - document_t::~document_t() { TRACE_DTOR(xml::document_t); @@ -159,10 +154,9 @@ void document_t::print(std::ostream& out) const document_t * node_t::document; #endif -node_t::node_t(document_t * _document, parent_node_t * _parent, - flags_t _flags) - : supports_flags<>(_flags), - name_id(0), parent(_parent), next(NULL), prev(NULL), attrs(NULL) +node_t::node_t(document_t * _document, parent_node_t * _parent, flags_t _flags) + : supports_flags<>(_flags), name_id(0), parent(_parent), + next(NULL), prev(NULL), attrs(NULL) { TRACE_CTOR(node_t, "document_t *, node_t *"); document = _document; diff --git a/src/xml.h b/src/xml.h index 96964975..b11cb86f 100644 --- a/src/xml.h +++ b/src/xml.h @@ -236,18 +236,23 @@ private: names_map names_index; - terminal_node_t stub; - - public: +public: node_t * top; +private: + terminal_node_t stub; + +public: // Ids 0-9 are reserved. 10-999 are for "builtin" names. 1000+ are // for dynamically registered names. enum special_names_t { CURRENT, PARENT, ROOT, ALL }; - document_t(node_t * _top = NULL); + document_t(node_t * _top = NULL) + : top(_top ? _top : &stub), stub(this) { + TRACE_CTOR(xml::document_t, "node_t *, const char **, const int"); + } ~document_t(); void set_top(node_t * _top); -- cgit v1.2.3