]> granicus.if.org Git - graphviz/commitdiff
ccomps: remove 'N_NEW' that was only used in one place
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 31 Jul 2022 16:30:26 +0000 (09:30 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Aug 2022 01:01:38 +0000 (18:01 -0700)
This brings us one step closer to having a single `N_NEW` macro in the tree and
not having to constantly wonder which of the `N_NEW` definitions is in scope at
any point where you see it called.

cmd/tools/ccomps.c

index 1501df65a52a814673985fecaeb316f6dd9d16c7..b508afe1531d2507e5bc331d21a35221a710fa3c 100644 (file)
@@ -29,8 +29,6 @@
 #include <cgraph/unreachable.h>
 #include <cgraph/exit.h>
 
-#define N_NEW(n,t) gv_calloc((n), sizeof(t))
-
 typedef struct {
     Agrec_t h;
     char cc_subg;   /* true iff subgraph corresponds to a component */
@@ -497,7 +495,7 @@ static int cmp(Agraph_t** p0, Agraph_t** p1)
 static void
 printSorted (Agraph_t* root, int c_cnt)
 {
-    Agraph_t** ccs = N_NEW(c_cnt, Agraph_t*);
+    Agraph_t** ccs = gv_calloc(c_cnt, sizeof(Agraph_t*));
     Agraph_t* subg;
     int i = 0, endi;