Use more-consistent naming conventions for local vars.

This commit is contained in:
Paul Eggert
2003-02-03 15:35:57 +00:00
parent ba24760f05
commit a737b2163c
18 changed files with 163 additions and 104 deletions

View File

@@ -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> 2003-02-02 Akim Demaille <akim@epita.fr>
* src/scan-skel.l: Scan more than one inert character per yylex * src/scan-skel.l: Scan more than one inert character per yylex

View 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. Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -65,7 +65,7 @@ void
derives_compute (void) derives_compute (void)
{ {
symbol_number i; symbol_number i;
int r; rule_number r;
rule **q; rule **q;
/* DSET[NTERM - NTOKENS] -- A linked list of the numbers of the rules /* DSET[NTERM - NTOKENS] -- A linked list of the numbers of the rules

View 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, grammar_rules_partial_print (FILE *out, const char *title,
rule_filter filter) rule_filter filter)
{ {
int r; rule_number r;
bool first = true; bool first = true;
symbol *previous_lhs = NULL; symbol *previous_lhs = NULL;
@@ -270,11 +271,11 @@ grammar_dump (FILE *out, const char *title)
for (i = 0; i < nrules + nuseless_productions; i++) for (i = 0; i < nrules + nuseless_productions; i++)
{ {
rule *rule_i = &rules[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_itemno = rule_i->rhs - ritem;
unsigned int rhs_count = 0; unsigned int rhs_count = 0;
/* Find the last RHS index in ritems. */ /* 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; ++rhs_count;
fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u) %2d ->", fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u) %2d ->",
i, i,
@@ -285,9 +286,9 @@ grammar_dump (FILE *out, const char *title)
rhs_itemno + rhs_count - 1, rhs_itemno + rhs_count - 1,
rule_i->lhs->number); rule_i->lhs->number);
/* Dumped the RHS. */ /* Dumped the RHS. */
for (r = rule_i->rhs; *r >= 0; r++) for (rp = rule_i->rhs; *rp >= 0; rp++)
fprintf (out, " %3d", *r); fprintf (out, " %3d", *rp);
fprintf (out, " [%d]\n", item_number_as_rule_number (*r)); fprintf (out, " [%d]\n", item_number_as_rule_number (*rp));
} }
} }
fprintf (out, "\n\n"); fprintf (out, "\n\n");

View 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; \ char const *p; \
for (s = Value; *s; s++) \ for (p = Value; *p; p++) \
switch (*s) \ 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; \
} \ } \
} }

View 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) if (rules_ruleno->rhs[0] >= 0)
{ {
/* This rule has a non empty RHS. */ /* 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) for (rp = rules_ruleno->rhs; *rp >= 0; ++rp)
if (ISTOKEN (*r)) if (ISTOKEN (*rp))
any_tokens = 1; any_tokens = 1;
/* This rule has only nonterminals: schedule it for the second /* This rule has only nonterminals: schedule it for the second
pass. */ pass. */
if (!any_tokens) 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++;
} }
} }

