]> granicus.if.org Git - graphviz/commitdiff
squash some -Wfloat-conversion warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 2 May 2021 03:38:36 +0000 (20:38 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 May 2021 16:40:29 +0000 (09:40 -0700)
If we need -0.1 and -0.2 as floats (or the closest representation), we should
just say so. This improves the compiler’s ability to understand the intent of
this code.

cmd/smyrna/topviewfuncs.c

index 4ad51c97fca5bde7ef474e0b31629a4bf52eafab..3c9207784181f17e21321407ef78dd96addf41e8 100644 (file)
@@ -328,7 +328,7 @@ static void renderNodes(Agraph_t * g)
 
     x=parseXdotwithattrs(g);
     if (x) {
-       draw_xdot(x,-0.2);
+       draw_xdot(x,-0.2f);
        freeXDot (x);
     }
     for (v = agfstnode(g); v; v = agnxtnode(g, v)) 
@@ -336,7 +336,7 @@ static void renderNodes(Agraph_t * g)
            if(!object_color(v,&c))
                continue;
            x=parseXdotwithattrs(v);
-           draw_xdot(x,-0.1);
+           draw_xdot(x,-0.1f);
 
            if(x)
                freeXDot (x);
@@ -426,8 +426,8 @@ static void renderSelectedEdges(Agraph_t * g)
            glColor4f(1,0,0,1);     
            posT = ED_posTail(e);
            posH = ED_posHead(e);
-           posT.z +=0.01;
-           posH.z +=0.01;
+           posT.z +=0.01f;
+           posH.z +=0.01f;
            draw_edge(&posT,&posH,getEdgeLength(e),0);
        }
     }