]> granicus.if.org Git - graphviz/commitdiff
squash two -Wsign-compare warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 02:48:16 +0000 (19:48 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 May 2021 00:03:36 +0000 (17:03 -0700)
The iterations modified here are iterating over a collection whose size is
tracked using int fields, ngcells and ncells. Both these should really be size_t
but this is complicated to change at this point. As long as they are int, using
int loop counters provides greater consistency.

lib/ortho/ortho.c

index 6b68f5a2d9a210dd496bb8462cb6b4ea31229bd1..b8cee0f0d4cb7f04a32f568e8078dd1611541ecb 100644 (file)
@@ -1518,7 +1518,7 @@ emitGraph (FILE* fp, maze* mp, size_t n_edges, route* route_list, epair_t es[])
     fprintf (fp, "%d %d translate\n", TRANS, TRANS);
 
     fputs ("0 0 1 setrgbcolor\n", fp);
-    for (size_t i = 0; i < mp->ngcells; i++) {
+    for (int i = 0; i < mp->ngcells; i++) {
       bb = mp->gcells[i].bb;
       fprintf (fp, "%f %f %f %f node\n", bb.LL.x, bb.LL.y, bb.UR.x, bb.UR.y);
     }
@@ -1528,7 +1528,7 @@ emitGraph (FILE* fp, maze* mp, size_t n_edges, route* route_list, epair_t es[])
     }
     
     fputs ("0.8 0.8 0.8 setrgbcolor\n", fp);
-    for (size_t i = 0; i < mp->ncells; i++) {
+    for (int i = 0; i < mp->ncells; i++) {
       bb = mp->cells[i].bb;
       fprintf (fp, "%f %f %f %f cell\n", bb.LL.x, bb.LL.y, bb.UR.x, bb.UR.y);
       absbb.LL.x = MIN(absbb.LL.x, bb.LL.x);