summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-23 18:17:20 +0100
committerwm4 <wm4@nowhere>2015-03-23 18:17:38 +0100
commit68b71346ec2b333b14f9e2d661e16aba8cdca200 (patch)
treed459a31821150920a89f47b41e9778f08a3e42f1
parenta09e5dd89110dd96a7342ff0c80c9ede0dadc3a9 (diff)
downloadmpv-68b71346ec2b333b14f9e2d661e16aba8cdca200.tar.bz2
mpv-68b71346ec2b333b14f9e2d661e16aba8cdca200.tar.xz
m_option: remove dead initialization
-rw-r--r--options/m_option.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/options/m_option.c b/options/m_option.c
index 8f4299bc0d..e0d35e6a24 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -720,7 +720,7 @@ const struct m_option_type m_option_type_choice = {
static int apply_flag(const struct m_option *opt, int *val, bstr flag)
{
- struct m_opt_choice_alternatives *alt = opt->priv;
+ struct m_opt_choice_alternatives *alt;
for (alt = opt->priv; alt->name; alt++) {
if (bstr_equals0(flag, alt->name)) {
if (*val & alt->value)
@@ -734,7 +734,7 @@ static int apply_flag(const struct m_option *opt, int *val, bstr flag)
static const char *find_next_flag(const struct m_option *opt, int *val)
{
- struct m_opt_choice_alternatives *alt = opt->priv;
+ struct m_opt_choice_alternatives *alt;
for (alt = opt->priv; alt->name; alt++) {
if (alt->value && (alt->value & (*val)) == alt->value) {
*val = *val & ~(unsigned)alt->value;
@@ -754,10 +754,10 @@ static int parse_flags(struct mp_log *log, const struct m_option *opt,
bstr_split_tok(param, "+", &flag, &param);
int r = apply_flag(opt, &value, flag);
if (r == M_OPT_UNKNOWN) {
- struct m_opt_choice_alternatives *alt = opt->priv;
mp_fatal(log, "Invalid flag for option %.*s: %.*s\n",
BSTR_P(name), BSTR_P(flag));
mp_info(log, "Valid flags are:\n");
+ struct m_opt_choice_alternatives *alt;
for (alt = opt->priv; alt->name; alt++)
mp_info(log, " %s\n", alt->name);
mp_info(log, "Flags can usually be combined with '+'.\n");