]> granicus.if.org Git - graphviz/commitdiff
mingle: cast 'name' parameter values in 'agattr' calls
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Dec 2021 19:31:51 +0000 (11:31 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 4 Jan 2022 15:58:16 +0000 (07:58 -0800)
This has no effect at present. However, when moving this code to C++ in an
upcoming commit, it would trigger -Wwrite-strings warnings. This change
pre-emptively prevents these warnings.

cmd/mingle/minglemain.c

index 4208425cefc2bec62666b0524a4993d94a6b92d3..61ac6b2274625975c6743c24887a0447ebdec357 100644 (file)
@@ -326,8 +326,8 @@ genBundleColors (pedge edge, agxbuf* xb, double maxwgt)
 static void
 export_dot (FILE* fp, int ne, pedge *edges, Agraph_t* g)
 {
-       Agsym_t* epos = agattr (g, AGEDGE, "pos", "");
-       Agsym_t* esects = agattr (g, AGEDGE, "bundle", "");
+       Agsym_t* epos = agattr(g, AGEDGE, (char*)"pos", "");
+       Agsym_t* esects = agattr(g, AGEDGE, (char*)"bundle", "");
        Agsym_t* eclrs = NULL;
        Agnode_t* n;
        Agedge_t* e;
@@ -359,7 +359,7 @@ export_dot (FILE* fp, int ne, pedge *edges, Agraph_t* g)
                        agxset (e, esects, agxbuse(&xbuf));
 
                        if (edge->wgts) {
-                               if (!eclrs) eclrs = agattr (g, AGEDGE, "color", "");
+                               if (!eclrs) eclrs = agattr(g, AGEDGE, (char*)"color", "");
                                genBundleColors (edge, &xbuf, maxwgt);
                                agxset (e, eclrs, agxbuse(&xbuf));
                        }