From ec0fb4462349a6f2e01b1daebc57a1a31fcfbcdf Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 20 Nov 2022 12:02:53 -0800 Subject: [PATCH] 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. --- lib/circogen/circularinit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.40.0