From: Paul Eggert Date: Fri, 22 Oct 2004 23:08:33 +0000 (+0000) Subject: (goto_map, ngotos, from_state, to_state): Omit X-Git-Tag: BISON-2_0~84 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/4cf44c004591323a8a247680046404c6faf99765 (goto_map, ngotos, from_state, to_state): Omit initial values, since they're never used. (set_goto_map): ngotos is now unsigned, so test for overflow --- diff --git a/src/lalr.c b/src/lalr.c index b66e9c3f..313bbbda 100644 --- a/src/lalr.c +++ b/src/lalr.c @@ -42,10 +42,10 @@ #include "relation.h" #include "symtab.h" -goto_number *goto_map = NULL; -static goto_number ngotos = 0; -state_number *from_state = NULL; -state_number *to_state = NULL; +goto_number *goto_map; +static goto_number ngotos; +state_number *from_state; +state_number *to_state; /* Linked list of goto numbers. */ typedef struct goto_list @@ -90,9 +90,9 @@ set_goto_map (void) int i; for (i = sp->num - 1; i >= 0 && TRANSITION_IS_GOTO (sp, i); --i) { - if (ngotos >= GOTO_NUMBER_MAXIMUM) - abort (); ngotos++; + if (! ngotos) + abort (); goto_map[TRANSITION_SYMBOL (sp, i) - ntokens]++; } }