]> granicus.if.org Git - graphviz/commitdiff
Match function signature in definition with declaration
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Sun, 17 Oct 2021 03:10:30 +0000 (23:10 -0400)
committerNehal J Wani <nehaljw.kkd1@gmail.com>
Sun, 17 Oct 2021 03:10:35 +0000 (23:10 -0400)
GCC11 throws the following warning:
graphviz/lib/pathplan/shortest.c:93:47: warning: argument 2 of type ‘Ppoint_t *’ {aka ‘struct Pxy_t *’} declared as a pointer [-Warray-parameter=]
   93 | int Pshortestpath(Ppoly_t * polyp, Ppoint_t * eps, Ppolyline_t * output)
      |                                    ~~~~~~~~~~~^~~
In file included from graphviz/lib/pathplan/pathutil.h:15,
                 from graphviz/lib/pathplan/shortest.c:16:
graphviz/lib/pathplan/pathplan.h:22:59: note: previously declared as an array ‘Ppoint_t[2]’ {aka ‘struct Pxy_t[2]’}
   22 |     extern int Pshortestpath(Ppoly_t * boundary, Ppoint_t endpoints[2],
      |                                                  ~~~~~~~~~^~~~~~~~~~~~
[2/20] Building C object lib/pathplan/CMakeFiles/pathplan.dir/route.c.o
graphviz/lib/pathplan/route.c:76:29: warning: argument 4 of type ‘Ppoint_t *’ {aka ‘struct Pxy_t *’} declared as a pointer [-Warray-parameter=]
   76 |                  Ppoint_t * evs, Ppolyline_t * output)
      |                  ~~~~~~~~~~~^~~
In file included from graphviz/lib/pathplan/pathutil.h:15,
                 from graphviz/lib/pathplan/route.c:17:
graphviz/lib/pathplan/pathplan.h:28:39: note: previously declared as an array ‘Pvector_t[2]’ {aka ‘struct Pxy_t[2]’}
   28 |                             Pvector_t endpoint_slopes[2],
      |                             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~

lib/pathplan/route.c
lib/pathplan/shortest.c

index cf47082afe50f82ab536fab448c343f5e4c69926..f41a0d610b595a9d86e53ac27b7aeccd12b2b80b 100644 (file)
@@ -73,7 +73,7 @@ static double B23(double t);
  * Return 0 on success and -1 on failure, including no memory.
  */
 int Proutespline(Pedge_t * edges, int edgen, Ppolyline_t input,
-                Ppoint_t * evs, Ppolyline_t * output)
+                Ppoint_t evs[2], Ppolyline_t * output)
 {
     Ppoint_t *inps;
     int inpn;
index 41e8735339496c1990e97a5fe611c7ee0a144a5d..f2f308dc3c80f59eae094f52492a2c0a09cdd78f 100644 (file)
@@ -90,7 +90,7 @@ static int growops(int);
  * points supplied in eps. The resulting polyline is stored in output.
  * Return 0 on success, -1 on bad input, -2 on memory allocation problem. 
  */
-int Pshortestpath(Ppoly_t * polyp, Ppoint_t * eps, Ppolyline_t * output)
+int Pshortestpath(Ppoly_t * polyp, Ppoint_t eps[2], Ppolyline_t * output)
 {
     int pi, minpi;
     double minx;