]> granicus.if.org Git - graphviz/commitdiff
squash a -Wsign-conversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 02:43:21 +0000 (19:43 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 May 2021 00:03:36 +0000 (17:03 -0700)
The npts variable is used to store an allocation quantity, so should have been
using the size_t scalar type.

lib/ortho/ortho.c

index fd0a0f7b7965a9cdcfcbdbd7e2a16ef0cd00ceb1..6b68f5a2d9a210dd496bb8462cb6b4ea31229bd1 100644 (file)
@@ -1123,9 +1123,9 @@ addPoints(pointf p0, pointf p1)
 static void
 attachOrthoEdges (Agraph_t* g, maze* mp, size_t n_edges, route* route_list, splineInfo *sinfo, epair_t es[], int doLbls)
 {
-    int ipt, npts;
+    int ipt;
     pointf* ispline = 0;
-    int splsz = 0;
+    size_t splsz = 0;
     pointf p, p1, q1;
     route rte;
     segment* seg;
@@ -1138,7 +1138,7 @@ attachOrthoEdges (Agraph_t* g, maze* mp, size_t n_edges, route* route_list, spli
        q1 = addPoints(ND_coord(aghead(e)), ED_head_port(e).p);
 
        rte = route_list[irte];
-       npts = 1 + 3*rte.n;
+       size_t npts = 1 + 3*rte.n;
        if (npts > splsz) {
                free (ispline);
                ispline = N_GNEW(npts, pointf);