Removed unused variables

This commit is contained in:
John Wiegley 2011-08-18 14:46:36 -04:00
parent bed70c8670
commit add6f6ca2a
7 changed files with 8 additions and 28 deletions

View file

@ -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)

View file

@ -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

View file

@ -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;

View file

@ -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':

View file

@ -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

View file

@ -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;

View file

@ -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);