From b656b6b0076895e75e9ba2a1d0110bb579c2ca7c Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 16 Jan 2022 11:14:55 -0800 Subject: [PATCH] remove comparisons against 'FALSE' literal --- cmd/lefty/dot2l/dotlex.c | 4 ++-- cmd/lefty/exec.c | 2 +- lib/cgraph/flatten.c | 2 +- lib/dotgen/acyclic.c | 2 +- lib/dotgen/mincross.c | 26 +++++++++++++------------- lib/dotgen/position.c | 8 ++++---- lib/dotgen/rank.c | 2 +- lib/gvc/gvrender.c | 2 +- lib/neatogen/neatoinit.c | 2 +- lib/neatogen/overlap.c | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cmd/lefty/dot2l/dotlex.c b/cmd/lefty/dot2l/dotlex.c index 8264e057d..0fe70683c 100644 --- a/cmd/lefty/dot2l/dotlex.c +++ b/cmd/lefty/dot2l/dotlex.c @@ -269,7 +269,7 @@ static char *scan_num (char *p) { saw_digit = TRUE; *q++ = *z++; } - if ((*z == '.') && (saw_rp == FALSE)) { + if (*z == '.' && !saw_rp) { *q++ = *z++; while (isdigit (*z)) { saw_digit = TRUE; @@ -280,7 +280,7 @@ static char *scan_num (char *p) { if (saw_digit && *z && (isalpha (*z))) yyerror_text("badly formed number %s", lexbuf); - if (saw_digit == FALSE) + if (!saw_digit) z = NULL; return z; } diff --git a/cmd/lefty/exec.c b/cmd/lefty/exec.c index 48aa9430f..36f7dc745 100644 --- a/cmd/lefty/exec.c +++ b/cmd/lefty/exec.c @@ -261,7 +261,7 @@ tailrec: err (ERRNORHS, ERR4, co, TCgetnext (co, i1)); return boolop(v1o) ? Ttrue: Tfalse; case C_AND: - if (boolop (v1o) == FALSE) + if (!boolop(v1o)) return Tfalse; if ((v1o = eeval (co, TCgetnext (co, i1))) == NULL) err (ERRNORHS, ERR4, co, TCgetnext (co, i1)); diff --git a/lib/cgraph/flatten.c b/lib/cgraph/flatten.c index 0ae2194e5..a6906260b 100644 --- a/lib/cgraph/flatten.c +++ b/lib/cgraph/flatten.c @@ -34,7 +34,7 @@ void agflatten(Agraph_t * g, int flag) Agnode_t *n; if (flag) { - if (g->desc.flatlock == FALSE) { + if (!g->desc.flatlock) { dtmethod(g->n_seq,Dtlist); for (n = agfstnode(g); n; n = agnxtnode(g,n)) agflatten_edges(g, n, flag); diff --git a/lib/dotgen/acyclic.c b/lib/dotgen/acyclic.c index 1fd768c32..1cd0bffc8 100644 --- a/lib/dotgen/acyclic.c +++ b/lib/dotgen/acyclic.c @@ -43,7 +43,7 @@ dfs(node_t * n) reverse_edge(e); i--; } else { - if (ND_mark(w) == FALSE) + if (!ND_mark(w)) dfs(w); } } diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index aec5198e2..6b868cf38 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -1235,7 +1235,7 @@ static void flat_search(graph_t * g, node_t * v) assert(flatindex(aghead(e)) < M->nrows); assert(flatindex(agtail(e)) < M->ncols); ELT(M, flatindex(agtail(e)), flatindex(aghead(e))) = 1; - if (ND_mark(aghead(e)) == FALSE) + if (!ND_mark(aghead(e))) flat_search(g, aghead(e)); } } @@ -1262,7 +1262,7 @@ static void flat_breakcycles(graph_t * g) if (flat) { for (i = 0; i < GD_rank(g)[r].n; i++) { v = GD_rank(g)[r].v[i]; - if (ND_mark(v) == FALSE) + if (!ND_mark(v)) flat_search(g, v); } } @@ -1367,9 +1367,9 @@ void build_ranks(graph_t * g, int pass) edge_t *e; for (n = GD_nlist(g); n; n = ND_next(n)) { for (i = 0; (e = ND_out(n).list[i]); i++) - assert(MARK(aghead(e)) == FALSE); + assert(!MARK(aghead(e))); for (i = 0; (e = ND_in(n).list[i]); i++) - assert(MARK(agtail(e)) == FALSE); + assert(!MARK(agtail(e))); } } #endif @@ -1381,7 +1381,7 @@ void build_ranks(graph_t * g, int pass) otheredges = pass == 0 ? ND_in(n).list : ND_out(n).list; if (otheredges[0] != NULL) continue; - if (MARK(n) == FALSE) { + if (!MARK(n)) { MARK(n) = TRUE; enqueue(q, n); while ((n0 = dequeue(q))) { @@ -1421,7 +1421,7 @@ void enqueue_neighbors(nodequeue * q, node_t * n0, int pass) if (pass == 0) { for (i = 0; i < ND_out(n0).size; i++) { e = ND_out(n0).list[i]; - if ((MARK(aghead(e))) == FALSE) { + if (!MARK(aghead(e))) { MARK(aghead(e)) = TRUE; enqueue(q, aghead(e)); } @@ -1429,7 +1429,7 @@ void enqueue_neighbors(nodequeue * q, node_t * n0, int pass) } else { for (i = 0; i < ND_in(n0).size; i++) { e = ND_in(n0).list[i]; - if ((MARK(agtail(e))) == FALSE) { + if (!MARK(agtail(e))) { MARK(agtail(e)) = TRUE; enqueue(q, agtail(e)); } @@ -1458,7 +1458,7 @@ static int postorder(graph_t * g, node_t * v, node_t ** list, int r) if (ND_flat_out(v).size > 0) { for (i = 0; (e = ND_flat_out(v).list[i]); i++) { if (!constraining_flat_edge(g,v,e)) continue; - if (MARK(aghead(e)) == FALSE) + if (!MARK(aghead(e))) cnt += postorder(g, aghead(e), list + cnt, r); } } @@ -1501,7 +1501,7 @@ static void flat_reorder(graph_t * g) if ((local_in_cnt == 0) && (local_out_cnt == 0)) temprank[pos++] = v; else { - if ((MARK(v) == FALSE) && (local_in_cnt == 0)) { + if (!MARK(v) && local_in_cnt == 0) { left = temprank + pos; n_search = postorder(g, v, left, r); pos += n_search; @@ -1510,7 +1510,7 @@ static void flat_reorder(graph_t * g) } if (pos) { - if (GD_flip(g) == FALSE) { + if (!GD_flip(g)) { left = temprank; right = temprank + pos - 1; while (left < right) { @@ -1531,9 +1531,9 @@ static void flat_reorder(graph_t * g) v = GD_rank(g)[r].v[i]; if (ND_flat_out(v).list) { for (j = 0; (e = ND_flat_out(v).list[j]); j++) { - if ( ((GD_flip(g) == FALSE) && (ND_order(aghead(e)) < ND_order(agtail(e)))) || + if ( (!GD_flip(g) && ND_order(aghead(e)) < ND_order(agtail(e))) || ( (GD_flip(g)) && (ND_order(aghead(e)) > ND_order(agtail(e)) ))) { - assert(constraining_flat_edge(g,v,e) == FALSE); + assert(!constraining_flat_edge(g,v,e)); delete_flat_edge(e); j--; flat_rev(g, e); @@ -1889,7 +1889,7 @@ void check_rs(graph_t * g, int null_ok) v = GD_rank(g)[r].v[i]; if (v == NULL) { fprintf(stderr, "NULL\t"); - if (null_ok == FALSE) + if (!null_ok) abort(); } else { fprintf(stderr, "%s(%f)\t", agnameof(v), ND_mval(v)); diff --git a/lib/dotgen/position.c b/lib/dotgen/position.c index 059f01978..287407ad9 100644 --- a/lib/dotgen/position.c +++ b/lib/dotgen/position.c @@ -273,11 +273,11 @@ make_LR_constraints(graph_t * g) m1 = m0 + ND_rw(aghead(e0)) + ND_lw(agtail(e0)); /* these guards are needed because the flat edges * work very poorly with cluster layout */ - if (canreach(agtail(e0), aghead(e0)) == FALSE) + if (!canreach(agtail(e0), aghead(e0))) make_aux_edge(aghead(e0), agtail(e0), m1, ED_weight(e)); m1 = m0 + ND_rw(agtail(e1)) + ND_lw(aghead(e1)); - if (canreach(aghead(e1), agtail(e1)) == FALSE) + if (!canreach(aghead(e1), agtail(e1))) make_aux_edge(agtail(e1), aghead(e1), m1, ED_weight(e)); } @@ -513,7 +513,7 @@ static void compress_graph(graph_t * g) if (p.x * p.y <= 1) return; contain_nodes(g); - if (GD_flip(g) == FALSE) + if (!GD_flip(g)) x = p.x; else x = p.y; @@ -1140,7 +1140,7 @@ static void expand_leaves(graph_t * g) if ((d = ND_rank(aghead(e)) - ND_rank(aghead(e))) == 0) continue; f = ED_to_orig(e); - if (ports_eq(e, f) == FALSE) { + if (!ports_eq(e, f)) { zapinlist(&(ND_other(n)), e); if (d == 1) fast_edge(e); diff --git a/lib/dotgen/rank.c b/lib/dotgen/rank.c index efb0607f3..e420d144a 100644 --- a/lib/dotgen/rank.c +++ b/lib/dotgen/rank.c @@ -945,7 +945,7 @@ static void dfs(graph_t * g, node_t * v) if (ND_onstack(w)) reverse_edge2(g, e); else { - if (ND_mark(w) == FALSE) + if (!ND_mark(w)) dfs(g, w); } } diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index e6c057ec6..53d18a249 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -820,7 +820,7 @@ void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n, b.UR.y = d; } if (gvre) { - gvloadimage(job, us, b, filled != FALSE, job->render.type); + gvloadimage(job, us, b, filled, job->render.type); } } diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index a8c8c57bb..d1d9b0386 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -720,7 +720,7 @@ dfsCycle (vtx_data* graph, int i,int mode, node_t* nodes[]) assert (f < graph[j].nedges); graph[j].edists[f] = -1.0; } - else if (ND_mark(hp) == FALSE) dfsCycle(graph, j, mode, nodes); + else if (!ND_mark(hp)) dfsCycle(graph, j, mode, nodes); } ND_onstack(np) = FALSE; diff --git a/lib/neatogen/overlap.c b/lib/neatogen/overlap.c index c3d8ebee1..7c35ed755 100644 --- a/lib/neatogen/overlap.c +++ b/lib/neatogen/overlap.c @@ -607,7 +607,7 @@ void remove_overlap(int dim, SparseMatrix A, double *x, double *label_sizes, int if (check_convergence(max_overlap, res, has_penalty_terms, epsilon)){ OverlapSmoother_delete(sm); - if (neighborhood_only == FALSE){ + if (!neighborhood_only){ break; } else { res = LARGE; -- 2.40.0