X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f499b06243dfe7d6387c9413411601cd5c20dd2c..ec2da99ffe7140db191d6683c493ad6936174311:/src/output.c diff --git a/src/output.c b/src/output.c index 1b10c120..34ff7d36 100644 --- a/src/output.c +++ b/src/output.c @@ -133,10 +133,8 @@ get_lines_number (const char *s) size_t i; for (i = 0; s[i]; ++i) - { - if (s[i] == '\n') - ++lines; - } + if (s[i] == '\n') + ++lines; return lines; } @@ -328,7 +326,6 @@ action_row (state_t *state) int i; int default_rule = 0; reductions *redp = state->reductions; - int nreds = redp ? redp->nreds : 0; shifts *shiftp = state->shifts; errs *errp = state->errs; /* set nonzero to inhibit having any default reduction */ @@ -337,7 +334,7 @@ action_row (state_t *state) for (i = 0; i < ntokens; i++) actrow[i] = 0; - if (nreds >= 1) + if (redp->nreds >= 1) { int j; /* loop over all the rules available here which require @@ -377,17 +374,16 @@ action_row (state_t *state) /* See which tokens are an explicit error in this state (due to %nonassoc). For them, record MINSHORT as the action. */ - if (errp) - for (i = 0; i < errp->nerrs; i++) - { - int symbol = errp->errs[i]; - actrow[symbol] = MINSHORT; - } + for (i = 0; i < errp->nerrs; i++) + { + int symbol = errp->errs[i]; + actrow[symbol] = MINSHORT; + } /* Now find the most common reduction and make it the default action for this state. */ - if (nreds >= 1 && !nodefault) + if (redp->nreds >= 1 && !nodefault) { if (state->consistent) default_rule = redp->rules[0]; @@ -905,9 +901,9 @@ output_actions (void) for (i = 0; i < nstates; ++i) { - XFREE (state_table[i]->shifts); + free (state_table[i]->shifts); XFREE (state_table[i]->reductions); - XFREE (state_table[i]->errs); + free (state_table[i]->errs); free (state_table[i]); } XFREE (state_table); @@ -1128,6 +1124,5 @@ output (void) obstack_free (&muscle_obstack, NULL); obstack_free (&format_obstack, NULL); obstack_free (&action_obstack, NULL); - obstack_free (&guard_obstack, NULL); obstack_free (&attrs_obstack, NULL); }