diff options
| author | Roman Zippel <zippel@linux-m68k.org> | 2003-06-04 09:33:10 -0700 |
|---|---|---|
| committer | Ben Collins <bcollins@debian.org> | 2003-06-04 09:33:10 -0700 |
| commit | 8a36b98fd0d80234db3675aca4d56e034b01d175 (patch) | |
| tree | 986185754274a061dd95ffe6ac213570c3abd439 /scripts/kconfig/menu.c | |
| parent | 89490f20df62d7b23318b78a359888c9c1633d8c (diff) | |
[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/kconfig/menu.c')
| -rw-r--r-- | scripts/kconfig/menu.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index b97b02807f92..16317670a879 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) |
