From 6fff2085000348a74f6124a31b737f48b620bc22 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 5 Feb 2022 18:13:52 +1100 Subject: [PATCH] lib/pack: [nfc] remove open coded NULLs --- lib/pack/ccomps.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/pack/ccomps.c b/lib/pack/ccomps.c index 05fde42be..2aff0e848 100644 --- a/lib/pack/ccomps.c +++ b/lib/pack/ccomps.c @@ -201,7 +201,7 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, bool *pinned) size_t c_cnt = 0; char buffer[SMALLBUF]; char *name; - Agraph_t *out = 0; + Agraph_t *out = NULL; Agnode_t *n; Agraph_t **ccs; size_t len; @@ -214,7 +214,7 @@ Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, bool *pinned) if (agnnodes(g) == 0) { *ncc = 0; - return 0; + return NULL; } name = setPrefix (pfx, &len, buffer, SMALLBUF); @@ -305,7 +305,7 @@ Agraph_t **ccomps(Agraph_t * g, int *ncc, char *pfx) if (agnnodes(g) == 0) { *ncc = 0; - return 0; + return NULL; } name = setPrefix (pfx, &len, buffer, SMALLBUF); @@ -369,7 +369,7 @@ dnodeOf (Agnode_t* v) if (ip) return ip->ptr.n; fprintf (stderr, "nodeinfo undefined\n"); - return 0; + return NULL; } void dnodeSet (Agnode_t* v, Agnode_t* n) @@ -432,7 +432,7 @@ static Agraph_t *deriveGraph(Agraph_t * g) Agnode_t *dn; Agnode_t *n; - dg = agopen("dg", Agstrictundirected, (Agdisc_t *) 0); + dg = agopen("dg", Agstrictundirected, NULL); deriveClusters (dg, g); @@ -455,9 +455,9 @@ static Agraph_t *deriveGraph(Agraph_t * g) if (hd == tl) continue; if (hd > tl) - agedge(dg, tl, hd, 0, 1); + agedge(dg, tl, hd, NULL, 1); else - agedge(dg, hd, tl, 0, 1); + agedge(dg, hd, tl, NULL, 1); } } @@ -543,14 +543,14 @@ mapClust(Agraph_t *cl) */ static Agraph_t *projectG(Agraph_t * subg, Agraph_t * g, int inCluster) { - Agraph_t *proj = 0; + Agraph_t *proj = NULL; Agnode_t *n; Agnode_t *m; orig_t *op; for (n = agfstnode(subg); n; n = agnxtnode(subg, n)) { if ((m = agfindnode(g, agnameof(n)))) { - if (proj == 0) { + if (proj == NULL) { proj = agsubg(g, agnameof(subg), 1); } agsubnode(proj, m, 1); @@ -626,7 +626,7 @@ Agraph_t **cccomps(Agraph_t * g, int *ncc, char *pfx) if (agnnodes(g) == 0) { *ncc = 0; - return 0; + return NULL; } /* Bind ccgraphinfo to graph and all subgraphs */ -- 2.40.0