diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-13 23:41:39 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 05:48:44 -0400 |
commit | e13d0172554929858f4e0143583f0d50f413ef83 (patch) | |
tree | 20d8b2a2c80b51a7f074775d987bc8a821714c0e | |
parent | d0158a80eac5fe3c400c83daaa54c499617741f1 (diff) | |
download | fork-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.cc | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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); \ |