]> git.saurik.com Git - bison.git/commitdiff
Use more-consistent naming conventions for local vars.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 3 Feb 2003 15:35:57 +0000 (15:35 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 3 Feb 2003 15:35:57 +0000 (15:35 +0000)
18 files changed:
ChangeLog
src/derives.c
src/gram.c
src/muscle_tab.h
src/nullable.c
src/parse-gram.y
src/print.c
src/reader.c
src/reader.h
src/reduce.c
src/scan-gram.l
src/state.c
src/state.h
src/system.h
src/tables.c
src/uniqstr.c
src/uniqstr.h
src/vcg.c

index 5e71261cb18d8854d8f238985f271ae8ca707a13..9aa6638c266767b0248482615850c5d4b8ee4206 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,56 @@
+2003-02-03  Paul Eggert  <eggert@twinsun.com>
+
+       * src/gram.h (start_symbol): Remove unused decl.
+
+       Use more-consistent naming conventions for local vars.
+
+       * src/derives.c (derives_compute): Change type of local var from
+       int to rule_number.
+       * src/gram.c (grammar_rules_partial_print): Likewise.
+       * src/print.c (print_core): Likewise.
+       * src/reduce.c (reduce_grammar_tables): Likewise.
+
+       * src/gram.c (grammar_dump): Change name of item_number *
+       local var from r to rp.
+       * src/nullable.c (nullable_compute): Likewise.
+
+       * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
+
+       * src/gram.h (symbol_number_as_item_number): Use sym, not s,
+       for symbol or symbol_number var.
+       * src/reader.c (grammar_start_symbol_set): Likewise.
+       * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
+       Likewise.
+       * src/state.c (transitions_to): Likewise.
+       * src/state.h: Likewise.
+       * src/tables.c (symbol_number_to_vector_number): Likewise.
+
+       * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
+       char * var.
+
+       * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
+       var.
+
+       * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
+       var.
+
+       * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
+       Use str, not s, for char * var.  Use ch, not c, for character var.
+       Use size for size var.
+
+       * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
+       char * var.
+       (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
+       uniqstr var.
+       * src/uniqstr.h: Likewise.
+
+       * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
+       get_layoutalgorithm_str, get_decision_str, get_orientation_str,
+       get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
+       get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
+       param to have same name as that of enum, so that we don't use
+       "s" to stand for a non-state.
+
 2003-02-02  Akim Demaille  <akim@epita.fr>
 
        * src/scan-skel.l: Scan more than one inert character per yylex
 2003-02-02  Akim Demaille  <akim@epita.fr>
 
        * src/scan-skel.l: Scan more than one inert character per yylex
index da881ecc521e8277974e22adcb88a24c6c39b94b..7e20fe5a29f0d7153c7b67c4b2205be143955a31 100644 (file)
@@ -1,6 +1,6 @@
 /* Match rules with nonterminals for bison,
 
 /* Match rules with nonterminals for bison,
 
-   Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software
+   Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -65,7 +65,7 @@ void
 derives_compute (void)
 {
   symbol_number i;
 derives_compute (void)
 {
   symbol_number i;
-  int r;
+  rule_number r;
   rule **q;
 
   /* DSET[NTERM - NTOKENS] -- A linked list of the numbers of the rules
   rule **q;
 
   /* DSET[NTERM - NTOKENS] -- A linked list of the numbers of the rules
index cf5a946db983e698269f6f2fa1aaa1800ecbc3ad..86f75ec7b8f3d13fa208982e6f628ac46b471228 100644 (file)
@@ -1,6 +1,7 @@
 /* Allocate input grammar variables for Bison.
 
 /* Allocate input grammar variables for Bison.
 
-   Copyright (C) 1984, 1986, 1989, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1986, 1989, 2001, 2002, 2003 Free Software
+   Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -203,7 +204,7 @@ void
 grammar_rules_partial_print (FILE *out, const char *title,
                             rule_filter filter)
 {
 grammar_rules_partial_print (FILE *out, const char *title,
                             rule_filter filter)
 {
-  int r;
+  rule_number r;
   bool first = true;
   symbol *previous_lhs = NULL;
 
   bool first = true;
   symbol *previous_lhs = NULL;
 
@@ -270,11 +271,11 @@ grammar_dump (FILE *out, const char *title)
     for (i = 0; i < nrules + nuseless_productions; i++)
       {
        rule *rule_i = &rules[i];
     for (i = 0; i < nrules + nuseless_productions; i++)
       {
        rule *rule_i = &rules[i];
-       item_number *r = NULL;
+       item_number *rp = NULL;
        unsigned int rhs_itemno = rule_i->rhs - ritem;
        unsigned int rhs_count = 0;
        /* Find the last RHS index in ritems. */
        unsigned int rhs_itemno = rule_i->rhs - ritem;
        unsigned int rhs_count = 0;
        /* Find the last RHS index in ritems. */
-       for (r = rule_i->rhs; *r >= 0; ++r)
+       for (rp = rule_i->rhs; *rp >= 0; ++rp)
          ++rhs_count;
        fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u)   %2d ->",
                 i,
          ++rhs_count;
        fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u)   %2d ->",
                 i,
