]> granicus.if.org Git - graphviz/commitdiff
ortho construct_trapezoids: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Sep 2022 18:00:14 +0000 (11:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Sep 2022 23:32:29 +0000 (16:32 -0700)
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/ortho/trapezoid.c

index 8ea4358b9a6cc7168cd1df2539e584e865f0f563..1363ea6facae80065af3a9531e1f8550c8738db9 100644 (file)
 
 
 #include "config.h"
-
+#include <cgraph/alloc.h>
 #include <string.h>
 #include <assert.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <math.h>
 #include <common/geom.h>
-#include <common/memory.h>
 #include <common/types.h>
 #include <ortho/trap.h>
 
@@ -1028,7 +1027,7 @@ construct_trapezoids(int nseg, segment_t* seg, int* permute, int ntraps,
 
     QSIZE = 2*ntraps;
     TRSIZE = ntraps;
-    qs = N_NEW (2*ntraps, qnode_t);
+    qs = gv_calloc(2 * ntraps, sizeof(qnode_t));
     q_idx = tr_idx = 1;
     memset(tr, 0, ntraps*sizeof(trap_t));