aboutsummaryrefslogtreecommitdiff
path: root/findloop.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2018-11-13 21:40:23 +0000
committerSimon Tatham <anakin@pobox.com>2018-11-13 21:48:24 +0000
commit8fb4cd031ae0bdcab133049c8683b41ac41d4000 (patch)
treeb5d3585477853a2056d27cb12a566b393fe534f1 /findloop.c
parent20b56788bc61de5b3d10c90a9fd588d373134aae (diff)
downloadpuzzles-8fb4cd031ae0bdcab133049c8683b41ac41d4000.zip
puzzles-8fb4cd031ae0bdcab133049c8683b41ac41d4000.tar.gz
puzzles-8fb4cd031ae0bdcab133049c8683b41ac41d4000.tar.bz2
puzzles-8fb4cd031ae0bdcab133049c8683b41ac41d4000.tar.xz
Adopt C99 bool in the findloop API.
This shouldn't be a disruptive change at all: findloop_run and findloop_is_loop_edge now return bool in place of int, but client code should automatically adjust without needing any changes.
Diffstat (limited to 'findloop.c')
-rw-r--r--findloop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/findloop.c b/findloop.c
index e6b2654..30c128c 100644
--- a/findloop.c
+++ b/findloop.c
@@ -37,7 +37,7 @@ void findloop_free_state(struct findloopstate *state)
sfree(state);
}
-int findloop_is_loop_edge(struct findloopstate *pv, int u, int v)
+bool findloop_is_loop_edge(struct findloopstate *pv, int u, int v)
{
/*
* Since the algorithm is intended for finding bridges, and a
@@ -56,8 +56,8 @@ int findloop_is_loop_edge(struct findloopstate *pv, int u, int v)
return !(pv[u].bridge == v || pv[v].bridge == u);
}
-int findloop_run(struct findloopstate *pv, int nvertices,
- neighbour_fn_t neighbour, void *ctx)
+bool findloop_run(struct findloopstate *pv, int nvertices,
+ neighbour_fn_t neighbour, void *ctx)
{
int u, v, w, root, index;
int nbridges, nedges;