summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-13 23:41:39 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 05:48:44 -0400
commite13d0172554929858f4e0143583f0d50f413ef83 (patch)
tree20d8b2a2c80b51a7f074775d987bc8a821714c0e
parentd0158a80eac5fe3c400c83daaa54c499617741f1 (diff)
downloadfork-ledger-e13d0172554929858f4e0143583f0d50f413ef83.tar.gz
fork-ledger-e13d0172554929858f4e0143583f0d50f413ef83.tar.bz2
fork-ledger-e13d0172554929858f4e0143583f0d50f413ef83.zip
(DEF_VALUE_CMP_OP): Convert amounts to balance and balance_pair when
comparing with those types.
-rw-r--r--value.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/value.cc b/value.cc
index 2af9ecf6..675e265a 100644
--- a/value.cc
+++ b/value.cc
@@ -373,14 +373,12 @@ bool value_t::operator OP(const value_t& value) \
return *((amount_t *) data) OP *((amount_t *) value.data); \
\
case BALANCE: \
- return (*((amount_t *) data) OP \
- ((balance_t *) value.data)-> \
- amount(((amount_t *) data)->commodity())); \
+ return (balance_t(*((amount_t *) data)) OP \
+ *((balance_t *) value.data)); \
\
case BALANCE_PAIR: \
- return (*((amount_t *) data) OP \
- ((balance_pair_t *) value.data)-> \
- quantity.amount(((amount_t *) data)->commodity())); \
+ return (balance_pair_t(*((amount_t *) data)) OP \
+ *((balance_pair_t *) value.data)); \
\
default: \
assert(0); \