From dbe377645f11a5bd253e48df1ae69f960499fcd8 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sun, 7 Apr 2024 10:18:08 -0400 Subject: [PATCH] input: make mp_input_queue_cmd return a meaningful value It's currently always a meaningless 1. Make it so it returns 0 is cmd is NULL. Remove the unused return value from queue_cmd. --- input/input.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/input/input.c b/input/input.c index d58e5e9208..d4cea80853 100644 --- a/input/input.c +++ b/input/input.c @@ -275,13 +275,12 @@ static struct mp_cmd *queue_peek_tail(struct cmd_queue *queue) return cur; } -static int queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) +static void queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) { - if (cmd) { - queue_add_tail(&ictx->cmd_queue, cmd); - mp_input_wakeup(ictx); - } - return 1; + if (!cmd) + return; + queue_add_tail(&ictx->cmd_queue, cmd); + mp_input_wakeup(ictx); } static void append_bind_info(struct input_ctx *ictx, char **pmsg, @@ -957,6 +956,8 @@ static void adjust_max_wait_time(struct input_ctx *ictx, double *time) int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) { + if (!cmd) + return 0; input_lock(ictx); queue_cmd(ictx, cmd); input_unlock(ictx);