From: Matthew Fernandez Date: Sun, 16 Aug 2020 17:14:19 +0000 (-0700) Subject: suppress two compiler warnings X-Git-Tag: 2.46.0~20^2^2~116^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eddf90affaf5dd349ffc1cdbf7b75df2b6c6349b;p=graphviz suppress two compiler warnings 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. --- diff --git a/plugin/core/gvrender_core_dot.c b/plugin/core/gvrender_core_dot.c index c9f4338b9..1e72e5523 100644 --- a/plugin/core/gvrender_core_dot.c +++ b/plugin/core/gvrender_core_dot.c @@ -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++)