]> granicus.if.org Git - graphviz/commitdiff
gvpack: cast results of 'dtmatch'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 14:56:08 +0000 (07:56 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 25 Apr 2022 02:12:48 +0000 (19:12 -0700)
This pre-emptively squashes some upcoming warnings when converting this file to
C++ which otherwise fail the CMake build:

  cmd/tools/../../lib/cdt/cdt.h:259:66: error: invalid conversion from 'void*'
    to 'pair_t*' [-fpermissive]

Gitlab: #2154

cmd/tools/gvpack.c

index fc1d809301e28cd196489872b731a84f5fe18ffe..0fad73b36a71f893d48a2d1abf1728149c1acb71 100644 (file)
@@ -435,7 +435,7 @@ static void fillDict(Dt_t * newdict, Agraph_t* g, int kind)
     for (a = agnxtattr(g,kind,0); a; a = agnxtattr(g,kind,a)) {
        name = a->name;
        value = a->defval;
-       rv = dtmatch(newdict, name);
+       rv = (attr_t*)dtmatch(newdict, name);
        if (!rv) {
            rv = NEW(attr_t);
            rv->name = name;
@@ -523,7 +523,7 @@ static char *xName(Dt_t * names, char *oldname)
     pair_t *p;
     size_t len;
 
-    p = dtmatch(names, oldname);
+    p = (pair_t*)dtmatch(names, oldname);
     if (p) {
        p->cnt++;
        len = strlen(oldname) + 100; /* 100 for "_gv" and decimal no. */