From 014e38a46747be84e6f639389dd27683ad37867e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 5 May 2022 08:33:16 -0700 Subject: [PATCH] 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. --- cmd/smyrna/topviewfuncs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) -- 2.40.0