summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-05-18 16:44:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-05-18 16:46:13 -0400
commit526133c11eb9a26a4cffb20bcd10bcbb36d940de (patch)
tree26787e3cc22df2c44837f72f6ff919ab7808a8f6 /src/eval.c
parent63a52b1bfc99c58f0a944174282da79aab5bde3a (diff)
downloadbfs-526133c11eb9a26a4cffb20bcd10bcbb36d940de.tar.xz
Switch from assert() to bfs_assert()/bfs_verify()
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c
index 6cad3a9..342debd 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -26,7 +26,6 @@
#include "trie.h"
#include "xregex.h"
#include "xtime.h"
-#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
@@ -990,7 +989,7 @@ static bool eval_expr(struct bfs_expr *expr, struct bfs_eval *state) {
}
}
- assert(!state->quit);
+ bfs_assert(!state->quit);
bool ret = expr->eval_fn(expr, state);
@@ -1006,10 +1005,10 @@ static bool eval_expr(struct bfs_expr *expr, struct bfs_eval *state) {
}
if (bfs_expr_never_returns(expr)) {
- assert(state->quit);
+ bfs_assert(state->quit);
} else if (!state->quit) {
- assert(!expr->always_true || ret);
- assert(!expr->always_false || !ret);
+ bfs_assert(!expr->always_true || ret);
+ bfs_assert(!expr->always_false || !ret);
}
return ret;
@@ -1511,7 +1510,7 @@ static void dump_bftw_flags(enum bftw_flags flags) {
DEBUG_FLAG(flags, BFTW_SORT);
DEBUG_FLAG(flags, BFTW_BUFFER);
- assert(!flags);
+ bfs_assert(flags == 0, "Missing bftw flag 0x%X", flags);
}
/**