diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-30 19:28:16 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-30 19:28:53 -0400 |
commit | 6213dc5af8b365cde2495fddaa465b0427779d00 (patch) | |
tree | 8d2f2c88e9931608f1605b98dddb6b25f939d4ac | |
parent | 676e7bcf4fd9e2130c2f2ab62656a858bfd4bd0d (diff) | |
download | fork-ledger-6213dc5af8b365cde2495fddaa465b0427779d00.tar.gz fork-ledger-6213dc5af8b365cde2495fddaa465b0427779d00.tar.bz2 fork-ledger-6213dc5af8b365cde2495fddaa465b0427779d00.zip |
Whitespace fix.
-rw-r--r-- | src/amount.h | 4 | ||||
-rw-r--r-- | src/balpair.h | 8 | ||||
-rw-r--r-- | src/commodity.cc | 6 | ||||
-rw-r--r-- | src/textual.cc | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/amount.h b/src/amount.h index 2285591a..ba7d1c07 100644 --- a/src/amount.h +++ b/src/amount.h @@ -2,8 +2,8 @@ * Copyright (c) 2003-2009, John Wiegley. All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: + * modification, are permitted provided that the following conditions + * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. diff --git a/src/balpair.h b/src/balpair.h index 90103c1e..6777edb7 100644 --- a/src/balpair.h +++ b/src/balpair.h @@ -213,16 +213,14 @@ public: return *this; } - balance_pair_t& add(const amount_t& amt, - const optional<amount_t>& a_cost = none) { + balance_pair_t& add(const amount_t& amt, + const optional<amount_t>& a_cost = none) + { if (a_cost && ! cost) cost = quantity(); - *this += amt; - if (cost) *cost += a_cost ? *a_cost : amt; - return *this; } diff --git a/src/commodity.cc b/src/commodity.cc index d9e71ab3..5d993d9e 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -501,8 +501,8 @@ commodity_t::exchange(const amount_t& amount, breakdown.basis_cost = breakdown.final_cost; breakdown.amount = - amount_t(amount, annotation_t (per_unit_cost, moment ? - moment->date() : optional<date_t>(), tag)); + amount_t(amount, annotation_t(per_unit_cost, moment ? + moment->date() : optional<date_t>(), tag)); return breakdown; } @@ -633,6 +633,7 @@ void annotation_t::parse(std::istream& in) temp.parse(buf, amount_t::PARSE_NO_MIGRATE); temp.in_place_reduce(); +#ifdef INTEGER_MATH // Since this price will maintain its own precision, make sure // it is at least as large as the base commodity, since the user // may have only specified {$1} or something similar. @@ -640,6 +641,7 @@ void annotation_t::parse(std::istream& in) if (temp.has_commodity() && temp.precision() < temp.commodity().precision()) temp = temp.round(); // no need to retain individual precision +#endif price = temp; } diff --git a/src/textual.cc b/src/textual.cc index 1cf85a23..55e13445 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -828,11 +828,11 @@ xact_t * textual_parser_t::instance_t::parse_xact(char * line, per_unit_cost, datetime_t(*xact->date())); DEBUG("textual.parse", "line " << linenum << ": " << - "Total cost is " << *xact->cost); + "Total cost is " << *xact->cost); DEBUG("textual.parse", "line " << linenum << ": " << - "Per-unit cost is " << per_unit_cost); + "Per-unit cost is " << per_unit_cost); DEBUG("textual.parse", "line " << linenum << ": " << - "Annotated amount is " << xact->amount); + "Annotated amount is " << xact->amount); } } } |