From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: neatogen mkCtrlPts: use cgraph wrapper for allocation X-Git-Tag: 7.0.3~11^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b81a96a42171bfa94302e98345b38882b7881f62;p=graphviz neatogen mkCtrlPts: 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/multispline.c b/lib/neatogen/multispline.c index 7d6c92f65..ec3b963d5 100644 --- a/lib/neatogen/multispline.c +++ b/lib/neatogen/multispline.c @@ -338,7 +338,6 @@ static int ctrlPtIdx(pointf v, Ppoly_t * polys) static pointf *mkCtrlPts(int s, int mult, pointf prev, pointf v, pointf nxt, tripoly_t * trip) { - pointf *ps; int idx = ctrlPtIdx(v, &(trip->poly)); int i; double d, sep, theta, sinTheta, cosTheta; @@ -347,7 +346,7 @@ static pointf *mkCtrlPts(int s, int mult, pointf prev, pointf v, if (idx < 0) return NULL; - ps = N_GNEW(mult, pointf); + pointf *ps = gv_calloc(mult, sizeof(pointf)); theta = bisect(prev, v, nxt); sinTheta = sin(theta); cosTheta = cos(theta);