summaryrefslogtreecommitdiffstats
path: root/diag.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-12-02 10:06:53 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-12-02 10:06:53 -0500
commitbdef1cd0bb00251bf92e6a545bb6e0f2dc2814a5 (patch)
tree1d84e62abf5bfa01a04bca8b7305b78bb96880b2 /diag.c
parentbec07dfca5caefea28f20c7ce6c4a80c70cc6944 (diff)
downloadbfs-bdef1cd0bb00251bf92e6a545bb6e0f2dc2814a5.tar.xz
parse: Clean up debug flag parsing/printing
Diffstat (limited to 'diag.c')
-rw-r--r--diag.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/diag.c b/diag.c
index bbf07e3..c2ed972 100644
--- a/diag.c
+++ b/diag.c
@@ -95,35 +95,9 @@ bool bfs_warning_prefix(const struct bfs_ctx *ctx) {
}
}
-static const char *debug_flag_str(enum debug_flags flag) {
- switch (flag) {
- case DEBUG_COST:
- return "cost";
- case DEBUG_EXEC:
- return "exec";
- case DEBUG_OPT:
- return "opt";
- case DEBUG_RATES:
- return "rates";
- case DEBUG_SEARCH:
- return "search";
- case DEBUG_STAT:
- return "stat";
- case DEBUG_TREE:
- return "tree";
-
- case DEBUG_ALL:
- assert(false);
- break;
- }
-
- assert(false);
- return "???";
-}
-
bool bfs_debug_prefix(const struct bfs_ctx *ctx, enum debug_flags flag) {
if (ctx->debug & flag) {
- cfprintf(ctx->cerr, "${bld}%s:${rs} ${cyn}-D %s${rs}: ", xbasename(ctx->argv[0]), debug_flag_str(flag));
+ cfprintf(ctx->cerr, "${bld}%s:${rs} ${cyn}-D %s${rs}: ", xbasename(ctx->argv[0]), debug_flag_name(flag));
return true;
} else {
return false;