aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2003-06-04 09:33:10 -0700
committerBen Collins <bcollins@debian.org>2003-06-04 09:33:10 -0700
commit8a36b98fd0d80234db3675aca4d56e034b01d175 (patch)
tree986185754274a061dd95ffe6ac213570c3abd439 /scripts
parent89490f20df62d7b23318b78a359888c9c1633d8c (diff)
downloadhistory-8a36b98fd0d80234db3675aca4d56e034b01d175.tar.gz
[PATCH] choice handling fixes
A few choice handling fixes: - only visible choice values define the new state of the complete choice - improve handling of choices without visible value - two new warnings
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/conf.c8
-rw-r--r--scripts/kconfig/confdata.c3
-rw-r--r--scripts/kconfig/menu.c23
-rw-r--r--scripts/kconfig/symbol.c3
4 files changed, 22 insertions, 15 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 93544343f93280..323dd1c92bd924 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -286,10 +286,14 @@ static int conf_choice(struct menu *menu)
break;
}
} else {
- sym->user = sym->curr;
- if (sym->curr.tri == mod) {
+ switch (sym_get_tristate_value(sym)) {
+ case no:
+ return 1;
+ case mod:
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
return 0;
+ case yes:
+ break;
}
}
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index bf833ee233188c..4d72008b897911 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -243,7 +243,8 @@ int conf_read(const char *name)
prop = sym_get_choice_prop(sym);
sym->flags &= ~SYMBOL_NEW;
for (e = prop->expr; e; e = e->left.expr)
- sym->flags |= e->right.sym->flags & SYMBOL_NEW;
+ if (e->right.sym->visible != no)
+ sym->flags |= e->right.sym->flags & SYMBOL_NEW;
}
sym_change_count = 1;
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b97b02807f9287..16317670a8792d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -221,11 +221,18 @@ void menu_finalize(struct menu *parent)
for (menu = parent->list; menu; menu = menu->next) {
if (sym && sym_is_choice(sym) && menu->sym) {
menu->sym->flags |= SYMBOL_CHOICEVAL;
+ if (!menu->prompt)
+ fprintf(stderr, "%s:%d:warning: choice value must have a prompt\n",
+ menu->file->name, menu->lineno);
for (prop = menu->sym->prop; prop; prop = prop->next) {
- if (prop->type != P_DEFAULT)
- continue;
- fprintf(stderr, "%s:%d:warning: defaults for choice values not supported\n",
- prop->file->name, prop->lineno);
+ if (prop->type == P_PROMPT && prop->menu != menu) {
+ fprintf(stderr, "%s:%d:warning: choice values currently only support a single prompt\n",
+ prop->file->name, prop->lineno);
+
+ }
+ if (prop->type == P_DEFAULT)
+ fprintf(stderr, "%s:%d:warning: defaults for choice values not supported\n",
+ prop->file->name, prop->lineno);
}
current_entry = menu;
menu_set_type(sym->type);
@@ -311,14 +318,6 @@ bool menu_is_visible(struct menu *menu)
} else
visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr);
- if (sym && sym_is_choice(sym)) {
- for (child = menu->list; child; child = child->next)
- if (menu_is_visible(child))
- break;
- if (!child)
- return false;
- }
-
if (visible != no)
return true;
if (!sym || sym_get_tristate_value(menu->sym) == no)
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index e52ca16d3dd07e..5c62b2c09a745a 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -201,6 +201,9 @@ static struct symbol *sym_calc_choice(struct symbol *sym)
if (def_sym->visible != no)
return def_sym;
}
+
+ /* no choice? reset tristate value */
+ sym->curr.tri = no;
return NULL;
}