]> granicus.if.org Git - graphviz/commitdiff
smyrna: avoid inadvertent double promotion in 'renderSelectedNodes'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 3 Nov 2022 02:34:57 +0000 (19:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 4 Nov 2022 01:14:25 +0000 (18:14 -0700)
Squashes two compiler warnings:

  topviewfuncs.c: In function ‘renderSelectedNodes’:
  topviewfuncs.c:283:41: warning: conversion from ‘double’ to ‘GLfloat’ {aka
    ‘float’} may change value [-Wfloat-conversion]
    283 |             glVertex3f(pos.x,pos.y,pos.z+0.001);
        |                                    ~~~~~^~~~~~
  topviewfuncs.c:285:50: warning: conversion from ‘double’ to ‘float’ may
    change value [-Wfloat-conversion]
    285 |             drawCircle(pos.x,pos.y,nodeSize,pos.z+0.001);
        |                                             ~~~~~^~~~~~

cmd/smyrna/topviewfuncs.c

index 23a9165de7025ac39742d47297e2c0b3088a52c2..75df1bf5b2f57eb4ccb64683a572acab4ceba062 100644 (file)
@@ -280,9 +280,9 @@ static void renderSelectedNodes(Agraph_t * g)
        nodeSize = ND_size(v);
 
        if (defaultNodeShape == 0) 
-           glVertex3f(pos.x,pos.y,pos.z+0.001);
+           glVertex3f(pos.x, pos.y, pos.z + 0.001f);
        else if (defaultNodeShape == 1) 
-           drawCircle(pos.x,pos.y,nodeSize,pos.z+0.001);
+           drawCircle(pos.x, pos.y, nodeSize, pos.z + 0.001f);
     }
     if(defaultNodeShape==0)
        glEnd();