]> git.saurik.com Git - bison.git/blobdiff - src/output.c
* configure.in: Check the protos of strchr ans strspn.
[bison.git] / src / output.c
index dfbfbb501369a7774d4017425615f64b23bfb0aa..34ff7d36551e6bf32c7551def2ff78eca1f209d0 100644 (file)
@@ -326,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 */
@@ -335,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
@@ -375,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];
@@ -903,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);