From 2ec6c55d1ff3c58dc0057bda80ed6879c83ee230 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 6 Oct 2022 19:37:52 -0700 Subject: [PATCH] neatogen print_bounding_box: 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/overlap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/neatogen/overlap.c b/lib/neatogen/overlap.c index 7d6b3fead..a023677f8 100644 --- a/lib/neatogen/overlap.c +++ b/lib/neatogen/overlap.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -507,11 +506,10 @@ static void scale_to_edge_length(int dim, SparseMatrix A, double *x, double avg_ } static void print_bounding_box(int n, int dim, double *x){ - double *xmin, *xmax; int i, k; - xmin = N_GNEW(dim,double); - xmax = N_GNEW(dim,double); + double *xmin = gv_calloc(dim, sizeof(double)); + double *xmax = gv_calloc(dim, sizeof(double)); for (i = 0; i < dim; i++) xmin[i]=xmax[i] = x[i]; -- 2.40.0