@@ -285,9 +286,9 @@ grammar_dump (FILE *out, const char *title)
                 rhs_itemno + rhs_count - 1,
                 rule_i->lhs->number);
        /* Dumped the RHS. */
                 rhs_itemno + rhs_count - 1,
                 rule_i->lhs->number);
        /* Dumped the RHS. */
-       for (r = rule_i->rhs; *r >= 0; r++)
-         fprintf (out, " %3d", *r);
-       fprintf (out, "  [%d]\n", item_number_as_rule_number (*r));
+       for (rp = rule_i->rhs; *rp >= 0; rp++)
+         fprintf (out, " %3d", *rp);
+       fprintf (out, "  [%d]\n", item_number_as_rule_number (*rp));
       }
   }
   fprintf (out, "\n\n");
       }
   }
   fprintf (out, "\n\n");
index 35038c780eb7b501547bcfc03806d50dcf8b557d..4dd9b0be57d639e74d9810ce2feaf3e0f85a28e2 100644 (file)
@@ -1,5 +1,5 @@
 /* Muscle table manager for Bison,
 /* Muscle table manager for Bison,
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -53,15 +53,15 @@ extern struct obstack muscle_obstack;
 
 #define MUSCLE_OBSTACK_SGROW(Obstack, Value)                   \
 {                                                              \
 
 #define MUSCLE_OBSTACK_SGROW(Obstack, Value)                   \
 {                                                              \
-  char const *s;                                               \
-  for (s = Value; *s; s++)                                     \
-    switch (*s)                                                        \
+  char const *p;                                               \
+  for (p = Value; *p; p++)                                     \
+    switch (*p)                                                        \
       {                                                                \
       case '$':        obstack_sgrow (Obstack, "$]["); break;          \
       case '@':        obstack_sgrow (Obstack, "@@" ); break;          \
       case '[':        obstack_sgrow (Obstack, "@{" ); break;          \
       case ']':        obstack_sgrow (Obstack, "@}" ); break;          \
       {                                                                \
       case '$':        obstack_sgrow (Obstack, "$]["); break;          \
       case '@':        obstack_sgrow (Obstack, "@@" ); break;          \
       case '[':        obstack_sgrow (Obstack, "@{" ); break;          \
       case ']':        obstack_sgrow (Obstack, "@}" ); break;          \
-      default: obstack_1grow (Obstack, *s); break;             \
+      default: obstack_1grow (Obstack, *p); break;             \
       }                                                                \
 }
 
       }                                                                \
 }
 
index beedf2b140f06281beb326df5b400cc70f684367..cf6cfd68c0831b370c7693e3ddca1c1057ae1ab6 100644 (file)
@@ -1,6 +1,7 @@
 /* Calculate which nonterminals can expand into the null string for Bison.
 
 /* Calculate which nonterminals can expand into the null string for Bison.
 
-   Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software
+   Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -81,21 +82,21 @@ nullable_compute (void)
        if (rules_ruleno->rhs[0] >= 0)
          {
            /* This rule has a non empty RHS. */
        if (rules_ruleno->rhs[0] >= 0)
          {
            /* This rule has a non empty RHS. */
-           item_number *r = NULL;
+           item_number *rp = NULL;
            int any_tokens = 0;
            int any_tokens = 0;
-           for (r = rules_ruleno->rhs; *r >= 0; ++r)
-             if (ISTOKEN (*r))
+           for (rp = rules_ruleno->rhs; *rp >= 0; ++rp)
+             if (ISTOKEN (*rp))
                any_tokens = 1;
 
            /* This rule has only nonterminals: schedule it for the second
               pass.  */
            if (!any_tokens)
                any_tokens = 1;
 
            /* This rule has only nonterminals: schedule it for the second
               pass.  */
            if (!any_tokens)
-             for (r = rules_ruleno->rhs; *r >= 0; ++r)
+             for (rp = rules_ruleno->rhs; *rp >= 0; ++rp)
                {
                  rcount[ruleno]++;
                {
                  rcount[ruleno]++;
-                 p->next = rsets[*r - ntokens];
+                 p->next = rsets[*rp - ntokens];
                  p->value = rules_ruleno;
                  p->value = rules_ruleno;
-                 rsets[*r - ntokens] = p;
+                 rsets[*rp - ntokens] = p;
                  p++;
                }
          }
                  p++;
                }
          }
