From 6ca9dc119265d997db8f8e92c86625fd2f12b7a6 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 1 Sep 2022 18:51:09 -0700 Subject: [PATCH] smyrna positionAllItems: 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. --- cmd/smyrna/hier.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/smyrna/hier.c b/cmd/smyrna/hier.c index 8354232a7..d73149c41 100644 --- a/cmd/smyrna/hier.c +++ b/cmd/smyrna/hier.c @@ -8,6 +8,7 @@ * Contributors: Details at https://graphviz.org *************************************************************************/ +#include #include "smyrnadefs.h" #include "hier.h" #include @@ -63,8 +64,8 @@ void positionAllItems(Hierarchy * hp, focus_t * fs, reposition_t * parms) int i; int interval = 20; int counter = 0; /* no. of active nodes */ - double *x_coords = N_NEW(hp->nvtxs[0], double); - double *y_coords = N_NEW(hp->nvtxs[0], double); + double *x_coords = gv_calloc(hp->nvtxs[0], sizeof(double)); + double *y_coords = gv_calloc(hp->nvtxs[0], sizeof(double)); int max_level = hp->nlevels - 1; // coarsest level double width = parms->width; double height = parms->height; -- 2.40.0