]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary casts of parameters to agnameof
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Jul 2021 16:57:27 +0000 (09:57 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Jul 2021 04:58:33 +0000 (21:58 -0700)
The argument to agnameof is a void*, to which other pointers implicitly coerce.

cmd/tools/gc.c
lib/common/htmltable.c
lib/common/labels.c

index ca7e90cb1e23ed526614d71efb72d1fc05fb3005..cad89f66f31d88b7deeae8cb3c540af50f49e365 100644 (file)
@@ -230,7 +230,7 @@ static void cc_dfs(Agraph_t * g, Agnode_t * n)
 
 static void cntCluster(Agraph_t * g, Agobj_t * sg, void *arg)
 {
-    char *sgname = agnameof((Agraph_t *) sg);
+    char *sgname = agnameof(sg);
 
     if (strncmp(sgname, "cluster", 7) == 0)
        *(int *) (arg) += 1;
index 9eddd4871333ffb60e36f015130969f6315e0774..7f0a2f3b1ea1918c5f36a5d74ec3db90d1442f8a 100644 (file)
@@ -1894,10 +1894,10 @@ static char *nameOf(void *obj, agxbuf * xb)
     Agedge_t *ep;
     switch (agobjkind(obj)) {
     case AGRAPH:
-       agxbput(xb, agnameof(((Agraph_t *) obj)));
+       agxbput(xb, agnameof(obj));
        break;
     case AGNODE:
-       agxbput(xb, agnameof(((Agnode_t *) obj)));
+       agxbput(xb, agnameof(obj));
        break;
     case AGEDGE:
        ep = (Agedge_t *) obj;
index 75efd40adcc88930b83a95708b91d7ce925c9c11..a4fc64580295d6a1f74ef7b25589c3623964bca9 100644 (file)
@@ -299,7 +299,7 @@ static char *strdup_and_subst_obj0 (char *str, void *obj, int escBackslash)
     /* prepare substitution strings */
     switch (agobjkind(obj)) {
        case AGRAPH:
-           g_str = agnameof((graph_t *)obj);
+           g_str = agnameof(obj);
            tl = GD_label((graph_t *)obj);
            if (tl) {
                l_str = tl->text;
@@ -307,7 +307,7 @@ static char *strdup_and_subst_obj0 (char *str, void *obj, int escBackslash)
            break;
        case AGNODE:
            g_str = agnameof(agraphof(obj));
-           n_str = agnameof((node_t *)obj);
+           n_str = agnameof(obj);
            tl = ND_label((node_t *)obj);
            if (tl) {
                l_str = tl->text;