From: Matthew Fernandez Date: Wed, 22 Jun 2022 03:39:44 +0000 (-0700) Subject: remove unnecessary 'dtlink' casts X-Git-Tag: 5.0.0~17^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b098147f15b679f3647f08e73d1f1d40d05219aa;p=graphviz remove unnecessary 'dtlink' casts --- diff --git a/cmd/tools/gvpack.cpp b/cmd/tools/gvpack.cpp index 9a8be9564..5d01991b6 100644 --- a/cmd/tools/gvpack.cpp +++ b/cmd/tools/gvpack.cpp @@ -439,7 +439,7 @@ fillGraph(Agraph_t * g, Dt_t * d, Agsym_t *(*setf)(Agraph_t*, char*, const char*), size_t cnt) { attr_t *av; for (av = (attr_t *) dtflatten(d); av; - av = (attr_t *) dtlink(d, (Dtlink_t *) av)) { + av = (attr_t *)dtlink(d, av)) { if (cnt == av->cnt) setf(g, av->name, av->value); else diff --git a/lib/circogen/edgelist.c b/lib/circogen/edgelist.c index a3ebf6a9e..be0d1e57f 100644 --- a/lib/circogen/edgelist.c +++ b/lib/circogen/edgelist.c @@ -82,7 +82,7 @@ void print_edge(edgelist * list) Agedge_t *ep; for (temp = (edgelistitem *) dtflatten(list); temp; - temp = (edgelistitem *) dtlink(list, (Dtlink_t *) temp)) { + temp = (edgelistitem *)dtlink(list, temp)) { ep = temp->edge; fprintf(stderr, "%s--", agnameof(agtail(ep))); fprintf(stderr, "%s \n", agnameof(aghead(ep))); diff --git a/lib/common/htmlparse.y b/lib/common/htmlparse.y index 4304979a1..998e30712 100644 --- a/lib/common/htmlparse.y +++ b/lib/common/htmlparse.y @@ -196,7 +196,7 @@ appendFLineList (int v) ln->lp.items = N_NEW(cnt, textspan_t); fi = (fitem*)dtflatten(ilist); - for (; fi; fi = (fitem*)dtlink(fitemList,(Dtlink_t*)fi)) { + for (; fi; fi = (fitem*)dtlink(fitemList, fi)) { /* NOTE: When fitemList is closed, it uses free_item, which only frees the container, * not the contents, so this copy is safe. */ diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index a444d7ef8..59ed11d23 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -1218,12 +1218,12 @@ static int processTbl(graph_t * g, htmltbl_t * tbl, htmlenv_t * env) while (cp) { cellp = cp->u.cp; cnt++; - cp = (pitem *) dtlink(cdict, (Dtlink_t *) cp); + cp = (pitem *)dtlink(cdict, cp); } if (rp->ruled) { addIntSet(is, r + 1); } - rp = (pitem *) dtlink(rows, (Dtlink_t *) rp); + rp = (pitem *)dtlink(rows, rp); r++; } @@ -1246,9 +1246,9 @@ static int processTbl(graph_t * g, htmltbl_t * tbl, htmlenv_t * env) n_rows = MAX(r + cellp->rspan, n_rows); if (inIntSet(is, r + cellp->rspan)) cellp->ruled |= HTML_HRULE; - cp = (pitem *) dtlink(cdict, (Dtlink_t *) cp); + cp = (pitem *)dtlink(cdict, cp); } - rp = (pitem *) dtlink(rows, (Dtlink_t *) rp); + rp = (pitem *)dtlink(rows, rp); r++; } tbl->rc = n_rows; diff --git a/lib/common/pointset.c b/lib/common/pointset.c index f7cafb21c..09f1862ad 100644 --- a/lib/common/pointset.c +++ b/lib/common/pointset.c @@ -122,7 +122,7 @@ point *pointsOf(PointSet * ps) point *pp = pts; for (p = (pair *) dtflatten(ps); p; - p = (pair *) dtlink(ps, (Dtlink_t *) p)) { + p = (pair *)dtlink(ps, p)) { *pp++ = p->id; } diff --git a/lib/neatogen/constraint.c b/lib/neatogen/constraint.c index ba5e301d2..a6ad8caa1 100644 --- a/lib/neatogen/constraint.c +++ b/lib/neatogen/constraint.c @@ -216,8 +216,7 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list, graph_t *cg = agopen("cg", Agstrictdirected, NULL); agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); // graph custom data - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { n = agnode(cg, agnameof(p->np), 1); /* FIX */ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data ND_alg(n) = p; @@ -231,10 +230,8 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list, lastn = GD_nlist(cg) = n; } } - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { - for (nxp = (nitem *) dtlink(link, (Dtlink_t *) p); nxp; - nxp = (nitem *) dtlink(list, (Dtlink_t *) nxp)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { + for (nxp = (nitem *)dtlink(link, p); nxp; nxp = (nitem *)dtlink(list, nxp)) { e = NULL; if (intersect(p, nxp)) { double delta = dist(&p->bb, &nxp->bb); @@ -250,8 +247,7 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list, } } - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { n = p->cnode; for (e = agfstout(cg,n); e; e = agnxtout(cg,e)) { elist_append(e, ND_out(n)); @@ -287,8 +283,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, /* count distinct nodes */ cnt = 0; - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { if (oldval != p->val) { oldval = p->val; cnt++; @@ -298,8 +293,7 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, /* construct basic chain to enforce left to right order */ oldval = -INT_MAX; lcnt = 0; - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { if (oldval != p->val) { oldval = p->val; /* n = newNode (cg); */ @@ -339,28 +333,25 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, * FIX: Incremental algorithm to construct trans. reduction? */ vg = agopen("vg", Agstrictdirected, NULL); - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { n = agnode(vg, agnameof(p->np), 1); /* FIX */ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data p->vnode = n; ND_alg(n) = p; } oldval = -INT_MAX; - for (p = (nitem *) dtflatten(list); p; - p = (nitem *) dtlink(list, (Dtlink_t *) p)) { + for (p = (nitem *)dtflatten(list); p; p = (nitem *)dtlink(list, p)) { if (oldval != p->val) { /* new pos: reset nxt */ oldval = p->val; - for (nxt = (nitem *) dtlink(link, (Dtlink_t *) p); nxt; - nxt = (nitem *) dtlink(list, (Dtlink_t *) nxt)) { + for (nxt = (nitem *)dtlink(link, p); nxt; + nxt = (nitem *)dtlink(list, nxt)) { if (nxt->val != oldval) break; } if (!nxt) break; } - for (nxp = nxt; nxp; - nxp = (nitem *) dtlink(list, (Dtlink_t *) nxp)) { + for (nxp = nxt; nxp; nxp = (nitem *)dtlink(list, nxp)) { if (intersect(p, nxp)) agedge(vg, p->vnode, nxp->vnode, NULL, 1); }