summaryrefslogtreecommitdiff
path: root/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-09-03 18:40:28 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:33 -0400
commitf261d82df511d1ca3efb69ec0b6422ec862ffeb2 (patch)
treee8f2eab1947447944344161bbab25c1a1a6ad3fa /value.cc
parent4691e7ac8e7cdf7e7823327f3caf52829e383cb7 (diff)
downloadfork-ledger-f261d82df511d1ca3efb69ec0b6422ec862ffeb2.tar.gz
fork-ledger-f261d82df511d1ca3efb69ec0b6422ec862ffeb2.tar.bz2
fork-ledger-f261d82df511d1ca3efb69ec0b6422ec862ffeb2.zip
*** empty log message ***
Diffstat (limited to 'value.cc')
-rw-r--r--value.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/value.cc b/value.cc
index 6f1f3ad7..dba1798b 100644
--- a/value.cc
+++ b/value.cc
@@ -35,13 +35,13 @@ void value_t::simplify()
DEBUG_PRINT("amounts.values.simplify", "Reducing balance pair to balance");
cast(BALANCE);
}
-
+
if (type == BALANCE &&
((balance_t *) data)->amounts.size() == 1) {
DEBUG_PRINT("amounts.values.simplify", "Reducing balance to amount");
cast(AMOUNT);
- }
-
+ }
+
if (type == AMOUNT &&
! ((amount_t *) data)->commodity()) {
DEBUG_PRINT("amounts.values.simplify", "Reducing amount to integer");
@@ -97,7 +97,7 @@ value_t& value_t::operator+=(const value_t& value)
throw new value_error("Cannot add a boolean to a value");
else if (value.type == DATETIME)
throw new value_error("Cannot add a date/time to a value");
-
+
switch (type) {
case BOOLEAN:
throw new value_error("Cannot add a value to a boolean");
@@ -235,7 +235,7 @@ value_t& value_t::operator-=(const value_t& value)
throw new value_error("Cannot subtract a boolean from a value");
else if (value.type == DATETIME && type != DATETIME)
throw new value_error("Cannot subtract a date/time from a value");
-
+
switch (type) {
case BOOLEAN:
throw new value_error("Cannot subtract a value from a boolean");
@@ -382,7 +382,7 @@ value_t& value_t::operator*=(const value_t& value)
throw new value_error("Cannot multiply a boolean by a value");
else if (value.type == DATETIME)
throw new value_error("Cannot multiply a date/time by a value");
-
+
if (value.realzero()) {
*this = 0L;
return *this;
@@ -491,7 +491,7 @@ value_t& value_t::operator/=(const value_t& value)
throw new value_error("Cannot divide a boolean by a value");
else if (value.type == DATETIME)
throw new value_error("Cannot divide a date/time by a value");
-
+
switch (type) {
case BOOLEAN:
throw new value_error("Cannot divide a value by a boolean");