]> granicus.if.org Git - graphviz/commitdiff
fdpgen makeClustObs: use cgraph wrappers for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Nov 2022 01:14:41 +0000 (17:14 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Nov 2022 04:27:54 +0000 (20:27 -0800)
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/fdpgen/clusteredges.c

index 1971560d8c382ca5854387f01eef60effad6505f..8789925a6cf8c6c646e8a8a660e66f51e5e033ff 100644 (file)
@@ -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;