From e8b073584d749bb864f495d9e1cd31b102c6283d Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 30 Apr 2018 20:33:05 +0200 Subject: input: remove some explicit uses of command IDs The plan is to remove the command ID enum. This will happen by replacing the big switch statement in command.c with dispatching to per-command callbacks. As preparation, remove uses of the command IDs outside of the actual dispatching mechanism. Also remove some instances of checking cmd->def for NULL. We now require this always to be set. --- input/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'input/input.c') diff --git a/input/input.c b/input/input.c index 616ce3450c..03771dc2bb 100644 --- a/input/input.c +++ b/input/input.c @@ -547,7 +547,7 @@ static struct mp_cmd *resolve_key(struct input_ctx *ictx, int code) update_mouse_section(ictx); struct mp_cmd *cmd = get_cmd_from_keys(ictx, NULL, code); key_buf_add(ictx->key_history, code); - if (cmd && cmd->id != MP_CMD_IGNORE && !should_drop_cmd(ictx, cmd)) + if (cmd && !cmd->def->is_ignore && !should_drop_cmd(ictx, cmd)) return cmd; talloc_free(cmd); return NULL; -- cgit v1.2.3