From 76479333c8dad2ff9b3a6c41f26722d0a4a8e2c3 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 11 May 2022 21:44:01 -0700 Subject: [PATCH] gv2gml: remove 'outFile' parameter to 'indent' The only calls to this function pass `outFile`, an already available global that this parameter was shadowing. This removes a -Wshadow warning. --- cmd/tools/gv2gml.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cmd/tools/gv2gml.c b/cmd/tools/gv2gml.c index f4bb6710e..121364c1f 100644 --- a/cmd/tools/gv2gml.c +++ b/cmd/tools/gv2gml.c @@ -84,8 +84,7 @@ typedef struct { #define ID(n) (((Local_Agnodeinfo_t*)(n->base.data))->id) -static void indent (int ix, FILE* outFile) -{ +static void indent(int ix) { while (ix--) fprintf (outFile, " "); } @@ -132,17 +131,17 @@ parseStyle (char* s) } static void emitInt(char *name, int value, int ix) { - indent (ix, outFile); + indent(ix); fprintf (outFile, "%s %d\n", name, value); } static void emitReal(char *name, double value, int ix) { - indent (ix, outFile); + indent(ix); fprintf (outFile, "%s %g\n", name, value); } static void emitPoint(double x, double y, int ix) { - indent (ix, outFile); + indent(ix); fprintf (outFile, "point [ x %g y %g ]\n", x, y); } @@ -193,7 +192,7 @@ static void emitSpline(char *s, int ix) { s = arrowEnd (s, "e,", &earrow, &ex, &ey); s = arrowEnd (s, "s,", &sarrow, &sx, &sy); - indent (ix, outFile); + indent(ix); fprintf (outFile, "Line [\n"); if (sarrow) emitPoint(sx, sy, ix+1); @@ -201,7 +200,7 @@ static void emitSpline(char *s, int ix) { emitPoint(sx, sy, ix+1); if (earrow) emitPoint(ex, ey, ix+1); - indent (ix, outFile); + indent(ix); fprintf (outFile, "]\n"); } @@ -219,7 +218,7 @@ static inline int xml_puts(FILE *stream, const char *s) { } static void emitAttr(char *name, char *value, int ix) { - indent (ix, outFile); + indent(ix); if (isNumber (value)) fprintf (outFile, "%s %s\n", name, value); else { -- 2.40.0