]> granicus.if.org Git - graphviz/commitdiff
gv2gxl writeTrl: take a C99 bool for 'top'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Oct 2022 02:31:54 +0000 (19:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 1 Oct 2022 02:31:54 +0000 (19:31 -0700)
Slightly clearer about the intent of this parameter.

cmd/tools/gv2gxl.c

index 64f49311782988fd9304d3f0fce572ee8542e67d..b20e8ae99a3eacd2ce7fc79abc2ba9b245b049b1 100644 (file)
@@ -507,12 +507,11 @@ static void writeHdr(gxlstate_t *stp, Agraph_t *g, FILE *gxlFile, bool top) {
     AGATTRWF(g) = !(AGATTRWF(g));
 }
 
-static void writeTrl(Agraph_t * g, FILE * gxlFile, int top)
-{
+static void writeTrl(Agraph_t *g, FILE *gxlFile, bool top) {
     tabover(gxlFile);
     fprintf(gxlFile, "</graph>\n");
     Level--;
-    if (!(top) && agparent(g)) {
+    if (!top && agparent(g)) {
        tabover(gxlFile);
        fprintf(gxlFile, "</node>\n");
        Level--;
@@ -527,7 +526,7 @@ static void writeSubgs(gxlstate_t * stp, Agraph_t * g, FILE * gxlFile)
     for (subg = agfstsubg(g); subg; subg = agnxtsubg(subg)) {
        writeHdr(stp, subg, gxlFile, false);
        writeBody(stp, subg, gxlFile);
-       writeTrl(subg, gxlFile, FALSE);
+       writeTrl(subg, gxlFile, false);
     }
 }
 
@@ -869,7 +868,7 @@ void gv_to_gxl(Agraph_t * g, FILE * gxlFile)
 
     writeHdr(stp, g, gxlFile, true);
     writeBody(stp, g, gxlFile);
-    writeTrl(g, gxlFile, TRUE);
+    writeTrl(g, gxlFile, true);
 
     fprintf(gxlFile, "</gxl>\n");