summaryrefslogtreecommitdiff
path: root/src/amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-20 02:10:40 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-20 02:10:40 -0500
commit22505d9527edce59cd3cf90c5241e4bd809eb8a2 (patch)
treed943b2dba416a9fbe8619e02a293dfd854fd0869 /src/amount.h
parentdf11ecbbd733068284a19369949bcaa20b0e6e76 (diff)
downloadfork-ledger-22505d9527edce59cd3cf90c5241e4bd809eb8a2.tar.gz
fork-ledger-22505d9527edce59cd3cf90c5241e4bd809eb8a2.tar.bz2
fork-ledger-22505d9527edce59cd3cf90c5241e4bd809eb8a2.zip
Always call TRACE_CTOR at the end of constructors
Diffstat (limited to 'src/amount.h')
-rw-r--r--src/amount.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/amount.h b/src/amount.h
index 903a01cd..10e83552 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -155,17 +155,17 @@ public:
commodity_t::null_commodity. The number may be of infinite
precision. */
explicit amount_t(const string& val) : quantity(NULL) {
- TRACE_CTOR(amount_t, "const string&");
parse(val);
+ TRACE_CTOR(amount_t, "const string&");
}
/** Parse a pointer to a C string as an (optionally commoditized)
amount. If no commodity is present, the resulting commodity is \c
commodity_t::null_commodity. The number may be of infinite
precision. */
explicit amount_t(const char * val) : quantity(NULL) {
- TRACE_CTOR(amount_t, "const char *");
assert(val);
parse(val);
+ TRACE_CTOR(amount_t, "const char *");
}
/*@}*/
@@ -195,21 +195,21 @@ public:
same memory used by the original via reference counting. The \c
amount_t::bigint_t class in amount.cc maintains the reference. */
amount_t(const amount_t& amt) : quantity(NULL) {
- TRACE_CTOR(amount_t, "copy");
if (amt.quantity)
_copy(amt);
else
commodity_ = NULL;
+ TRACE_CTOR(amount_t, "copy");
}
/** Copy an amount object, applying the given commodity annotation
details afterward. This is equivalent to doing a normal copy
(@see amount_t(const amount_t&)) and then calling
amount_t::annotate(). */
amount_t(const amount_t& amt, const annotation_t& details) : quantity(NULL) {
- TRACE_CTOR(amount_t, "const amount_t&, const annotation_t&");
assert(amt.quantity);
_copy(amt);
annotate(details);
+ TRACE_CTOR(amount_t, "const amount_t&, const annotation_t&");
}
/** Assign an amount object. This is like copying if the amount was
null beforehand, otherwise the previous value's reference is must