From ca5f260af45e673a7fd488b653a885bf4ee4bf3b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 17 Nov 2022 17:14:41 -0800 Subject: [PATCH] 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. --- lib/neatogen/adjust.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) { -- 2.40.0