From 4cf44c004591323a8a247680046404c6faf99765 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Oct 2004 23:08:33 +0000 Subject: [PATCH] (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 --- src/lalr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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]++; } } -- 2.45.2