mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 00:03:03 +00:00
address unused variables
Reported by recent versions of clang. * src/counterexample.c (search_state_prepend): Use complexity_cost. * src/print.c: Remove useless variable.
This commit is contained in:
@@ -890,11 +890,11 @@ search_state_prepend (search_state *ss, symbol_number sym, bitset guide)
|
|||||||
gl_list_free (prev);
|
gl_list_free (prev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The parse state heads are either both production items or both
|
// The parse state heads are either both production items or both
|
||||||
// transition items. So all prepend options will either be
|
// transition items. So all prepend options will either be
|
||||||
// reverse transitions or reverse productions
|
// reverse transitions or reverse productions
|
||||||
int complexity_cost = prod1 ? PRODUCTION_COST : UNSHIFT_COST;
|
const int complexity_cost = 2 * (prod1 ? PRODUCTION_COST : UNSHIFT_COST);
|
||||||
complexity_cost *= 2;
|
|
||||||
|
|
||||||
parse_state_list prev1 = parser_prepend (ss->states[0]);
|
parse_state_list prev1 = parser_prepend (ss->states[0]);
|
||||||
parse_state_list prev2 = parser_prepend (ss->states[1]);
|
parse_state_list prev2 = parser_prepend (ss->states[1]);
|
||||||
@@ -926,11 +926,7 @@ search_state_prepend (search_state *ss, symbol_number sym, bitset guide)
|
|||||||
if (psi1->state != psi2->state)
|
if (psi1->state != psi2->state)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int complexity = ss->complexity;
|
int complexity = ss->complexity + complexity_cost;
|
||||||
if (prod1)
|
|
||||||
complexity += PRODUCTION_COST * 2;
|
|
||||||
else
|
|
||||||
complexity += UNSHIFT_COST * 2;
|
|
||||||
// penalty for not being along the guide path
|
// penalty for not being along the guide path
|
||||||
if (!guided1 || !guided2)
|
if (!guided1 || !guided2)
|
||||||
complexity += EXTENDED_COST;
|
complexity += EXTENDED_COST;
|
||||||
|
|||||||
@@ -419,11 +419,9 @@ print_nonterminal_symbols (FILE *out)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int column = 4 + mbswidth (tag, 0);
|
|
||||||
fprintf (out, "%4s%s", "", tag);
|
fprintf (out, "%4s%s", "", tag);
|
||||||
if (sym->content->type_name)
|
if (sym->content->type_name)
|
||||||
column += fprintf (out, " <%s>",
|
fprintf (out, " <%s>", sym->content->type_name);
|
||||||
sym->content->type_name);
|
|
||||||
fprintf (out, " (%d)\n", i);
|
fprintf (out, " (%d)\n", i);
|
||||||
|
|
||||||
if (on_left)
|
if (on_left)
|
||||||
|
|||||||
Reference in New Issue
Block a user