]> granicus.if.org Git - graphviz/commitdiff
pathplan Pobspath: squash a -Wconversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 30 Jul 2022 16:56:42 +0000 (09:56 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 5 Aug 2022 13:52:10 +0000 (06:52 -0700)
Here again the proper solution would be to make the struct’s field also a
`size_t` but once again it is part of the public API that we would like to avoid
breaking.

lib/pathplan/cvt.c

index e7e7022d43e3a838c30b5952979db28ec2dcc072..00cb3f035666942fd990b0a03ce88bc55f71fec7 100644 (file)
@@ -148,7 +148,8 @@ int Pobspath(vconfig_t * config, Ppoint_t p0, int poly0, Ppoint_t p1,
     free(ptvis0);
     free(ptvis1);
 
-    output_route->pn = opn;
+    assert(opn <= INT_MAX);
+    output_route->pn = (int)opn;
     output_route->ps = ops;
 #ifdef GASP
     gasp_print_polyline(output_route);