From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: fdpgen init_node: use cgraph wrapper for allocation X-Git-Tag: 7.0.3~7^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2e90658fd5dd094c6122e1c44b3ffc8dac51c72;p=graphviz fdpgen init_node: use cgraph wrapper 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/fdpgen/fdpinit.c b/lib/fdpgen/fdpinit.c index e76a12d12..018c5aa46 100644 --- a/lib/fdpgen/fdpinit.c +++ b/lib/fdpgen/fdpinit.c @@ -18,6 +18,7 @@ /* uses PRIVATE interface */ #define FDP_PRIVATE 1 +#include #include #include #include @@ -74,7 +75,7 @@ static void init_edge(edge_t * e, attrsym_t * E_len) static void init_node(node_t * n) { common_init_node(n); - ND_pos(n) = N_NEW(GD_ndim(agraphof(n)), double); + ND_pos(n) = gv_calloc(GD_ndim(agraphof(n)), sizeof(double)); gv_nodesize(n, GD_flip(agraphof(n))); }