]> granicus.if.org Git - graphviz/commitdiff
neatogen vpscAdjust: use cgraph wrappers for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Nov 2022 01:14:41 +0000 (17:14 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 25 Nov 2022 18:30:51 +0000 (10:30 -0800)
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

index f03b09188a1b954ef0884a11e9ba77c3d597eca5..7f5ac060dc22cc1d89e94223a98cdc1844992d7f 100644 (file)
@@ -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) {