summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--balance.h3
-rw-r--r--value.cc12
2 files changed, 7 insertions, 8 deletions
diff --git a/balance.h b/balance.h
index d373743f..5b4a0d2a 100644
--- a/balance.h
+++ b/balance.h
@@ -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() {
diff --git a/value.cc b/value.cc
index e87a99a6..431dca19 100644
--- a/value.cc
+++ b/value.cc
@@ -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); \