View 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) lloc_default (YYLTYPE const *rhs, int n)
{ {
int i; int i;
YYLTYPE r; YYLTYPE loc;
r.start = r.end = rhs[n].end; loc.start = loc.end = rhs[n].end;
/* Ignore empty nonterminals the start of the 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, 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++) for (i = 1; i <= n; i++)
if (! equal_boundaries (rhs[i].start, rhs[i].end)) 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;
} }

View 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. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. 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 *sp;
item_number *sp1; item_number *sp1;
int r; rule_number r;
sp1 = sp = ritem + sitems[i]; sp1 = sp = ritem + sitems[i];

View 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. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. 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) if (start_flag)
complain_at (loc, _("multiple %s declarations"), "%start"); complain_at (loc, _("multiple %s declarations"), "%start");
else else
{ {
start_flag = 1; start_flag = 1;
startsymbol = s; startsymbol = sym;
startsymbol_location = loc; startsymbol_location = loc;
} }
} }

View 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 prologue_augment (const char *prologue, location loc);
void epilogue_augment (const char *epilogue, 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_begin (symbol *lhs, location loc);
void grammar_rule_end (location loc); void grammar_rule_end (location loc);
void grammar_midrule_action (void); void grammar_midrule_action (void);

View 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; int length;
for (r = nrules; r < nrules + nuseless_productions; ++r) for (r = nrules; r < nrules + nuseless_productions; ++r)
{ {

View 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 static size_t
no_cr_read (FILE *fp, char *buf, size_t size) no_cr_read (FILE *fp, char *buf, size_t size)
{ {
size_t s = fread (buf, 1, size, fp); size_t bytes_read = fread (buf, 1, size, fp);
if (s) if (bytes_read)
{ {
char *w = memchr (buf, '\r', s); char *w = memchr (buf, '\r', bytes_read);
if (w) if (w)
{ {
char const *r = ++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;
} }

View 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 | | Return the state such that SHIFTS contain a shift/goto |
| on S. Abort if none found. | | 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; int j;
for (j = 0; j < shifts->num; j++) for (j = 0; j < shifts->num; j++)
if (TRANSITION_SYMBOL (shifts, j) == s) if (TRANSITION_SYMBOL (shifts, j) == sym)
return shifts->states[j]; return shifts->states[j];
abort (); abort ();
} }

View 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. Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. 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);
/*-------. /*-------.

View File

@@ -86,7 +86,7 @@ typedef size_t uintptr_t;
#define REALLOC(P, N) ((P) = xrealloc (P, (N) * sizeof *(P))) #define REALLOC(P, N) ((P) = xrealloc (P, (N) * sizeof *(P)))
/* From xstrndup.c. */ /* 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 #endif
#if defined HAVE_DECL_STRCHR && !HAVE_DECL_STRCHR #if defined HAVE_DECL_STRCHR && !HAVE_DECL_STRCHR
char *strchr (const char *s, int c); char *strchr (const char *str, int ch);
#endif #endif
#if defined HAVE_DECL_STRSPN && !HAVE_DECL_STRSPN #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 #endif
#if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN #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 #endif
#if defined HAVE_DECL_MEMCHR && !HAVE_DECL_MEMCHR #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 #endif
#if defined HAVE_DECL_MEMRCHR && !HAVE_DECL_MEMRCHR #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

View 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. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. 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;

View 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) if (!res)
{ {
/* First insertion in the hash. */ /* First insertion in the hash. */
res = xstrdup (s); res = xstrdup (str);
hash_insert (uniqstrs_table, res); hash_insert (uniqstrs_table, res);
} }
return 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; return true;
} }
static bool 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);
} }

View 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.
@@ -27,11 +28,11 @@
typedef char const *uniqstr; typedef char const *uniqstr;
/* Return the uniqstr for S. */ /* Return the uniqstr for STR. */
uniqstr uniqstr_new (char const *s); uniqstr uniqstr_new (char const *str);
/* Two uniqstr have the same value iff they are the same. */ /* Two uniqstr values have the same value iff they are the same. */
#define UNIQSTR_EQ(S1, S2) ((S1) == (S2)) #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. */ /* Create the string table. */
void uniqstrs_new (void); void uniqstrs_new (void);
/* Die if S is not a uniqstr. */ /* Die if STR is not a uniqstr. */
void uniqstr_assert (char const *s); void uniqstr_assert (char const *str);
/* Free all the memory allocated for symbols. */ /* Free all the memory allocated for symbols. */
void uniqstrs_free (void); void uniqstrs_free (void);

View File

@@ -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 white: return "white";
case blue: return "blue"; 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 centered: return "center";
case left_justify: return "left_justify"; 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 box: return "box";
case rhomb: return "rhomb"; 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 normal: return "normal";
case maxdepth: return "maxdepth"; 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 no: return "no";
case yes: return "yes"; 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 top_to_bottom: return "top_to_bottom";
case bottom_to_top: return "bottom_to_top"; 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 center: return "center";
case top: return "top"; 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 fixed: return "fixed";
case free_a: return "free"; 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 bary: return "bary";
case median: return "median"; 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 normal_view: return "normal_view";
case cfish: return "cfish"; 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 continuous: return "continuous";
case dashed: return "dashed"; 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 solid: return "solid";
case line: return "line"; case line: return "line";