#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
Agnode_t *h;
ND_mark(t) = 1;
- ND_onstack(t) = 1;
+ ND_onstack(t) = true;
for (e = agfstout(g, t); e; e = f) {
f = agnxtout(g, e);
if (agtail(e) == aghead(e))
} else if (ND_mark(h) == 0)
hasCycle |= dfs(g, h, hasCycle);
}
- ND_onstack(t) = 0;
+ ND_onstack(t) = false;
return hasCycle;
}
*/
#include <common/render.h>
+#include <stdbool.h>
static void dfs_cutval(node_t * v, edge_t * par);
static int dfs_range(node_t * v, edge_t * par, int low);
if (ND_mark(n))
return 0;
ND_mark(n) = TRUE;
- ND_onstack(n) = TRUE;
+ ND_onstack(n) = true;
for (i = 0; (e = ND_out(n).list[i]); i++) {
w = aghead(e);
if (ND_onstack(w)) {
}
}
}
- ND_onstack(n) = FALSE;
+ ND_onstack(n) = false;
return 0;
}
void check_cycles(graph_t * g)
{
node_t *n;
- for (n = GD_nlist(g); n; n = ND_next(n))
- ND_mark(n) = ND_onstack(n) = FALSE;
+ for (n = GD_nlist(g); n; n = ND_next(n)) {
+ ND_mark(n) = FALSE;
+ ND_onstack(n) = false;
+ }
for (n = GD_nlist(g); n; n = ND_next(n))
checkdfs(g, n);
}
*/
#include <dotgen/dot.h>
+#include <stdbool.h>
void reverse_edge(edge_t * e)
{
if (ND_mark(n))
return;
ND_mark(n) = TRUE;
- ND_onstack(n) = TRUE;
+ ND_onstack(n) = true;
for (i = 0; (e = ND_out(n).list[i]); i++) {
w = aghead(e);
if (ND_onstack(w)) {
dfs(w);
}
}
- ND_onstack(n) = FALSE;
+ ND_onstack(n) = false;
}
adjmatrix_t *M = GD_rank(g)[ND_rank(v)].flat;
ND_mark(v) = TRUE;
- ND_onstack(v) = TRUE;
+ ND_onstack(v) = true;
hascl = GD_n_cluster(dot_root(g)) > 0;
if (ND_flat_out(v).list)
for (i = 0; (e = ND_flat_out(v).list[i]); i++) {
flat_search(g, aghead(e));
}
}
- ND_onstack(v) = FALSE;
+ ND_onstack(v) = false;
}
static void flat_breakcycles(graph_t * g)
flat = 0;
for (i = 0; i < GD_rank(g)[r].n; i++) {
v = GD_rank(g)[r].v[i];
- ND_mark(v) = ND_onstack(v) = FALSE;
+ ND_mark(v) = FALSE;
+ ND_onstack(v) = false;
flatindex(v) = i;
if (ND_flat_out(v).size > 0 && flat == 0) {
GD_rank(g)[r].flat =
if (ND_mark(v))
return;
ND_mark(v) = TRUE;
- ND_onstack(v) = TRUE;
+ ND_onstack(v) = true;
for (e = agfstout(g, v); e; e = f) {
f = agnxtout(g, e);
w = aghead(e);
dfs(g, w);
}
}
- ND_onstack(v) = FALSE;
+ ND_onstack(v) = false;
}
static void break_cycles(graph_t * g)
{
node_t *n;
- for (n = agfstnode(g); n; n = agnxtnode(g, n))
- ND_mark(n) = ND_onstack(n) = FALSE;
+ for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
+ ND_mark(n) = FALSE;
+ ND_onstack(n) = false;
+ }
for (n = agfstnode(g); n; n = agnxtnode(g, n))
dfs(g, n);
}
np = nodes[i];
ND_mark(np) = TRUE;
- ND_onstack(np) = TRUE;
+ ND_onstack(np) = true;
for (e = 1; e < graph[i].nedges; e++) {
if (graph[i].edists[e] == 1.0) continue; /* in edge */
j = graph[i].edges[e];
else if (!ND_mark(hp)) dfsCycle(graph, j, mode, nodes);
}
- ND_onstack(np) = FALSE;
+ ND_onstack(np) = false;
}
/* acyclic:
for (i = 0; i < nv; i++) {
np = nodes[i];
ND_mark(np) = FALSE;
- ND_onstack(np) = FALSE;
+ ND_onstack(np) = false;
}
for (i = 0; i < nv; i++) {
if (ND_mark(nodes[i])) continue;