index c5d8024fa3315a258532360d99777698d2e94523..668d9db32f53754b860877b9e6399069ad5e315c 100644 (file)
@@ -1,5 +1,6 @@
 /* Bison Grammar Parser                             -*- C -*-
 /* Bison Grammar Parser                             -*- C -*-
-   Copyright (C) 2002 Free Software Foundation, Inc.
+
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -413,8 +414,8 @@ static YYLTYPE
 lloc_default (YYLTYPE const *rhs, int n)
 {
   int i;
 lloc_default (YYLTYPE const *rhs, int n)
 {
   int i;
-  YYLTYPE r;
-  r.start = r.end = rhs[n].end;
+  YYLTYPE loc;
+  loc.start = loc.end = rhs[n].end;
 
   /* Ignore empty nonterminals the start of the the right-hand side.
      Do not bother to ignore them at the end of the right-hand side,
 
   /* Ignore empty nonterminals the start of the the right-hand side.
      Do not bother to ignore them at the end of the right-hand side,
@@ -422,11 +423,11 @@ lloc_default (YYLTYPE const *rhs, int n)
   for (i = 1; i <= n; i++)
     if (! equal_boundaries (rhs[i].start, rhs[i].end))
       {
   for (i = 1; i <= n; i++)
     if (! equal_boundaries (rhs[i].start, rhs[i].end))
       {
-       r.start = rhs[i].start;
+       loc.start = rhs[i].start;
        break;
       }
 
        break;
       }
 
-  return r;
+  return loc;
 }
 
 
 }
 
 
index ce9529b75d1ed2cec9bd001951a7187c9366825f..dcf7df3a9941c2561d1fe0a98df1c345dca51b15 100644 (file)
@@ -1,5 +1,6 @@
 /* Print information on generated parser, for bison,
 /* Print information on generated parser, for bison,
-   Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002
+
+   Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -92,7 +93,7 @@ print_core (FILE *out, state *s)
     {
       item_number *sp;
       item_number *sp1;
     {
       item_number *sp;
       item_number *sp1;
-      int r;
+      rule_number r;
 
       sp1 = sp = ritem + sitems[i];
 
 
       sp1 = sp = ritem + sitems[i];
 
index 8b0e0359bf64372be3a140849a92b7b2cb1085aa..3f8cab8b3688ad9c6555a1a7164b362054d3e3ac 100644 (file)
@@ -1,6 +1,6 @@
 /* Input parser for Bison
 
 /* Input parser for Bison
 
-   Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000, 2001, 2002
+   Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -47,14 +47,14 @@ int typed = 0;
 `-----------------------*/
 
 void
 `-----------------------*/
 
 void
-grammar_start_symbol_set (symbol *s, location loc)
+grammar_start_symbol_set (symbol *sym, location loc)
 {
   if (start_flag)
     complain_at (loc, _("multiple %s declarations"), "%start");
   else
     {
       start_flag = 1;
 {
   if (start_flag)
     complain_at (loc, _("multiple %s declarations"), "%start");
   else
     {
       start_flag = 1;
-      startsymbol = s;
+      startsymbol = sym;
       startsymbol_location = loc;
     }
 }
       startsymbol_location = loc;
     }
 }
index 28f6404f0e39920ce159ef2c2af980965b118026..56c4f5c392a73681ff3f996557cdeaaab3efc9c9 100644 (file)
@@ -1,6 +1,6 @@
 /* Input parser for Bison
 
 /* Input parser for Bison
 
-   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -53,10 +53,10 @@ char const *token_name (int);
 
 
 /* From reader.c. */
 
 
 /* From reader.c. */
-void grammar_start_symbol_set (symbol *s, location loc);
+void grammar_start_symbol_set (symbol *sym, location loc);
 void prologue_augment (const char *prologue, location loc);
 void epilogue_augment (const char *epilogue, location loc);
 void prologue_augment (const char *prologue, location loc);
 void epilogue_augment (const char *epilogue, location loc);
-void grammar_symbol_append (symbol *s, location loc);
+void grammar_symbol_append (symbol *sym, location loc);
 void grammar_rule_begin (symbol *lhs, location loc);
 void grammar_rule_end (location loc);
 void grammar_midrule_action (void);
 void grammar_rule_begin (symbol *lhs, location loc);
 void grammar_rule_end (location loc);
 void grammar_midrule_action (void);
index 94df548e8203ec40f7d5410933459d90634172cd..b9b6a3dde45d64ed5b985875f61a918adda359ee 100644 (file)
@@ -1,6 +1,7 @@
 /* Grammar reduction for Bison.
 
 /* Grammar reduction for Bison.
 
-   Copyright (C) 1988, 1989, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1989, 2000, 2001, 2002, 2003 Free Software
+   Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -267,7 +268,7 @@ reduce_grammar_tables (void)
 
   /* Adjust NRITEMS.  */
   {
 
   /* Adjust NRITEMS.  */
   {
-    int r;
+    rule_number r;
     int length;
     for (r = nrules; r < nrules + nuseless_productions; ++r)
       {
     int length;
     for (r = nrules; r < nrules + nuseless_productions; ++r)
       {
index a2c61fd67e9ea92fb6dcbd59aff19aef47ef5b93..5f7ac60e73b818c14747619288ec8ace3fc98804 100644 (file)
@@ -1,6 +1,6 @@
 /* Bison Grammar Scanner                             -*- C -*-
 
 /* Bison Grammar Scanner                             -*- C -*-
 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -682,14 +682,14 @@ adjust_location (location *loc, char const *token, size_t size)
 static size_t
 no_cr_read (FILE *fp, char *buf, size_t size)
 {
 static size_t
 no_cr_read (FILE *fp, char *buf, size_t size)
 {
-  size_t s = fread (buf, 1, size, fp);
-  if (s)
+  size_t bytes_read = fread (buf, 1, size, fp);
+  if (bytes_read)
     {
     {
-      char *w = memchr (buf, '\r', s);
+      char *w = memchr (buf, '\r', bytes_read);
       if (w)
        {
          char const *r = ++w;
       if (w)
        {
          char const *r = ++w;
-         char const *lim = buf + s;
+         char const *lim = buf + bytes_read;
 
          for (;;)
            {
 
          for (;;)
            {
@@ -718,7 +718,7 @@ no_cr_read (FILE *fp, char *buf, size_t size)
        }
     }
 
        }
     }
 
-  return s;
+  return bytes_read;
 }
 
 
 }
 
 
index 3afe46cfd004efe850c71d75fb8f672d9949bda6..730427f3f3f8b9be035518a0eb6cfe02e13db5a3 100644 (file)
@@ -1,6 +1,6 @@
 /* Type definitions for nondeterministic finite state machine for Bison.
 
 /* Type definitions for nondeterministic finite state machine for Bison.
 
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -49,17 +49,17 @@ transitions_new (int num, state **the_states)
 }
 
 
 }
 
 
-/*-------------------------------------------------------------------.
-| Return the state such these TRANSITIONS contain a shift/goto to it |
-| on S.  Abort if none found.                                        |
-`-------------------------------------------------------------------*/
+/*-------------------------------------------------------.
+| Return the state such that SHIFTS contain a shift/goto |
+| to it on SYM.  Abort if none found.                    |
+`-------------------------------------------------------*/
 
 state *
 
 state *
