]> granicus.if.org Git - graphviz/commitdiff
common attach_attrs_and_arrows: remove shadowing of 'i'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Dec 2022 18:07:02 +0000 (10:07 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Dec 2022 22:31:10 +0000 (14:31 -0800)
lib/common/output.c

index a64c6d72c225e9753d4785b442582cf7d0e0b84e..6425d32e04754a71869c80b7bfa9d91581e58a85 100644 (file)
@@ -229,7 +229,7 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
 {
     int e_arrows;              /* graph has edges with end arrows */
     int s_arrows;              /* graph has edges with start arrows */
-    int i, j, sides;
+    int j, sides;
     char buf[BUFSIZ];          /* Used only for small strings */
     char xbuffer[BUFSIZ];      /* Initial buffer for xb */
     agxbuf xb;
@@ -296,7 +296,6 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
            agset(n, "rects", agxbuse(&xb));
        } else {
            polygon_t *poly;
-           int i;
            if (N_vertices && isPolygon(n)) {
                poly = ND_shape_info(n);
                sides = poly->sides;
@@ -309,7 +308,7 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
                    if (sides < 3)
                        sides = 8;
                }
-               for (i = 0; i < sides; i++) {
+               for (int i = 0; i < sides; i++) {
                    if (i > 0)
                        agxbputc(&xb, ' ');
                    if (poly->sides >= 3)
@@ -330,7 +329,7 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
                    continue;
                if (ED_spl(e) == NULL)
                    continue;   /* reported in postproc */
-               for (i = 0; i < ED_spl(e)->size; i++) {
+               for (int i = 0; i < ED_spl(e)->size; i++) {
                    if (i > 0)
                        agxbputc(&xb, ';');
                    if (ED_spl(e)->list[i].sflag) {