summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-20 23:08:42 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-20 23:12:23 -0400
commitfc349389e3f074ae2ce22b93f3833f063f548a8f (patch)
treeb235bf0a9b6ca21aac1bcd56c8462f5570202723 /src
parent96ff798736cd06812fb7e463c14d6c356c8228e3 (diff)
downloadfork-ledger-fc349389e3f074ae2ce22b93f3833f063f548a8f.tar.gz
fork-ledger-fc349389e3f074ae2ce22b93f3833f063f548a8f.tar.bz2
fork-ledger-fc349389e3f074ae2ce22b93f3833f063f548a8f.zip
Restored the --budget option
Diffstat (limited to 'src')
-rw-r--r--src/amount.h6
-rw-r--r--src/balance.cc2
-rw-r--r--src/entry.cc6
-rw-r--r--src/filters.cc8
-rw-r--r--src/op.cc2
-rw-r--r--src/value.h4
6 files changed, 14 insertions, 14 deletions
diff --git a/src/amount.h b/src/amount.h
index a20b46b1..730d3569 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -291,7 +291,7 @@ public:
/** Returns the negated value of an amount.
@see operator-()
*/
- amount_t negate() const {
+ amount_t negated() const {
amount_t temp(*this);
temp.in_place_negate();
return temp;
@@ -299,7 +299,7 @@ public:
void in_place_negate();
amount_t operator-() const {
- return negate();
+ return negated();
}
/** Returns the absolute value of an amount. Equivalent to:
@@ -309,7 +309,7 @@ public:
*/
amount_t abs() const {
if (sign() < 0)
- return negate();
+ return negated();
return *this;
}
diff --git a/src/balance.cc b/src/balance.cc
index 92a6c767..b8009607 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -81,7 +81,7 @@ balance_t& balance_t::operator-=(const amount_t& amt)
if (i->second.is_realzero())
amounts.erase(i);
} else {
- amounts.insert(amounts_map::value_type(&amt.commodity(), amt.negate()));
+ amounts.insert(amounts_map::value_type(&amt.commodity(), amt.negated()));
}
return *this;
}
diff --git a/src/entry.cc b/src/entry.cc
index ffcd3a51..a07481f1 100644
--- a/src/entry.cc
+++ b/src/entry.cc
@@ -140,16 +140,16 @@ bool entry_base_t::finalize()
const balance_t& bal(balance.as_balance());
foreach (const balance_t::amounts_map::value_type& pair, bal.amounts) {
if (first) {
- null_xact->amount = pair.second.negate();
+ null_xact->amount = pair.second.negated();
first = false;
} else {
- add_xact(new xact_t(null_xact->account, pair.second.negate(),
+ add_xact(new xact_t(null_xact->account, pair.second.negated(),
ITEM_GENERATED));
}
}
}
else if (balance.is_amount()) {
- null_xact->amount = balance.as_amount().negate();
+ null_xact->amount = balance.as_amount().negated();
null_xact->add_flags(XACT_CALCULATED);
}
else if (! balance.is_null() && ! balance.is_realzero()) {
diff --git a/src/filters.cc b/src/filters.cc
index 0e719037..0bb4cf98 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -215,11 +215,11 @@ void invert_xacts::operator()(xact_t& xact)
{
if (xact.has_xdata() &&
xact.xdata().has_flags(XACT_EXT_COMPOUND)) {
- xact.xdata().value.negate();
+ xact.xdata().value.in_place_negate();
} else {
- xact.amount.negate();
+ xact.amount.in_place_negate();
if (xact.cost)
- xact.cost->negate();
+ xact.cost->in_place_negate();
}
item_handler<xact_t>::operator()(xact);
@@ -705,7 +705,7 @@ void budget_xacts::report_budget_items(const date_t& date)
xact_t& temp = xact_temps.back();
temp.entry = &entry;
temp.add_flags(XACT_AUTO | ITEM_TEMP);
- temp.amount.negate();
+ temp.amount.in_place_negate();
entry.add_xact(&temp);
begin = pair.first.increment(begin);
diff --git a/src/op.cc b/src/op.cc
index 7dbbf3a2..389baf38 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -234,7 +234,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus)
break;
case O_NEG:
- result = left()->calc(scope, locus).negate();
+ result = left()->calc(scope, locus).negated();
break;
case O_NOT:
diff --git a/src/value.h b/src/value.h
index e3190ef4..3a052fb2 100644
--- a/src/value.h
+++ b/src/value.h
@@ -391,7 +391,7 @@ public:
/**
* Unary arithmetic operators.
*/
- value_t negate() const {
+ value_t negated() const {
value_t temp = *this;
temp.in_place_negate();
return temp;
@@ -400,7 +400,7 @@ public:
void in_place_not(); // exists for efficiency's sake
value_t operator-() const {
- return negate();
+ return negated();
}
value_t abs() const;