summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-08 02:53:28 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:40 -0400
commitfa81dc479801ba1343695d66cdb37d8b80bfae9d (patch)
tree835724102a2c99a88d9e67bae71a94ee49e1f674 /src
parentee4a16743960122bf2b626f62827b7332680ebf5 (diff)
downloadfork-ledger-fa81dc479801ba1343695d66cdb37d8b80bfae9d.tar.gz
fork-ledger-fa81dc479801ba1343695d66cdb37d8b80bfae9d.tar.bz2
fork-ledger-fa81dc479801ba1343695d66cdb37d8b80bfae9d.zip
Added target fullcheck.
Diffstat (limited to 'src')
-rw-r--r--src/amount.cc2
-rw-r--r--src/xml.cc12
-rw-r--r--src/xml.h13
3 files changed, 13 insertions, 14 deletions
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);