From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: neatogen make_barriers: use cgraph wrapper for allocation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3614ede38c91a55db638ff3c9d4cc2b7a33fccb;p=graphviz neatogen make_barriers: use cgraph wrapper 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. --- diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 1950ae6a4..487ee49b8 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -10,7 +10,7 @@ #include "config.h" - +#include #include #include #include @@ -44,7 +44,6 @@ make_barriers(Ppoly_t ** poly, int npoly, int pp, int qp, Pedge_t ** barriers, int *n_barriers) { int i, j, k, n, b; - Pedge_t *bar; n = 0; for (i = 0; i < npoly; i++) { @@ -54,7 +53,7 @@ make_barriers(Ppoly_t ** poly, int npoly, int pp, int qp, continue; n += poly[i]->pn; } - bar = N_GNEW(n, Pedge_t); + Pedge_t *bar = gv_calloc(n, sizeof(Pedge_t)); b = 0; for (i = 0; i < npoly; i++) { if (i == pp)