summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-02 17:06:43 +0200
committerwm4 <wm4@nowhere>2013-08-02 17:06:43 +0200
commit4e45fbed24083b09c63df43c3999910ab3b70164 (patch)
treebd6090d26899212095d6bcd27eefa696b364cfd0
parent44d6ac06aed7c13cbace543920e706023551c3c2 (diff)
downloadmpv-4e45fbed24083b09c63df43c3999910ab3b70164.tar.bz2
mpv-4e45fbed24083b09c63df43c3999910ab3b70164.tar.xz
m_config: minor simplification
The optstruct parameter in the m_config_parse_option functions was not needed.
-rw-r--r--core/m_config.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/core/m_config.c b/core/m_config.c
index 6ae3e9e764..e63952e577 100644
--- a/core/m_config.c
+++ b/core/m_config.c
@@ -500,11 +500,11 @@ const char *m_config_get_positional_option(const struct m_config *config, int n)
return NULL;
}
-static int parse_subopts(struct m_config *config, void *optstruct, char *name,
- char *prefix, struct bstr param, int flags);
+static int parse_subopts(struct m_config *config, char *name, char *prefix,
+ struct bstr param, int flags);
-static int m_config_parse_option(struct m_config *config, void *optstruct,
- struct bstr name, struct bstr param, int flags)
+static int m_config_parse_option(struct m_config *config, struct bstr name,
+ struct bstr param, int flags)
{
assert(config != NULL);
assert(name.len != 0);
@@ -548,7 +548,7 @@ static int m_config_parse_option(struct m_config *config, void *optstruct,
char prefix[110];
assert(strlen(co->name) < 100);
sprintf(prefix, "%s-", co->name);
- return parse_subopts(config, optstruct, co->name, prefix, param, flags);
+ return parse_subopts(config, co->name, prefix, param, flags);
}
if (set)
@@ -557,8 +557,8 @@ static int m_config_parse_option(struct m_config *config, void *optstruct,
return m_option_parse(co->opt, name, param, set ? co->data : NULL);
}
-static int parse_subopts(struct m_config *config, void *optstruct, char *name,
- char *prefix, struct bstr param, int flags)
+static int parse_subopts(struct m_config *config, char *name, char *prefix,
+ struct bstr param, int flags)
{
char **lst = NULL;
// Split the argument into child options
@@ -571,8 +571,7 @@ static int parse_subopts(struct m_config *config, void *optstruct, char *name,
char n[110];
if (snprintf(n, 110, "%s%s", prefix, lst[2 * i]) > 100)
abort();
- r = m_config_parse_option(config, optstruct, bstr0(n),
- bstr0(lst[2 * i + 1]), flags);
+ r = m_config_parse_option(config,bstr0(n), bstr0(lst[2 * i + 1]), flags);
if (r < 0) {
if (r > M_OPT_EXIT) {
mp_tmsg(MSGT_CFGPARSER, MSGL_ERR,
@@ -592,7 +591,7 @@ int m_config_parse_suboptions(struct m_config *config, char *name,
{
if (!subopts || !*subopts)
return 0;
- int r = parse_subopts(config, config->optstruct, name, "", bstr0(subopts), 0);
+ int r = parse_subopts(config, name, "", bstr0(subopts), 0);
if (r < 0 && r > M_OPT_EXIT) {
mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing suboption %s (%s)\n",
name, m_option_strerror(r));
@@ -604,7 +603,7 @@ int m_config_parse_suboptions(struct m_config *config, char *name,
int m_config_set_option_ext(struct m_config *config, struct bstr name,
struct bstr param, int flags)
{
- int r = m_config_parse_option(config, config->optstruct, name, param, flags);
+ int r = m_config_parse_option(config, name, param, flags);
if (r < 0 && r > M_OPT_EXIT) {
mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing option %.*s (%s)\n",
BSTR_P(name), m_option_strerror(r));