]> git.saurik.com Git - bison.git/blobdiff - src/output.c
* src/output.c (output_skeleton): tempdir is const.
[bison.git] / src / output.c
index 998b707eee3f8306541b024b03974863e31f9dde..140f220b59ba7932015bd1e5dacaf8e41858a392 100644 (file)
@@ -89,6 +89,7 @@
    negative short int.  Used to flag ??  */
 
 #include "system.h"
+#include "bitsetv.h"
 #include "quotearg.h"
 #include "error.h"
 #include "getargs.h"
@@ -226,7 +227,7 @@ output_gram (void)
 static void
 output_stos (void)
 {
-  int i;
+  size_t i;
   short *values = (short *) alloca (sizeof (short) * nstates);
   for (i = 0; i < nstates; ++i)
     values[i] = states[i]->accessing_symbol;
@@ -356,7 +357,7 @@ action_row (state_t *state)
        for (j = 0; j < ntokens; j++)
          /* and record this rule as the rule to use if that
             token follows.  */
-         if (BITISSET (LA (state->lookaheadsp + i), j))
+         if (bitset_test (LA[state->lookaheadsp + i], j))
            actrow[j] = -LAruleno[state->lookaheadsp + i];
     }
 
@@ -488,7 +489,7 @@ save_row (int state)
 static void
 token_actions (void)
 {
-  int i;
+  size_t i;
   short *yydefact = XCALLOC (short, nstates);
 
   actrow = XCALLOC (short, ntokens);
@@ -641,9 +642,9 @@ save_column (int symbol, int default_state)
 static int
 default_goto (int symbol)
 {
-  int i;
-  int m = goto_map[symbol];
-  int n = goto_map[symbol + 1];
+  size_t i;
+  size_t m = goto_map[symbol];
+  size_t n = goto_map[symbol + 1];
   int default_state = -1;
   int max = 0;
 
@@ -741,7 +742,7 @@ matching_state (int vector)
   int w;
   int prev;
 
-  if (i >= nstates)
+  if (i >= (int) nstates)
     return -1;
 
   t = tally[i];
@@ -913,7 +914,7 @@ output_check (void)
 static void
 output_actions (void)
 {
-  int i;
+  size_t i;
   nvectors = nstates + nvars;
 
   froms = XCALLOC (short *, nvectors);
@@ -922,7 +923,7 @@ output_actions (void)
   width = XCALLOC (short, nvectors);
 
   token_actions ();
-  XFREE (LA);
+  bitsetv_free (LA);
   XFREE (LAruleno);
 
   goto_actions ();
@@ -957,10 +958,9 @@ static void
 output_skeleton (void)
 {
   /* Store the definition of all the muscles. */
-  char *tempdir = getenv ("TMPDIR");
+  const char *tempdir = getenv ("TMPDIR");
   char *tempfile = NULL;
   FILE *out = NULL;
-  ssize_t bytes_read;
   int fd;
 
   if (tempdir == NULL)
@@ -1084,7 +1084,6 @@ output (void)
   output_token_translations ();
   output_gram ();
 
-  XFREE (ritem);
   if (semantic_parser)
     output_stos ();
   output_rule_data ();
@@ -1095,7 +1094,6 @@ output (void)
   /* Process the selected skeleton file.  */
   output_skeleton ();
 
-  free (rules + 1);
   obstack_free (&muscle_obstack, NULL);
   obstack_free (&format_obstack, NULL);
   obstack_free (&action_obstack, NULL);