diff options
author | John Wiegley <johnw@newartisans.com> | 2011-08-18 14:46:36 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2011-08-18 14:46:36 -0400 |
commit | add6f6ca2a711e3337f83bd15be5a03e22842591 (patch) | |
tree | 7d0735ef510319f1eda492c5d3876bc063eefde5 | |
parent | bed70c8670cd328447f61439832ffc7b3a7affb4 (diff) | |
download | fork-ledger-add6f6ca2a711e3337f83bd15be5a03e22842591.tar.gz fork-ledger-add6f6ca2a711e3337f83bd15be5a03e22842591.tar.bz2 fork-ledger-add6f6ca2a711e3337f83bd15be5a03e22842591.zip |
Removed unused variables
-rw-r--r-- | src/amount.cc | 6 | ||||
-rw-r--r-- | src/draft.cc | 10 | ||||
-rw-r--r-- | src/filters.cc | 2 | ||||
-rw-r--r-- | src/query.cc | 1 | ||||
-rw-r--r-- | src/report.cc | 6 | ||||
-rw-r--r-- | src/textual.cc | 6 | ||||
-rw-r--r-- | src/times.cc | 5 |
7 files changed, 8 insertions, 28 deletions
diff --git a/src/amount.cc b/src/amount.cc index 1dc160cc..bc7e9918 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -1049,16 +1049,12 @@ bool amount_t::parse(std::istream& in, const parse_flags_t& flags) // Create the commodity if has not already been seen, and update the // precision if something greater was used for the quantity. - bool newly_created = false; - if (symbol.empty()) { commodity_ = NULL; } else { commodity_ = commodity_pool_t::current_pool->find(symbol); - if (! commodity_) { + if (! commodity_) commodity_ = commodity_pool_t::current_pool->create(symbol); - newly_created = true; - } assert(commodity_); if (details) diff --git a/src/draft.cc b/src/draft.cc index ca2d35df..0cce1d5d 100644 --- a/src/draft.cc +++ b/src/draft.cc @@ -66,16 +66,6 @@ void draft_t::xact_template_t::dump(std::ostream& out) const << _("<Posting copied from last related transaction>") << std::endl; } else { - bool has_only_from = true; - bool has_only_to = true; - - foreach (const post_template_t& post, posts) { - if (post.from) - has_only_to = false; - else - has_only_from = false; - } - foreach (const post_template_t& post, posts) { straccstream accum; out << std::endl diff --git a/src/filters.cc b/src/filters.cc index b7e96366..a08e5d25 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -916,8 +916,6 @@ void interval_posts::report_subtotal(const date_interval_t& interval) void interval_posts::operator()(post_t& post) { - date_t date = post.date(); - if (! interval.find_period(post.date())) return; diff --git a/src/query.cc b/src/query.cc index 2a29a1e7..b93c6534 100644 --- a/src/query.cc +++ b/src/query.cc @@ -127,7 +127,6 @@ query_t::lexer_t::token_t query_t::lexer_t::next_token() // fall through... default: { string ident; - string::const_iterator beg = arg_i; for (; arg_i != arg_end; ++arg_i) { switch (*arg_i) { case '\0': diff --git a/src/report.cc b/src/report.cc index 91b9025d..473308a0 100644 --- a/src/report.cc +++ b/src/report.cc @@ -657,7 +657,8 @@ value_t report_t::fn_quoted(call_scope_t& args) std::ostringstream out; out << '"'; - foreach (const char ch, args.get<string>(0)) { + string arg(args.get<string>(0)); + foreach (const char ch, arg) { if (ch == '"') out << "\\\""; else @@ -672,7 +673,8 @@ value_t report_t::fn_join(call_scope_t& args) { std::ostringstream out; - foreach (const char ch, args.get<string>(0)) { + string arg(args.get<string>(0)); + foreach (const char ch, arg) { if (ch != '\n') out << ch; else diff --git a/src/textual.cc b/src/textual.cc index 6dd0caa6..ecdf53d4 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -1165,11 +1165,7 @@ post_t * instance_t::parse_post(char * line, // Parse the optional amount - bool saw_amount = false; - if (next && *next && (*next != ';' && *next != '=')) { - saw_amount = true; - beg = next - line; ptristream stream(next, len - beg); @@ -1569,6 +1565,7 @@ xact_t * instance_t::parse_xact(char * line, } } +#if 0 if (xact->_state == item_t::UNCLEARED) { item_t::state_t result = item_t::CLEARED; @@ -1582,6 +1579,7 @@ xact_t * instance_t::parse_xact(char * line, } } } +#endif xact->pos->end_pos = curr_pos; xact->pos->end_line = linenum; diff --git a/src/times.cc b/src/times.cc index 5249c11c..851da938 100644 --- a/src/times.cc +++ b/src/times.cc @@ -709,12 +709,9 @@ void date_parser_t::determine_when(date_parser_t::lexer_t::token_t& tok, when += gregorian::years(amount * adjust); break; case lexer_t::token_t::TOK_QUARTER: - case lexer_t::token_t::TOK_QUARTERS: { - date_t temp = - date_duration_t::find_nearest(today, date_duration_t::QUARTERS); + case lexer_t::token_t::TOK_QUARTERS: when += gregorian::months(amount * 3 * adjust); break; - } case lexer_t::token_t::TOK_MONTH: case lexer_t::token_t::TOK_MONTHS: when += gregorian::months(amount * adjust); |