From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: neatogen vpscAdjust: use cgraph wrappers for allocation X-Git-Tag: 7.0.3~1^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca5f260af45e673a7fd488b653a885bf4ee4bf3b;p=graphviz neatogen vpscAdjust: 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/neatogen/adjust.c b/lib/neatogen/adjust.c index f03b09188..7f5ac060d 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -786,9 +786,9 @@ vpscAdjust(graph_t* G) enum { dim = 2 }; int nnodes = agnnodes(G); ipsep_options opt; - pointf* nsize = N_GNEW(nnodes, pointf); + pointf *nsize = gv_calloc(nnodes, sizeof(pointf)); float* coords[dim]; - float* f_storage = N_GNEW(dim * nnodes, float); + float *f_storage = gv_calloc(dim * nnodes, sizeof(float)); int i, j; Agnode_t* v; expand_t exp_margin; @@ -810,7 +810,7 @@ vpscAdjust(graph_t* G) opt.diredges = 0; opt.edge_gap = 0; opt.noverlap = 2; - opt.clusters = NEW(cluster_data); + opt.clusters = gv_alloc(sizeof(cluster_data)); exp_margin = sepFactor (G); /* Multiply by 2 since opt.gap is the gap size, not the margin */ if (exp_margin.doAdd) {