From: Matthew Fernandez Date: Sun, 20 Nov 2022 20:02:53 +0000 (-0800) Subject: circogen circular_init_node_edge: use cgraph wrappers for allocation X-Git-Tag: 7.0.3~2^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec0fb4462349a6f2e01b1daebc57a1a31fcfbcdf;p=graphviz circogen circular_init_node_edge: use cgraph wrappers for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- diff --git a/lib/circogen/circularinit.c b/lib/circogen/circularinit.c index ecc2d571c..6ecceaee9 100644 --- a/lib/circogen/circularinit.c +++ b/lib/circogen/circularinit.c @@ -22,6 +22,7 @@ * Drawings", GD '02, LNCS 2528, pp. 12-22. */ +#include #include #include #include @@ -44,9 +45,9 @@ static void circular_init_node_edge(graph_t * g) node_t *n; edge_t *e; int i = 0; - ndata* alg = N_NEW(agnnodes(g), ndata); + ndata* alg = gv_calloc(agnnodes(g), sizeof(ndata)); - GD_neato_nlist(g) = N_NEW(agnnodes(g) + 1, node_t *); + GD_neato_nlist(g) = gv_calloc(agnnodes(g) + 1, sizeof(node_t*)); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { neato_init_node(n); ND_alg(n) = alg + i;