From: Matthew Fernandez Date: Sat, 3 Jul 2021 16:57:27 +0000 (-0700) Subject: remove unnecessary casts of parameters to agnameof X-Git-Tag: 2.48.0~7^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59a655b9823193c3ab8a03efd4ac8c4a295c5935;p=graphviz remove unnecessary casts of parameters to agnameof The argument to agnameof is a void*, to which other pointers implicitly coerce. --- diff --git a/cmd/tools/gc.c b/cmd/tools/gc.c index ca7e90cb1..cad89f66f 100644 --- a/cmd/tools/gc.c +++ b/cmd/tools/gc.c @@ -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; diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 9eddd4871..7f0a2f3b1 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -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; diff --git a/lib/common/labels.c b/lib/common/labels.c index 75efd40ad..a4fc64580 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -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;