summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-19 22:24:56 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-19 22:24:56 -0400
commitd9197fc2e5e5283d114ef9a1821d200b56529428 (patch)
tree14e38e5f0f29e3b85f085619ff3acb9f247e2ec1 /src
parent14b3eb89f58301ecd21489ad380eb533d22a4c71 (diff)
downloadfork-ledger-d9197fc2e5e5283d114ef9a1821d200b56529428.tar.gz
fork-ledger-d9197fc2e5e5283d114ef9a1821d200b56529428.tar.bz2
fork-ledger-d9197fc2e5e5283d114ef9a1821d200b56529428.zip
Changed COMMODITY_STYLE_NOMARKET TO COMMODITY_NOMARKET.
Diffstat (limited to 'src')
-rw-r--r--src/amount.cc4
-rw-r--r--src/commodity.cc11
-rw-r--r--src/commodity.h2
-rw-r--r--src/iterators.cc2
-rw-r--r--src/textual.cc2
5 files changed, 12 insertions, 9 deletions
diff --git a/src/amount.cc b/src/amount.cc
index fd1fc023..53c1a0bf 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -130,7 +130,7 @@ void amount_t::initialize()
// Add time commodity conversions, so that timelog's may be parsed
// in terms of seconds, but reported as minutes or hours.
if (commodity_t * commodity = current_pool->create("s")) {
- commodity->add_flags(COMMODITY_BUILTIN | COMMODITY_STYLE_NOMARKET);
+ commodity->add_flags(COMMODITY_BUILTIN | COMMODITY_NOMARKET);
parse_conversion("1.0m", "60s");
parse_conversion("1.0h", "60m");
@@ -1043,7 +1043,7 @@ void amount_t::parse_conversion(const string& larger_str,
if (larger.commodity()) {
larger.commodity().set_smaller(smaller);
larger.commodity().add_flags(smaller.commodity().flags() |
- COMMODITY_STYLE_NOMARKET);
+ COMMODITY_NOMARKET);
}
if (smaller.commodity())
smaller.commodity().set_larger(larger);
diff --git a/src/commodity.cc b/src/commodity.cc
index 113c1538..515b3946 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -183,7 +183,7 @@ optional<price_point_t>
}
#if 0
- if (! has_flags(COMMODITY_STYLE_NOMARKET) && parent().get_quote) {
+ if (! has_flags(COMMODITY_NOMARKET) && parent().get_quote) {
if (optional<amount_t> quote = parent().get_quote
(*this, age, moment,
(hist && hist->prices.size() > 0 ?
@@ -390,7 +390,10 @@ void commodity_t::exchange(commodity_t& commodity,
const amount_t& per_unit_cost,
const datetime_t& moment)
{
- if (! commodity.has_flags(COMMODITY_STYLE_NOMARKET)) {
+ if (! commodity.has_flags(COMMODITY_NOMARKET)) {
+ DEBUG("commodity.prices", "exchanging commodity " << commodity
+ << " at per unit cost " << per_unit_cost << " on " << moment);
+
commodity_t& base_commodity
(commodity.annotated ?
as_annotated_commodity(commodity).referent() : commodity);
@@ -439,7 +442,7 @@ commodity_t::exchange(const amount_t& amount,
// (if (and moment (not (commodity-no-market-price-p base-commodity)))
// (add-price base-commodity per-unit-cost moment))
- if (moment && ! commodity.has_flags(COMMODITY_STYLE_NOMARKET))
+ if (moment && ! commodity.has_flags(COMMODITY_NOMARKET))
base_commodity.add_price(*moment, per_unit_cost);
// ;; returns: ANNOTATED-AMOUNT TOTAL-COST BASIS-COST
@@ -759,7 +762,7 @@ commodity_pool_t::commodity_pool_t() : default_commodity(NULL)
{
TRACE_CTOR(commodity_pool_t, "");
null_commodity = create("");
- null_commodity->add_flags(COMMODITY_BUILTIN | COMMODITY_STYLE_NOMARKET);
+ null_commodity->add_flags(COMMODITY_BUILTIN | COMMODITY_NOMARKET);
}
commodity_t * commodity_pool_t::create(const string& symbol)
diff --git a/src/commodity.h b/src/commodity.h
index c97ca569..8a3e2844 100644
--- a/src/commodity.h
+++ b/src/commodity.h
@@ -136,7 +136,7 @@ public:
#define COMMODITY_STYLE_SEPARATED 0x02
#define COMMODITY_STYLE_EUROPEAN 0x04
#define COMMODITY_STYLE_THOUSANDS 0x08
-#define COMMODITY_STYLE_NOMARKET 0x10
+#define COMMODITY_NOMARKET 0x10
#define COMMODITY_BUILTIN 0x20
#define COMMODITY_WALKED 0x40
diff --git a/src/iterators.cc b/src/iterators.cc
index 34beba7e..da5265a9 100644
--- a/src/iterators.cc
+++ b/src/iterators.cc
@@ -169,7 +169,7 @@ void walk_commodities(commodity_pool_t::commodities_by_ident& commodities,
i = commodities.begin();
i != commodities.end();
i++) {
- if ((*i)->has_flags(COMMODITY_STYLE_NOMARKET))
+ if ((*i)->has_flags(COMMODITY_NOMARKET))
continue;
entry_temps.push_back(entry_t());
diff --git a/src/textual.cc b/src/textual.cc
index dd23c7b5..ce1db3a3 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -835,7 +835,7 @@ unsigned int textual_parser_t::parse(std::istream& in,
if (commodity_t * commodity =
amount_t::current_pool->find_or_create(symbol))
- commodity->add_flags(COMMODITY_STYLE_NOMARKET);
+ commodity->add_flags(COMMODITY_NOMARKET);
break;
}