]> granicus.if.org Git - graphviz/commitdiff
ortho emitGraph: do float rounding in 'fprintf'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 26 Dec 2022 21:35:34 +0000 (13:35 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Dec 2022 23:34:34 +0000 (15:34 -0800)
Squashes four -Wfloat-conversion warnings.

lib/ortho/ortho.c

index 263cc1bb2b8d698966335986a021304dadc7bb4e..db1554e3ff48303ee78e085264ec83e4dd637b5e 100644 (file)
@@ -1411,7 +1411,7 @@ static char* prolog2 =
 static char* epilog2 =
 "showpage\n\
 %%%%Trailer\n\
-%%%%BoundingBox: %d %d %d %d\n";
+%%%%BoundingBox: %.f %.f %.f %.f\n";
 
 static point
 coordOf (cell* cp, snode* np)
@@ -1536,7 +1536,6 @@ static DEBUG_FN void emitSearchGraph(FILE *fp, sgraph *sg) {
 static DEBUG_FN void emitGraph(FILE *fp, maze *mp, size_t n_edges,
                                route *route_list, epair_t es[]) {
     boxf bb, absbb;
-    box bbox;
 
     absbb.LL.x = absbb.LL.y = MAXDOUBLE;
     absbb.UR.x = absbb.UR.y = -MAXDOUBLE;
@@ -1564,6 +1563,7 @@ static DEBUG_FN void emitGraph(FILE *fp, maze *mp, size_t n_edges,
       absbb.UR.y = MAX(absbb.UR.y, bb.UR.y);
     }
 
+    boxf bbox;
     bbox.LL.x = absbb.LL.x + TRANS;
     bbox.LL.y = absbb.LL.y + TRANS;
     bbox.UR.x = absbb.UR.x + TRANS;