X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/a737b2163c275761f32589bf7c249016452bb730..e342c3beaf9d73616e8ff6fe005b97f3a72c0476:/src/nullable.c diff --git a/src/nullable.c b/src/nullable.c index cf6cfd68..d65c4f2b 100644 --- a/src/nullable.c +++ b/src/nullable.c @@ -1,7 +1,7 @@ /* Calculate which nonterminals can expand into the null string for Bison. - Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software - Foundation, Inc. + Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004 Free + Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -62,7 +62,7 @@ nullable_compute (void) rule_list *p; symbol_number *squeue = CALLOC (squeue, nvars); - short *rcount = CALLOC (rcount, nrules); + short int *rcount = CALLOC (rcount, nrules); /* RITEM contains all the rules, including useless productions. Hence we must allocate room for useless nonterminals too. */ rule_list **rsets = CALLOC (rsets, nvars); @@ -83,10 +83,10 @@ nullable_compute (void) { /* This rule has a non empty RHS. */ item_number *rp = NULL; - int any_tokens = 0; + bool any_tokens = false; for (rp = rules_ruleno->rhs; *rp >= 0; ++rp) if (ISTOKEN (*rp)) - any_tokens = 1; + any_tokens = true; /* This rule has only nonterminals: schedule it for the second pass. */ @@ -108,7 +108,7 @@ nullable_compute (void) if (rules_ruleno->useful && ! nullable[rules_ruleno->lhs->number - ntokens]) { - nullable[rules_ruleno->lhs->number - ntokens] = 1; + nullable[rules_ruleno->lhs->number - ntokens] = true; *s2++ = rules_ruleno->lhs->number; } } @@ -121,7 +121,7 @@ nullable_compute (void) if (--rcount[r->number] == 0) if (r->useful && ! nullable[r->lhs->number - ntokens]) { - nullable[r->lhs->number - ntokens] = 1; + nullable[r->lhs->number - ntokens] = true; *s2++ = r->lhs->number; } }