From: Matthew Fernandez Date: Sun, 20 Nov 2022 20:02:53 +0000 (-0800) Subject: circogen makeDerivedNode: use cgraph wrappers for allocation X-Git-Tag: 7.0.3~2^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83cde1ac6ccf36f16f83ee67f887a11bfc5f9544;p=graphviz circogen makeDerivedNode: 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 6ecceaee9..d94e4083d 100644 --- a/lib/circogen/circularinit.c +++ b/lib/circogen/circularinit.c @@ -80,9 +80,9 @@ static node_t *makeDerivedNode(graph_t * dg, char *name, int isNode, { node_t *n = agnode(dg, name,1); agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data - ND_alg(n) = NEW(cdata); + ND_alg(n) = gv_alloc(sizeof(cdata)); if (isNode) { - ND_pos(n) = N_NEW(Ndim, double); + ND_pos(n) = gv_calloc(Ndim, sizeof(double)); ND_lw(n) = ND_lw(orig); ND_rw(n) = ND_rw(orig); ND_ht(n) = ND_ht(orig);