]> granicus.if.org Git - graphviz/commitdiff
gvpack: cast string literals when calling 'agfindnodeattr'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 00:23:47 +0000 (17:23 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 25 Apr 2022 02:12:48 +0000 (19:12 -0700)
This pre-emptively squashes several upcoming warnings when converting this file
to C++ which otherwise fail the CMake build:

  cmd/tools/gvpack.cpp:270:42: error: ISO C++11 does not allow conversion from
    string literal to 'char *' [-Werror,-Wwritable-strings]

Gitlab: #2154

cmd/tools/gvpack.c

index 5c57a6ef5abaf6237b2b1ae37697d9fc262d1080..132e4274ae6b62998865f565e2f164d44d4905d3 100644 (file)
@@ -264,8 +264,8 @@ static void init_node_edge(Agraph_t * g)
     node_t *n;
     edge_t *e;
     int nG = agnnodes(g);
-    attrsym_t *N_pos = agfindnodeattr(g, "pos");
-    attrsym_t *N_pin = agfindnodeattr(g, "pin");
+    attrsym_t *N_pos = agfindnodeattr(g, (char*)"pos");
+    attrsym_t *N_pin = agfindnodeattr(g, (char*)"pin");
 
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        neato_init_node(n);