]> granicus.if.org Git - graphviz/commitdiff
initAnchor: squash C4244 MSVC warning for 'explicit_tooltip'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Mar 2022 21:05:35 +0000 (14:05 -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/htmltable.c

index e8795ea168a5237ca9786de910439662f1b7eaa2..644476aa1fbcf7cac2b4eb9fcd25f39da543e579 100644 (file)
@@ -385,7 +385,7 @@ initAnchor(GVJ_t * job, htmlenv_t * env, htmldata_t * data, boxf b,
     save->tooltip = obj->tooltip;
     save->target = obj->target;
     save->id = obj->id;
-    save->explicit_tooltip = obj->explicit_tooltip;
+    save->explicit_tooltip = obj->explicit_tooltip != 0;
     id = data->id;
     if (!id || !*id) {         /* no external id, so use the internal one */
        agxbinit(&xb, SMALLBUF, buf);