From: Matthew Fernandez Date: Fri, 2 Sep 2022 01:51:33 +0000 (-0700) Subject: smyrna initFocus: use cgraph wrapper for allocations X-Git-Tag: 6.0.1~13^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dff743ffd0acc4f1eb35216d8d620b83a76200c7;p=graphviz smyrna initFocus: use cgraph wrapper for allocations 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/cmd/smyrna/hier.c b/cmd/smyrna/hier.c index d73149c41..6cdf6b7c5 100644 --- a/cmd/smyrna/hier.c +++ b/cmd/smyrna/hier.c @@ -13,7 +13,6 @@ #include "hier.h" #include #include -#include /* scale_coords: */ @@ -195,10 +194,10 @@ Hierarchy *makeHier(int nn, int ne, v_data * graph, double *x_coords, focus_t *initFocus(int ncnt) { - focus_t *fs = NEW(focus_t); + focus_t *fs = gv_alloc(sizeof(focus_t)); fs->num_foci = 0; - fs->foci_nodes = N_NEW(ncnt, int); - fs->x_foci = N_NEW(ncnt, double); - fs->y_foci = N_NEW(ncnt, double); + fs->foci_nodes = gv_calloc(ncnt, sizeof(int)); + fs->x_foci = gv_calloc(ncnt, sizeof(double)); + fs->y_foci = gv_calloc(ncnt, sizeof(double)); return fs; }