diff options
author | wm4 <wm4@nowhere> | 2014-11-24 16:48:34 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-24 16:48:34 +0100 |
commit | d33ae93b897bc407829c5f3c8b2000a7c31d37bd (patch) | |
tree | 2bcf497162349102f5bc002f50e66e53fa291f43 /input/cmd_parse.c | |
parent | 0c5fd5a04719a6a7ae63df40bf2f9cac27b14862 (diff) | |
download | mpv-d33ae93b897bc407829c5f3c8b2000a7c31d37bd.tar.bz2 mpv-d33ae93b897bc407829c5f3c8b2000a7c31d37bd.tar.xz |
input: simplify
Diffstat (limited to 'input/cmd_parse.c')
-rw-r--r-- | input/cmd_parse.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/input/cmd_parse.c b/input/cmd_parse.c index 51b56d9565..baeced16f5 100644 --- a/input/cmd_parse.c +++ b/input/cmd_parse.c @@ -319,6 +319,11 @@ error: return NULL; } +static struct mp_cmd_def list_def = { + .id = MP_CMD_COMMAND_LIST, + .name = "list", +}; + mp_cmd_t *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc) { void *tmp = talloc_new(NULL); @@ -341,8 +346,9 @@ mp_cmd_t *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc) struct mp_cmd *list = talloc_ptrtype(NULL, list); talloc_set_destructor(list, destroy_cmd); *list = (struct mp_cmd) { - .id = MP_CMD_COMMAND_LIST, - .name = "list", + .id = list_def.id, + .name = (char *)list_def.name, + .def = &list_def, .original = bstrdup(list, original), }; talloc_steal(list, cmd); |