diff options
-rw-r--r-- | balance.h | 3 | ||||
-rw-r--r-- | value.cc | 12 |
2 files changed, 7 insertions, 8 deletions
@@ -463,8 +463,7 @@ class balance_pair_t balance_pair_t(const amount_t& _quantity) : quantity(_quantity), cost(NULL) {} template <typename T> - balance_pair_t(T value) - : quantity(value), cost(NULL) {} + balance_pair_t(T value) : quantity(value), cost(NULL) {} // destructor ~balance_pair_t() { @@ -236,16 +236,16 @@ bool value_t::operator OP(const value_t& value) \ *((unsigned int *) value.data)); \ \ case AMOUNT: \ - return (*((unsigned int *) data) OP \ - ((unsigned int) *((amount_t *) value.data))); \ + return (amount_t(*((unsigned int *) data)) OP \ + *((amount_t *) value.data)); \ \ case BALANCE: \ - return (*((unsigned int *) data) OP \ - ((unsigned int) *((balance_t *) value.data))); \ + return (balance_t(*((unsigned int *) data)) OP \ + *((balance_t *) value.data)); \ \ case BALANCE_PAIR: \ - return (*((unsigned int *) data) OP \ - ((unsigned int) *((balance_pair_t *) value.data))); \ + return (balance_pair_t(*((unsigned int *) data)) OP \ + *((balance_pair_t *) value.data)); \ \ default: \ assert(0); \ |