-transitions_to (transitions *shifts, symbol_number s)
+transitions_to (transitions *shifts, symbol_number sym)
 {
   int j;
   for (j = 0; j < shifts->num; j++)
 {
   int j;
   for (j = 0; j < shifts->num; j++)
-    if (TRANSITION_SYMBOL (shifts, j) == s)
+    if (TRANSITION_SYMBOL (shifts, j) == sym)
       return shifts->states[j];
   abort ();
 }
       return shifts->states[j];
   abort ();
 }
index 1e49bb384fa429cafff8270cb8c0e694f97538f0..b75912891375fb8e2d63d65011ac25797aa9eaa2 100644 (file)
@@ -1,6 +1,6 @@
 /* Type definitions for nondeterministic finite state machine for Bison.
 
 /* Type definitions for nondeterministic finite state machine for Bison.
 
-   Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software
+   Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -160,9 +160,9 @@ typedef struct
     if (!TRANSITION_IS_DISABLED (Transitions, Iter))
 
 
     if (!TRANSITION_IS_DISABLED (Transitions, Iter))
 
 
-/* Return the state such SHIFTS contain a shift/goto to it on S.
+/* Return the state such SHIFTS contain a shift/goto to it on SYM.
    Abort if none found.  */
    Abort if none found.  */
-struct state *transitions_to (transitions *shifts, symbol_number s);
+struct state *transitions_to (transitions *shifts, symbol_number sym);
 
 
 /*-------.
 
 
 /*-------.
index 068b308a8d8bb846b26fedde747a988262d95dc9..0b11dbe693c256f2fc56efb11e014f38e8b978b8 100644 (file)
@@ -86,7 +86,7 @@ typedef size_t uintptr_t;
 #define REALLOC(P, N) ((P) = xrealloc (P, (N) * sizeof *(P)))
 
 /* From xstrndup.c.  */
 #define REALLOC(P, N) ((P) = xrealloc (P, (N) * sizeof *(P)))
 
 /* From xstrndup.c.  */
