diff options
author | wm4 <wm4@nowhere> | 2018-01-18 10:08:48 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-18 01:42:36 -0800 |
commit | 6827901230a962ef40fbc18c6ab25d4d702b95aa (patch) | |
tree | 1c56f01ae57c3f1490bd3f79ed25daaafba15f43 /input/cmd_parse.c | |
parent | 4d87c700e007d6fbff1d742c0e6e6700451172e2 (diff) | |
download | mpv-6827901230a962ef40fbc18c6ab25d4d702b95aa.tar.bz2 mpv-6827901230a962ef40fbc18c6ab25d4d702b95aa.tar.xz |
ta: introduce talloc_dup() and use it in some places
It was actually already implemented as ta_dup_ptrtype(), but that seems
like a clunky name. Also we still use the talloc_ names throughout the
source, and I'd rather use an old name instead of a mixing inconsistent
naming conventions.
Diffstat (limited to 'input/cmd_parse.c')
-rw-r--r-- | input/cmd_parse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/input/cmd_parse.c b/input/cmd_parse.c index c4ac9dd6b7..c5f428e23d 100644 --- a/input/cmd_parse.c +++ b/input/cmd_parse.c @@ -356,7 +356,7 @@ mp_cmd_t *mp_input_parse_cmd_(struct mp_log *log, bstr str, const char *loc) talloc_steal(list, cmd); struct mp_cmd_arg arg = {0}; arg.v.p = cmd; - list->args = talloc_memdup(list, &arg, sizeof(arg)); + list->args = talloc_dup(list, &arg); p_prev = &cmd->queue_next; cmd = list; } @@ -406,7 +406,7 @@ mp_cmd_t *mp_cmd_clone(mp_cmd_t *cmd) if (!cmd) return NULL; - ret = talloc_memdup(NULL, cmd, sizeof(mp_cmd_t)); + ret = talloc_dup(NULL, cmd); talloc_set_destructor(ret, destroy_cmd); ret->name = talloc_strdup(ret, cmd->name); ret->args = talloc_zero_array(ret, struct mp_cmd_arg, ret->nargs); @@ -427,7 +427,7 @@ mp_cmd_t *mp_cmd_clone(mp_cmd_t *cmd) } else { struct mp_cmd_arg arg = {0}; arg.v.p = sub; - ret->args = talloc_memdup(ret, &arg, sizeof(arg)); + ret->args = talloc_dup(ret, &arg); } prev = sub; } |