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
275 return cur;275 return cur;
276}276}
277 277
278static int queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)278static void queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
279{279{
280 if (cmd) {280 if (!cmd)
281 queue_add_tail(&ictx->cmd_queue, cmd);281 return;
282 mp_input_wakeup(ictx);282 queue_add_tail(&ictx->cmd_queue, cmd);
283 }283 mp_input_wakeup(ictx);
284 return 1;
285}284}
286 285
287static void append_bind_info(struct input_ctx *ictx, char **pmsg,286static 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
958int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)957int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
959{958{
959 if (!cmd)
960 return 0;
960 input_lock(ictx);961 input_lock(ictx);
961 queue_cmd(ictx, cmd);962 queue_cmd(ictx, cmd);
962 input_unlock(ictx);963 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