]> granicus.if.org Git - graphviz/commitdiff
suppress two compiler warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Aug 2020 17:14:19 +0000 (10:14 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 22 Aug 2020 16:00:26 +0000 (09:00 -0700)
Commits 02d2cacf8730f1e4347afd72b159c91fafed2182 and
80a9dc3a3d7a1bff49db3f8e40fc03e91ca2261e accidentally introduced two new
compiler warnings to the build. Following this change, the CMake build returns
to warning-free on Linux with GCC 8.3.0. The Autotools build still sprays
warnings, but I think it's worth taking proactive steps like this to never
introduce new warnings.

Though this change looks like it has a semantic effect, it does not. The base
member of these structs is the first member, used as an inheritance-style
pattern.

plugin/core/gvrender_core_dot.c

index c9f4338b9839164e4a49946ab1e2d16c4d981078..1e72e552320ba02b4095bdb3e5138300fe605419 100644 (file)
@@ -257,7 +257,7 @@ static void xdot_style (GVJ_t *job)
  * @param sym Symbol to set
  * @param value Unescaped string
  */
-static void put_escaping_backslashes(Agnode_t* n, Agsym_t *sym, const char *value)
+static void put_escaping_backslashes(Agobj_t* n, Agsym_t *sym, const char *value)
 {
     agxbuf buf;
 
@@ -285,7 +285,7 @@ static void xdot_end_node(GVJ_t* job)
     if (agxblen(xbufs[EMIT_NDRAW]))
        agxset(n, xd->n_draw, agxbuse(xbufs[EMIT_NDRAW]));
     if (agxblen(xbufs[EMIT_NLABEL]))
-       put_escaping_backslashes(n, xd->n_l_draw, agxbuse(xbufs[EMIT_NLABEL]));
+       put_escaping_backslashes(&n->base, xd->n_l_draw, agxbuse(xbufs[EMIT_NLABEL]));
     penwidth[EMIT_NDRAW] = 1;
     penwidth[EMIT_NLABEL] = 1;
     textflags[EMIT_NDRAW] = 0;
@@ -303,7 +303,7 @@ static void xdot_end_edge(GVJ_t* job)
     if (agxblen(xbufs[EMIT_HDRAW]))
        agxset(e, xd->h_draw, agxbuse(xbufs[EMIT_HDRAW]));
     if (agxblen(xbufs[EMIT_ELABEL]))
-       put_escaping_backslashes(e, xd->e_l_draw, agxbuse(xbufs[EMIT_ELABEL]));
+       put_escaping_backslashes(&e->base, xd->e_l_draw, agxbuse(xbufs[EMIT_ELABEL]));
     if (agxblen(xbufs[EMIT_TLABEL]))
        agxset(e, xd->tl_draw, agxbuse(xbufs[EMIT_TLABEL]));
     if (agxblen(xbufs[EMIT_HLABEL]))
@@ -515,7 +515,7 @@ static void xdot_end_graph(graph_t* g)
        agxset(g, xd->g_draw, agxbuse(xbufs[EMIT_GDRAW]));
     }
     if (GD_label(g))
-       put_escaping_backslashes(g, xd->g_l_draw, agxbuse(xbufs[EMIT_GLABEL]));
+       put_escaping_backslashes(&g->base, xd->g_l_draw, agxbuse(xbufs[EMIT_GLABEL]));
     agsafeset (g, "xdotversion", xd->version_s, "");
 
     for (i = 0; i < NUMXBUFS; i++)