Remove uses of 'short int' and 'unsigned short int' in the parser generators.

* src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
Use size_t, not int or short int, to count objects.
* src/closure.c (nritemset, closure): Likewise.
* src/closure.h (nritemset, closure): Likewise.
* src/nullable.c (nullable_compute): Likewise.
* src/print.c (print_core): Likewise.
* src/print_graph.c (print_core): Likewise.
* src/state.c (state_compare, state_hash): Likewise.
* src/state.h (struct state): Likewise.
* src/tables.c (default_goto, goto_actions): Likewise.

* src/gram.h (rule_number, rule): Use int, not short int.
* src/output.c (prepare_rules): Likewise.
* src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
errs, reductions): Likewise.
* src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
Likewise.
* src/tables.c (vector_number, tally, action_number,
ACTION_NUMBER_MINIMUM): Likewise.
* src/output.c (muscle_insert_short_int_table): Remove.
This commit is contained in:
Paul Eggert
2004-12-17 20:29:19 +00:00
parent efeed02327
commit f6fbd3da9d
13 changed files with 75 additions and 41 deletions

View File

@@ -105,9 +105,9 @@ allocate_itemsets (void)
Note that useless productions (hence useless nonterminals) are
browsed too, hence we need to allocate room for _all_ the
symbols. */
int count = 0;
short int *symbol_count = xcalloc (nsyms + nuseless_nonterminals,
sizeof *symbol_count);
size_t count = 0;
size_t *symbol_count = xcalloc (nsyms + nuseless_nonterminals,
sizeof *symbol_count);
for (r = 0; r < nrules; ++r)
for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)
@@ -178,7 +178,7 @@ free_storage (void)
static void
new_itemsets (state *s)
{
int i;
size_t i;
if (trace_flag & trace_automaton)
fprintf (stderr, "Entering new_itemsets, state = %d\n", s->number);
@@ -274,7 +274,7 @@ static void
save_reductions (state *s)
{
int count = 0;
int i;
size_t i;
/* Find and count the active items that represent ends of rules. */
for (i = 0; i < nritemset; ++i)