From: Matthew Fernandez Date: Thu, 5 May 2022 15:33:16 +0000 (-0700) Subject: smyrna: squash -Wmaybe-uninitialized warnings in 'set_boundaries' X-Git-Tag: 4.0.0~46^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=014e38a46747be84e6f639389dd27683ad37867e;p=graphviz smyrna: squash -Wmaybe-uninitialized warnings in 'set_boundaries' This code is assuming there is at least one point to scan in the loop. In case there is not (and to pacify the compiler) set an initial trivial bounding box. --- diff --git a/cmd/smyrna/topviewfuncs.c b/cmd/smyrna/topviewfuncs.c index 0da50faa0..e1b87bc44 100644 --- a/cmd/smyrna/topviewfuncs.c +++ b/cmd/smyrna/topviewfuncs.c @@ -22,6 +22,7 @@ #include #include #include +#include static xdot *parseXdotwithattrs(void *e) { @@ -52,7 +53,7 @@ static void set_boundaries(Agraph_t * g) Agnode_t *v; Agsym_t* pos_attr = GN_pos(g); glCompPoint pos; - float left, right, top, bottom; + float left = FLT_MAX, right = -FLT_MAX, top = FLT_MAX, bottom = -FLT_MAX; int id=0; for (v = agfstnode(g); v; v = agnxtnode(g, v))