common/msg: fix warning: void function should not return void expression

This commit is contained in:
nanahi 2024-03-08 02:22:47 -05:00 committed by Kacper Michajłow
parent 98ab8d87a1
commit 18bd03d31a
1 changed files with 7 additions and 4 deletions

View File

@ -299,15 +299,18 @@ bool mp_msg_has_status_line(struct mpv_global *global)
static void set_term_color(void *talloc_ctx, bstr *text, int c) static void set_term_color(void *talloc_ctx, bstr *text, int c)
{ {
return c == -1 ? bstr_xappend(talloc_ctx, text, bstr0("\033[0m")) if (c == -1) {
: bstr_xappend_asprintf(talloc_ctx, text, bstr_xappend(talloc_ctx, text, bstr0("\033[0m"));
"\033[%d;3%dm", c >> 3, c & 7); return;
}
bstr_xappend_asprintf(talloc_ctx, text, "\033[%d;3%dm", c >> 3, c & 7);
} }
static void set_msg_color(void *talloc_ctx, bstr *text, int lev) static void set_msg_color(void *talloc_ctx, bstr *text, int lev)
{ {
static const int v_colors[] = {9, 1, 3, -1, -1, 2, 8, 8, 8, -1}; static const int v_colors[] = {9, 1, 3, -1, -1, 2, 8, 8, 8, -1};
return set_term_color(talloc_ctx, text, v_colors[lev]); set_term_color(talloc_ctx, text, v_colors[lev]);
} }
static void pretty_print_module(struct mp_log_root *root, bstr *text, static void pretty_print_module(struct mp_log_root *root, bstr *text,