From: Matthew Fernandez Date: Thu, 8 Apr 2021 03:58:25 +0000 (-0700) Subject: represent route array lengths as size_t X-Git-Tag: 2.47.2~62^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3da733d86f4b3479e694165ef15f6180316d18d;p=graphviz represent route array lengths as size_t This fixes one -Wsign-conversion warning, though introduces a -Wconversion warning. We should be able to remove the latter as we continue cleaning up the use of int for sizes. --- diff --git a/lib/ortho/ortho.c b/lib/ortho/ortho.c index b50240d92..ed261cc3c 100644 --- a/lib/ortho/ortho.c +++ b/lib/ortho/ortho.c @@ -144,7 +144,6 @@ convertSPtoRoute (sgraph* g, snode* fst, snode* lst) snode* ptr; snode* next; snode* prev; /* node in shortest path just previous to next */ - int i; size_t sz = 0; cell* cp; cell* ncp; @@ -235,7 +234,7 @@ convertSPtoRoute (sgraph* g, snode* fst, snode* lst) } rte.segs = realloc (rte.segs, rte.n*sizeof(segment)); - for (i=0; i 0) rte.segs[i].prev = rte.segs + (i-1); if (i < rte.n-1) @@ -444,11 +443,11 @@ static void assignSegs (int nrtes, route* route_list, maze* mp) { channel* chan; - int i, j; + int i; for (i=0;iisVert) chan = chanSearch(mp->vchans, seg); @@ -1126,7 +1125,7 @@ static void attachOrthoEdges (Agraph_t* g, maze* mp, int n_edges, route* route_list, splineInfo *sinfo, epair_t es[], int doLbls) { int irte = 0; - int i, ipt, npts; + int ipt, npts; pointf* ispline = 0; int splsz = 0; pointf p, p1, q1; @@ -1160,7 +1159,7 @@ attachOrthoEdges (Agraph_t* g, maze* mp, int n_edges, route* route_list, splineI ispline[0] = ispline[1] = p; ipt = 2; - for (i = 1;iisVert) p.x = vtrack(seg, mp); @@ -1428,7 +1427,7 @@ coordOf (cell* cp, snode* np) static boxf emitEdge (FILE* fp, Agedge_t* e, route rte, maze* m, int ix, boxf bb) { - int i, x, y; + int x, y; boxf n = CELL(agtail(e))->bb; segment* seg = rte.segs; if (seg->isVert) { @@ -1445,7 +1444,7 @@ emitEdge (FILE* fp, Agedge_t* e, route rte, maze* m, int ix, boxf bb) bb.UR.y = MAX(bb.UR.y, SC*y); fprintf (fp, "newpath %d %d moveto\n", SC*x, SC*y); - for (i = 1;iisVert) { x = vtrack(seg, m); diff --git a/lib/ortho/structures.h b/lib/ortho/structures.h index e3e0ea1a3..216b9c3b9 100644 --- a/lib/ortho/structures.h +++ b/lib/ortho/structures.h @@ -14,6 +14,7 @@ #include "types.h" #include "cgraph.h" #include +#include typedef struct { double p1, p2; @@ -45,7 +46,7 @@ typedef struct segment { } segment; typedef struct { - int n; + size_t n; segment* segs; } route;