diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-03-08 02:22:47 -0500 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-03-19 08:58:18 +0100 |
commit | 18bd03d31aef55778224b8d86e5ba140d596527d (patch) | |
tree | dffee5583daec79a4fbb6bdca2a1885ba516eaf5 /common | |
parent | 98ab8d87a1db803c503d95ca7cff0d988eee4d04 (diff) | |
download | mpv-18bd03d31aef55778224b8d86e5ba140d596527d.tar.bz2 mpv-18bd03d31aef55778224b8d86e5ba140d596527d.tar.xz |
common/msg: fix warning: void function should not return void expression
Diffstat (limited to 'common')
-rw-r--r-- | common/msg.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/common/msg.c b/common/msg.c index 1b9a6ba982..0d77fcc624 100644 --- a/common/msg.c +++ b/common/msg.c @@ -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) { - return c == -1 ? bstr_xappend(talloc_ctx, text, bstr0("\033[0m")) - : bstr_xappend_asprintf(talloc_ctx, text, - "\033[%d;3%dm", c >> 3, c & 7); + if (c == -1) { + bstr_xappend(talloc_ctx, text, bstr0("\033[0m")); + 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 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, |