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.
Unified · Split
| @@ -275,13 +275,12 @@ static struct mp_cmd *queue_peek_tail(struct cmd_queue *queue) · 274 unmodified lines | ||
| 275 | 275 | return cur; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | −static int queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) | |
| 278 | +static void queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) | |
| 279 | 279 | { |
| 280 | − if (cmd) { | |
| 281 | − queue_add_tail(&ictx->cmd_queue, cmd); | |
| 282 | − mp_input_wakeup(ictx); | |
| 283 | − } | |
| 284 | − return 1; | |
| 280 | + if (!cmd) | |
| 281 | + return; | |
| 282 | + queue_add_tail(&ictx->cmd_queue, cmd); | |
| 283 | + mp_input_wakeup(ictx); | |
| 285 | 284 | } |
| 286 | 285 | |
| 287 | 286 | 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) · 669 unmodified lines | ||
| 957 | 956 | |
| 958 | 957 | int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd) |
| 959 | 958 | { |
| 959 | + if (!cmd) | |
| 960 | + return 0; | |
| 960 | 961 | input_lock(ictx); |
| 961 | 962 | queue_cmd(ictx, cmd); |
| 962 | 963 | input_unlock(ictx); |