-char *xstrndup (const char *s, size_t n);
+char *xstrndup (const char *str, size_t size);
 
 
 /*---------------------.
 
 
 /*---------------------.
@@ -98,23 +98,23 @@ char *stpcpy (char *dest, const char *src);
 #endif
 
 #if defined HAVE_DECL_STRCHR && !HAVE_DECL_STRCHR
 #endif
 
 #if defined HAVE_DECL_STRCHR && !HAVE_DECL_STRCHR
-char *strchr (const char *s, int c);
+char *strchr (const char *str, int ch);
 #endif
 
 #if defined HAVE_DECL_STRSPN && !HAVE_DECL_STRSPN
 #endif
 
 #if defined HAVE_DECL_STRSPN && !HAVE_DECL_STRSPN
-size_t strspn (const char *s, const char *accept);
+size_t strspn (const char *str, const char *accept);
 #endif
 
 #if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN
 #endif
 
 #if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN
-size_t strnlen (const char *s, size_t maxlen);
+size_t strnlen (const char *str, size_t maxlen);
 #endif
 
 #if defined HAVE_DECL_MEMCHR && !HAVE_DECL_MEMCHR
 #endif
 
 #if defined HAVE_DECL_MEMCHR && !HAVE_DECL_MEMCHR
-void *memchr (const void *s, int c, size_t n);
+void *memchr (const void *str, int ch, size_t size);
 #endif
 
 #if defined HAVE_DECL_MEMRCHR && !HAVE_DECL_MEMRCHR
 #endif
 
 #if defined HAVE_DECL_MEMRCHR && !HAVE_DECL_MEMRCHR
-void *memrchr (const void *s, int c, size_t n);
+void *memrchr (const void *str, int ch, size_t size);
 #endif
 
 
 #endif
 
 
index 1e65e3651c3537016bce2c3af07d52533f899e66..0b43ce1cd20643792248d21dc77715042a3fc2c9 100644 (file)
@@ -1,6 +1,6 @@
 /* Output the generated parsing program for Bison.
 
 /* Output the generated parsing program for Bison.
 
-   Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002
+   Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -51,9 +51,9 @@ state_number_to_vector_number (state_number s)
 }
 
 static inline vector_number
 }
 
 static inline vector_number
-symbol_number_to_vector_number (symbol_number s)
+symbol_number_to_vector_number (symbol_number sym)
 {
 {
-  return state_number_as_int (nstates) + s - ntokens;
+  return state_number_as_int (nstates) + sym - ntokens;
 }
 
 int nvectors;
 }
 
 int nvectors;
index c93157d7b5a059780da149e0af5b1f2f86ba3990..fb316cb3cb09f6e8d89ddd361d979b5d5e4c99ad 100644 (file)
@@ -1,6 +1,6 @@
 /* Keep a unique copy of strings.
 
 /* Keep a unique copy of strings.
 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -41,13 +41,13 @@ static struct hash_table *uniqstrs_table = NULL;
 `-------------------------------------*/
 
 uniqstr
 `-------------------------------------*/
 
 uniqstr
-uniqstr_new (char const *s)
+uniqstr_new (char const *str)
 {
 {
-  uniqstr res = hash_lookup (uniqstrs_table, s);
+  uniqstr res = hash_lookup (uniqstrs_table, str);
   if (!res)
     {
       /* First insertion in the hash. */
   if (!res)
     {
       /* First insertion in the hash. */
-      res = xstrdup (s);
+      res = xstrdup (str);
       hash_insert (uniqstrs_table, res);
     }
   return res;
       hash_insert (uniqstrs_table, res);
     }
   return res;
@@ -59,11 +59,11 @@ uniqstr_new (char const *s)
 `------------------------------*/
 
 void
 `------------------------------*/
 
 void
-uniqstr_assert (char const *s)
+uniqstr_assert (char const *str)
 {
 {
-  if (!hash_lookup (uniqstrs_table, s))
+  if (!hash_lookup (uniqstrs_table, str))
     {
     {
-      error (0, 0, "not a uniqstr: %s", quotearg (s));
+      error (0, 0, "not a uniqstr: %s", quotearg (str));
       abort ();
     }
 }
       abort ();
     }
 }
@@ -74,16 +74,16 @@ uniqstr_assert (char const *s)
 `--------------------*/
 
 static inline bool
 `--------------------*/
 
 static inline bool
-uniqstr_print (uniqstr s)
+uniqstr_print (uniqstr ustr)
 {
 {
-  fprintf (stderr, "%s\n", s);
+  fprintf (stderr, "%s\n", ustr);
   return true;
 }
 
 static bool
   return true;
 }
 
 static bool
-uniqstr_print_processor (void *s, void *null ATTRIBUTE_UNUSED)
+uniqstr_print_processor (void *ustr, void *null ATTRIBUTE_UNUSED)
 {
 {
-  return uniqstr_print (s);
+  return uniqstr_print (ustr);
 }
 
 \f
 }
 
 \f
index 90961d9c38dbf6b68521627e52067710f9318b2e..8f941141091d910929ee44d49429b16f149a11e5 100644 (file)
@@ -1,5 +1,6 @@
 /* Keeping a unique copy of strings.
 /* Keeping a unique copy of strings.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
 typedef char const *uniqstr;
 
 
 typedef char const *uniqstr;
 
-/* Return the uniqstr for S.  */
-uniqstr uniqstr_new (char const *s);
+/* Return the uniqstr for STR.  */
+uniqstr uniqstr_new (char const *str);
 
 
-/* Two uniqstr have the same value iff they are the same.  */
-#define UNIQSTR_EQ(S1, S2) ((S1) == (S2))
+/* Two uniqstr values have the same value iff they are the same.  */
+#define UNIQSTR_EQ(USTR1, USTR2) ((USTR1) == (USTR2))
 
 /*--------------------------------------.
 | Initializing, destroying, debugging.  |
 
 /*--------------------------------------.
 | Initializing, destroying, debugging.  |
@@ -40,8 +41,8 @@ uniqstr uniqstr_new (char const *s);
 /* Create the string table.  */
 void uniqstrs_new (void);
 
 /* Create the string table.  */
 void uniqstrs_new (void);
 
-/* Die if S is not a uniqstr.  */
-void uniqstr_assert (char const *s);
+/* Die if STR is not a uniqstr.  */
+void uniqstr_assert (char const *str);
 
 /* Free all the memory allocated for symbols.  */
 void uniqstrs_free (void);
 
 /* Free all the memory allocated for symbols.  */
 void uniqstrs_free (void);
index 88755b28afcd9061792ae3fd6c531a6be7caad13..c68233de15ca63eec9cda1ad88ef9e7623a0bf01 100644 (file)
--- a/src/vcg.c
+++ b/src/vcg.c
@@ -1,6 +1,6 @@
 /* VCG description handler for Bison.
 
 /* VCG description handler for Bison.
 
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -210,9 +210,9 @@ new_edge (edge *e)
 `----------------------------------------------*/
 
 static const char *
 `----------------------------------------------*/
 
 static const char *
-get_color_str (enum color c)
+get_color_str (enum color color)
 {
 {
-  switch (c)
+  switch (color)
     {
     case white:                return "white";
     case blue:         return "blue";
     {
     case white:                return "white";
     case blue:         return "blue";
@@ -251,9 +251,9 @@ get_color_str (enum color c)
 }
 
 static const char *
 }
 
 static const char *
-get_textmode_str (enum textmode t)
+get_textmode_str (enum textmode textmode)
 {
 {
-  switch (t)
+  switch (textmode)
     {
     case centered:     return "center";
     case left_justify: return "left_justify";
     {
     case centered:     return "center";
     case left_justify: return "left_justify";
@@ -263,9 +263,9 @@ get_textmode_str (enum textmode t)
 }
 
 static const char *
 }
 
 static const char *
-get_shape_str (enum shape s)
+get_shape_str (enum shape shape)
 {
 {
-  switch (s)
+  switch (shape)
     {
     case box:          return "box";
     case rhomb:                return "rhomb";
     {
     case box:          return "box";
     case rhomb:                return "rhomb";
@@ -276,9 +276,9 @@ get_shape_str (enum shape s)
 }
 
 static const char *
 }
 
 static const char *
-get_layoutalgorithm_str (enum layoutalgorithm l)
+get_layoutalgorithm_str (enum layoutalgorithm layoutalgorithm)
 {
 {
-  switch (l)
+  switch (layoutalgorithm)
     {
     case normal:               return "normal";
     case maxdepth:     return "maxdepth";
     {
     case normal:               return "normal";
     case maxdepth:     return "maxdepth";
@@ -299,9 +299,9 @@ get_layoutalgorithm_str (enum layoutalgorithm l)
 }
 
 static const char *
 }
 
 static const char *
-get_decision_str (enum decision d)
+get_decision_str (enum decision decision)
 {
 {
-  switch (d)
+  switch (decision)
     {
     case no:   return "no";
     case yes:  return "yes";
     {
     case no:   return "no";
     case yes:  return "yes";
@@ -310,9 +310,9 @@ get_decision_str (enum decision d)
 }
 
 static const char *
 }
 
 static const char *
-get_orientation_str (enum orientation o)
+get_orientation_str (enum orientation orientation)
 {
 {
-  switch (o)
+  switch (orientation)
     {
     case top_to_bottom:        return "top_to_bottom";
     case bottom_to_top: return "bottom_to_top";
     {
     case top_to_bottom:        return "top_to_bottom";
     case bottom_to_top: return "bottom_to_top";
@@ -323,9 +323,9 @@ get_orientation_str (enum orientation o)
 }
 
 static const char *
 }
 
 static const char *
-get_node_alignment_str (enum alignment a)
+get_node_alignment_str (enum alignment alignment)
 {
 {
-  switch (a)
+  switch (alignment)
     {
     case center:       return "center";
     case top:          return "top";
     {
     case center:       return "center";
     case top:          return "top";
@@ -335,9 +335,9 @@ get_node_alignment_str (enum alignment a)
 }
 
 static const char *
 }
 
 static const char *
-get_arrow_mode_str (enum arrow_mode a)
+get_arrow_mode_str (enum arrow_mode arrow_mode)
 {
 {
-  switch (a)
+  switch (arrow_mode)
     {
     case fixed:                return "fixed";
     case free_a:       return "free";
     {
     case fixed:                return "fixed";
     case free_a:       return "free";
@@ -346,9 +346,9 @@ get_arrow_mode_str (enum arrow_mode a)
 }
 
 static const char *
 }
 
 static const char *
-get_crossing_type_str (enum crossing_type c)
+get_crossing_type_str (enum crossing_type crossing_type)
 {
 {
-  switch (c)
+  switch (crossing_type)
     {
     case bary:         return "bary";
     case median:       return "median";
     {
     case bary:         return "bary";
     case median:       return "median";
@@ -359,9 +359,9 @@ get_crossing_type_str (enum crossing_type c)
 }
 
 static const char *
 }
 
 static const char *
-get_view_str (enum view v)
+get_view_str (enum view view)
 {
 {
-  switch (v)
+  switch (view)
     {
     case normal_view:  return "normal_view";
     case cfish:                return "cfish";
     {
     case normal_view:  return "normal_view";
     case cfish:                return "cfish";
@@ -373,9 +373,9 @@ get_view_str (enum view v)
 }
 
 static const char *
 }
 
 static const char *
-get_linestyle_str (enum linestyle l)
+get_linestyle_str (enum linestyle linestyle)
 {
 {
-  switch (l)
+  switch (linestyle)
     {
     case continuous:   return "continuous";
     case dashed:       return "dashed";
     {
     case continuous:   return "continuous";
     case dashed:       return "dashed";
@@ -386,9 +386,9 @@ get_linestyle_str (enum linestyle l)
 }
 
 static const char *
 }
 
 static const char *
-get_arrowstyle_str (enum arrowstyle a)
+get_arrowstyle_str (enum arrowstyle arrowstyle)
 {
 {
-  switch (a)
+  switch (arrowstyle)
     {
     case solid:        return "solid";
     case line: return "line";
     {
     case solid:        return "solid";
     case line: return "line";