From d8d42b44fc717c695af59c14213d54885088ea37 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 19:45:42 +0100 Subject: m_option, m_config: mp_msg conversions Always pass around mp_log contexts in the option parser code. This of course affects all users of this API as well. In stream.c, pass a mp_null_log, because we can't do it properly yet. This will be fixed later. --- input/input.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'input') diff --git a/input/input.c b/input/input.c index d0eac2529c..8dd8e76bd8 100644 --- a/input/input.c +++ b/input/input.c @@ -105,8 +105,8 @@ struct key_name { #define OARG_INT(def) OPT_INT(ARG(i), 0, OPTDEF_INT(def)) #define OARG_CHOICE(def, c) OPT_CHOICE(ARG(i), 0, c, OPTDEF_INT(def)) -static int parse_cycle_dir(const struct m_option *opt, struct bstr name, - struct bstr param, void *dst); +static int parse_cycle_dir(struct mp_log *log, const struct m_option *opt, + struct bstr name, struct bstr param, void *dst); static const struct m_option_type m_option_type_cycle_dir = { .name = "up|down", .parse = parse_cycle_dir, @@ -813,8 +813,8 @@ void mp_input_rm_key_fd(struct input_ctx *ictx, int fd) input_unlock(ictx); } -static int parse_cycle_dir(const struct m_option *opt, struct bstr name, - struct bstr param, void *dst) +static int parse_cycle_dir(struct mp_log *log, const struct m_option *opt, + struct bstr name, struct bstr param, void *dst) { double val; if (bstrcmp0(param, "up") == 0) { @@ -822,7 +822,7 @@ static int parse_cycle_dir(const struct m_option *opt, struct bstr name, } else if (bstrcmp0(param, "down") == 0) { val = -1; } else { - return m_option_type_double.parse(opt, name, param, dst); + return m_option_type_double.parse(log, opt, name, param, dst); } *(double *)dst = val; return 1; @@ -1041,7 +1041,7 @@ static struct mp_cmd *parse_cmd(struct parse_ctx *ctx, int def_flags) struct mp_cmd_arg *cmdarg = &cmd->args[cmd->nargs]; cmdarg->type = opt; cmd->nargs++; - r = m_option_parse(opt, bstr0(cmd->name), cur_token, &cmdarg->v); + r = m_option_parse(ctx->log, opt, bstr0(cmd->name), cur_token, &cmdarg->v); if (r < 0) { MP_ERR(ctx, "Command %s: argument %d can't be parsed: %s.\n", cmd->name, i + 1, m_option_strerror(r)); -- cgit v1.2.3