diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-13 08:39:12 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:30 -0400 |
commit | 82d0ee869be4636fb285f7fc61620ecd747f46f9 (patch) | |
tree | e65d7bff14d13e71738d55660a39938c2e4973eb /binary.cc | |
parent | fd525ec3821f16ec3df8096a0080da797f7946c5 (diff) | |
download | fork-ledger-82d0ee869be4636fb285f7fc61620ecd747f46f9.tar.gz fork-ledger-82d0ee869be4636fb285f7fc61620ecd747f46f9.tar.bz2 fork-ledger-82d0ee869be4636fb285f7fc61620ecd747f46f9.zip |
Added --ansi and --ansi-invert options.
Diffstat (limited to 'binary.cc')
-rw-r--r-- | binary.cc | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -455,7 +455,7 @@ inline commodity_t * read_binary_commodity(char *& data) commodity_t * commodity = new commodity_t; *commodities_next++ = commodity; - commodity->ptr = + commodity->base = base_commodities[read_binary_long<commodity_base_t::ident_t>(data) - 1]; read_binary_string(data, commodity->qualified_symbol); @@ -469,13 +469,13 @@ inline commodity_t * read_binary_commodity_annotated(char *& data) annotated_commodity_t * commodity = new annotated_commodity_t; *commodities_next++ = commodity; - commodity->ptr = + commodity->base = base_commodities[read_binary_long<commodity_base_t::ident_t>(data) - 1]; read_binary_string(data, commodity->qualified_symbol); commodity->annotated = true; - commodity->base = + commodity->ptr = commodities[read_binary_long<commodity_t::ident_t>(data) - 1]; read_binary_amount(data, commodity->price); read_binary_long(data, commodity->date); @@ -658,7 +658,7 @@ unsigned int read_binary_journal(std::istream& in, if (read_binary_number<char>(data) == 0) { commodity = read_binary_commodity(data); - mapping_key = commodity->ptr->symbol; + mapping_key = commodity->base->symbol; } else { read_binary_string(data, mapping_key); commodity = read_binary_commodity_annotated(data); @@ -677,7 +677,7 @@ unsigned int read_binary_journal(std::istream& in, commodity)); if (! result.second && commodity->annotated) throw new error(std::string("Failed to read commodity from cache: ") + - commodity->ptr->symbol); + commodity->base->symbol); } commodity_t::ident_t ident; @@ -1005,7 +1005,7 @@ void write_binary_commodity(std::ostream& out, commodity_t * commodity) { commodity->ident = ++commodity_index; - write_binary_long(out, commodity->ptr->ident); + write_binary_long(out, commodity->base->ident); write_binary_string(out, commodity->qualified_symbol); } @@ -1014,7 +1014,7 @@ void write_binary_commodity_annotated(std::ostream& out, { commodity->ident = ++commodity_index; - write_binary_long(out, commodity->ptr->ident); + write_binary_long(out, commodity->base->ident); write_binary_string(out, commodity->qualified_symbol); annotated_commodity_t * ann_comm = |