From: Matthew Fernandez Date: Fri, 18 Nov 2022 01:14:41 +0000 (-0800) Subject: fdpgen makeClustObs: use cgraph wrappers for allocation X-Git-Tag: 7.0.3~7^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf990a95b059ab6643f74065a6dbdb7c0860b7a6;p=graphviz fdpgen makeClustObs: 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. --- diff --git a/lib/fdpgen/clusteredges.c b/lib/fdpgen/clusteredges.c index 1971560d8..8789925a6 100644 --- a/lib/fdpgen/clusteredges.c +++ b/lib/fdpgen/clusteredges.c @@ -98,14 +98,14 @@ static void resetObjlist(objlist * l) */ static Ppoly_t *makeClustObs(graph_t * g, expand_t* pm) { - Ppoly_t *obs = NEW(Ppoly_t); + Ppoly_t *obs = gv_alloc(sizeof(Ppoly_t)); boxf bb; boxf newbb; Ppoint_t ctr; bb = GD_bb(g); obs->pn = 4; - obs->ps = N_NEW(4, Ppoint_t); + obs->ps = gv_calloc(4, sizeof(Ppoint_t)); ctr.x = (bb.UR.x + bb.LL.x) / 2.0; ctr.y = (bb.UR.y + bb.LL.y) / 2.0;