From: Matthew Fernandez Date: Sat, 24 Apr 2021 02:48:16 +0000 (-0700) Subject: squash two -Wsign-compare warnings X-Git-Tag: 2.47.2~13^2~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f0bdb7ebcd7d510aec6abe311efa2e25612bcea;p=graphviz squash two -Wsign-compare warnings 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. --- diff --git a/lib/ortho/ortho.c b/lib/ortho/ortho.c index 6b68f5a2d..b8cee0f0d 100644 --- a/lib/ortho/ortho.c +++ b/lib/ortho/ortho.c @@ -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);