]> granicus.if.org Git - graphviz/commitdiff
emit_end_edge: squash C4244 MSVC warnings for 'nodeIntersect' calls
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Mar 2022 20:50:43 +0000 (13:50 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Mar 2022 05:28:30 +0000 (22:28 -0700)
MSVC seems particularly pedantic about implicitly converting an unsigned 1-bit
bitfield to a bool:

  warning C4244: 'function': conversion from 'unsigned int' to 'bool'

These bitfields should really be signed (`int`) but it does not seem worth the
API break to do this.

lib/common/emit.c

index 0e47c7bf1aa7968fca28ca8892fd5ac82bbc4ab5..1826e82a9914c0822030369133a987493e220da6 100644 (file)
@@ -2783,8 +2783,8 @@ static void emit_end_edge(GVJ_t * job)
            p = bz.sp;
        else /* No arrow at start of splines */
            p = bz.list[0];
-       nodeIntersect (job, p, obj->explicit_tailurl, obj->tailurl,
-           obj->explicit_tailtooltip);
+       nodeIntersect(job, p, obj->explicit_tailurl != 0, obj->tailurl,
+                     obj->explicit_tailtooltip != 0);
         
        /* process intersection with head node */
        bz = ED_spl(e)->list[ED_spl(e)->size - 1];
@@ -2792,8 +2792,8 @@ static void emit_end_edge(GVJ_t * job)
            p = bz.ep;
        else /* No arrow at end of splines */
            p = bz.list[bz.size - 1];
-       nodeIntersect (job, p, obj->explicit_headurl, obj->headurl,
-           obj->explicit_headtooltip);
+       nodeIntersect(job, p, obj->explicit_headurl != 0, obj->headurl,
+                     obj->explicit_headtooltip != 0);
     }
 
     emit_edge_label(job, ED_label(e), EMIT_ELABEL,