summaryrefslogtreecommitdiffstats
path: root/src/parse.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/parse.c
parent63a52b1bfc99c58f0a944174282da79aab5bde3a (diff)
downloadbfs-526133c11eb9a26a4cffb20bcd10bcbb36d940de.tar.xz
Switch from assert() to bfs_assert()/bfs_verify()
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/parse.c b/src/parse.c
index 807892c..1a04e68 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -29,7 +29,6 @@
#include "xregex.h"
#include "xspawn.h"
#include "xtime.h"
-#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
@@ -134,7 +133,7 @@ static struct bfs_expr *new_unary_expr(bfs_eval_fn *eval_fn, struct bfs_expr *rh
expr->lhs = NULL;
expr->rhs = rhs;
- assert(bfs_expr_is_parent(expr));
+ bfs_assert(bfs_expr_is_parent(expr));
expr->persistent_fds = rhs->persistent_fds;
expr->ephemeral_fds = rhs->ephemeral_fds;
@@ -154,7 +153,7 @@ static struct bfs_expr *new_binary_expr(bfs_eval_fn *eval_fn, struct bfs_expr *l
expr->lhs = lhs;
expr->rhs = rhs;
- assert(bfs_expr_is_parent(expr));
+ bfs_assert(bfs_expr_is_parent(expr));
expr->persistent_fds = lhs->persistent_fds + rhs->persistent_fds;
if (lhs->ephemeral_fds > rhs->ephemeral_fds) {
@@ -263,7 +262,7 @@ static void init_highlight(const struct bfs_ctx *ctx, bool *args) {
static void highlight_args(const struct bfs_ctx *ctx, char **argv, size_t argc, bool *args) {
size_t i = argv - ctx->argv;
for (size_t j = 0; j < argc; ++j) {
- assert(i + j < ctx->argc);
+ bfs_assert(i + j < ctx->argc);
args[i + j] = true;
}
}