]> granicus.if.org Git - graphviz/commitdiff
remove comparisons against 'FALSE' literal
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 16 Jan 2022 19:14:55 +0000 (11:14 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 20 Jan 2022 02:14:39 +0000 (18:14 -0800)
cmd/lefty/dot2l/dotlex.c
cmd/lefty/exec.c
lib/cgraph/flatten.c
lib/dotgen/acyclic.c
lib/dotgen/mincross.c
lib/dotgen/position.c
lib/dotgen/rank.c
lib/gvc/gvrender.c
lib/neatogen/neatoinit.c
lib/neatogen/overlap.c

index 8264e057da0e2bb5757f79dfad7b8cc552332182..0fe70683c1d58b043f3907a1f9f79bd26cee9537 100644 (file)
@@ -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;
 }
index 48aa9430f9c247e2d695ca21bf352cb35a1a8d65..36f7dc745641e0f88e2e395ef2a1fd4686711e7d 100644 (file)
@@ -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));
index 0ae2194e5236e4b1415a139d9dc2e5bf127756db..a6906260b8024d169be9d0b9098774b12cbfb4d1 100644 (file)
@@ -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);
index 1fd768c32335ba3322bf982778c174366e77aa07..1cd0bffc8b271c1a1921fd6f61a02ce478ad0c68 100644 (file)
@@ -43,7 +43,7 @@ dfs(node_t * n)
            reverse_edge(e);
            i--;
        } else {
-           if (ND_mark(w) == FALSE)
+           if (!ND_mark(w))
                dfs(w);
        }
     }
index aec5198e2c004992bead56791178f479b92f1aca..6b868cf38eff96bca7fe570448a365e7c722bf63 100644 (file)
@@ -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));
index 059f019788000ead20f3cffa224280ace45d1fea..287407ad97f93790148d6673b60869ec26750ab4 100644 (file)
@@ -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);
index efb0607f36529ad5cd42b44505c92dae87e01090..e420d144aaa695f84ff3cf24a758ed7c097b9aee 100644 (file)
@@ -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);
        }
     }
index e6c057ec6e710c40912359b532e57914e878af5f..53d18a249b915d53a8d9eda59a39441fa0c1718a 100644 (file)
@@ -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);
     }
 }
 
index a8c8c57bb9598433d49dcfc108502a22d836b793..d1d9b0386f88607ca00665b685407c9a6980516c 100644 (file)
@@ -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;
index c3d8ebee195361927a66044c115b5811fad55fd2..7c35ed755fc893884bfa15766ad0070315c662e2 100644 (file)
@@ -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;