From e13d0172554929858f4e0143583f0d50f413ef83 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 13 Mar 2006 23:41:39 +0000 Subject: (DEF_VALUE_CMP_OP): Convert amounts to balance and balance_pair when comparing with those types. --- value.cc | 10 ++++------ 1 file 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); \ -- cgit v1.2.3