History

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.

nanahi committed 2 years ago

Commit dbe37761 parent b7ad0961 file · +7 −6Browse files

Unified · Split

input/input.c+7−6
@@ -275,13 +275,12 @@ static struct mp_cmd *queue_peek_tail(struct cmd_queue *queue) · 274 unmodified lines
275275 return cur;
276276 }
277277
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)
279279 {
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);
285284 }
286285
287286 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
957956
958957 int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
959958 {
959+ if (!cmd)
960+ return 0;
960961 input_lock(ictx);
961962 queue_cmd(ictx, cmd);
962963 input_unlock(ictx);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t