X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/4613f49b90c0c440910da55581f95183b9bb1272..da2a7671e11663b9ad941aa3e1f3014d6ad950cb:/src/vcg.c diff --git a/src/vcg.c b/src/vcg.c index 88755b28..d5f88141 100644 --- a/src/vcg.c +++ b/src/vcg.c @@ -1,6 +1,6 @@ /* 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. @@ -96,7 +96,6 @@ new_graph (graph *g) g->dirty_edge_labels = G_DIRTY_EDGE_LABELS; g->finetuning = G_FINETUNING; g->ignore_singles = G_IGNORE_SINGLES; - g->long_straight_phase = G_LONG_STRAIGHT_PHASE; g->priority_phase = G_PRIORITY_PHASE; g->manhattan_edges = G_MANHATTAN_EDGES; g->smanhattan_edges = G_SMANHATTAN_EDGES; @@ -210,9 +209,9 @@ new_edge (edge *e) `----------------------------------------------*/ 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"; @@ -251,9 +250,9 @@ get_color_str (enum color c) } 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"; @@ -263,9 +262,9 @@ get_textmode_str (enum textmode t) } 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"; @@ -276,9 +275,9 @@ get_shape_str (enum shape s) } 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"; @@ -299,9 +298,9 @@ get_layoutalgorithm_str (enum layoutalgorithm l) } 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"; @@ -310,9 +309,9 @@ get_decision_str (enum decision d) } 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"; @@ -323,9 +322,9 @@ get_orientation_str (enum orientation o) } 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"; @@ -335,9 +334,9 @@ get_node_alignment_str (enum alignment a) } 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"; @@ -346,9 +345,9 @@ get_arrow_mode_str (enum arrow_mode a) } 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"; @@ -359,9 +358,9 @@ get_crossing_type_str (enum crossing_type c) } 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"; @@ -373,9 +372,9 @@ get_view_str (enum view v) } 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"; @@ -386,9 +385,9 @@ get_linestyle_str (enum linestyle l) } 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"; @@ -419,9 +418,7 @@ add_edge (graph *g, edge *e) void add_classname (graph *g, int val, const char *name) { - struct classname *classname; - - MALLOC (classname, 1); + struct classname *classname = xmalloc (sizeof *classname); classname->no = val; classname->name = name; classname->next = g->classname; @@ -431,9 +428,7 @@ add_classname (graph *g, int val, const char *name) void add_infoname (graph *g, int integer, const char *str) { - struct infoname *infoname; - - MALLOC (infoname, 1); + struct infoname *infoname = xmalloc (sizeof *infoname); infoname->integer = integer; infoname->chars = str; infoname->next = g->infoname; @@ -445,9 +440,7 @@ void add_colorentry (graph *g, int color_idx, int red_cp, int green_cp, int blue_cp) { - struct colorentry *ce; - - MALLOC (ce, 1); + struct colorentry *ce = xmalloc (sizeof *ce); ce->color_index = color_idx; ce->red_cp = red_cp; ce->green_cp = green_cp; @@ -797,9 +790,6 @@ output_graph (graph *g, FILE *fout) if (g->ignore_singles != G_IGNORE_SINGLES) fprintf (fout, "\tignore_singles:\t%s\n", get_decision_str (g->ignore_singles)); - if (g->long_straight_phase != G_LONG_STRAIGHT_PHASE) - fprintf (fout, "\tlong_straight_phase:\t%s\n", - get_decision_str (g->long_straight_phase)); if (g->priority_phase != G_PRIORITY_PHASE) fprintf (fout, "\tpriority_phase:\t%s\n", get_decision_str (g->priority_phase));