summaryrefslogtreecommitdiff
path: root/extra/config/symbol.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-15 05:54:13 +0000
committerEric Andersen <andersen@codepoet.org>2004-07-15 05:54:13 +0000
commit6c2efd66d94ce13ac5b70aefd71cf2e66f4acbdf (patch)
tree4614629205be8798da130da69d369387d093ce38 /extra/config/symbol.c
parentdb5a9ef35b66e495feb4daf2e9576883dd52926f (diff)
Peter Kjellerstedt at axis.com writes:
Hello, the attached patch should bring extra/config in line with the Linux 2.6.7 sources. The following are the commit messages for the respective files from the Linux bk-repository: checklist.c: * fix menuconfig choice item help display confdata.c: * config: choice fix * kconfig: don't rename target dir when saving config expr.c, expr.h: * config: disable debug prints mconf.c: * fix menuconfig choice item help display menu.c: * Kconfig: use select statements symbol.c: * config: choice fix * Avoid bogus warning about recursive dependencies * c99 struct initialiser conversions textbox.c: * janitor: don't init statics to 0 util.c: * fix lxdialog behaviour //Peter
Diffstat (limited to 'extra/config/symbol.c')
-rw-r--r--extra/config/symbol.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/extra/config/symbol.c b/extra/config/symbol.c
index 29d8d3e0b..a9fae9c13 100644
--- a/extra/config/symbol.c
+++ b/extra/config/symbol.c
@@ -12,25 +12,26 @@
#include "lkc.h"
struct symbol symbol_yes = {
- name: "y",
- curr: { "y", yes },
- flags: SYMBOL_YES|SYMBOL_VALID,
+ .name = "y",
+ .curr = { "y", yes },
+ .flags = SYMBOL_YES|SYMBOL_VALID,
}, symbol_mod = {
- name: "m",
- curr: { "m", mod },
- flags: SYMBOL_MOD|SYMBOL_VALID,
+ .name = "m",
+ .curr = { "m", mod },
+ .flags = SYMBOL_MOD|SYMBOL_VALID,
}, symbol_no = {
- name: "n",
- curr: { "n", no },
- flags: SYMBOL_NO|SYMBOL_VALID,
+ .name = "n",
+ .curr = { "n", no },
+ .flags = SYMBOL_NO|SYMBOL_VALID,
}, symbol_empty = {
- name: "",
- curr: { "", no },
- flags: SYMBOL_VALID,
+ .name = "",
+ .curr = { "", no },
+ .flags = SYMBOL_VALID,
};
int sym_change_count;
struct symbol *modules_sym;
+tristate modules_val;
void sym_add_default(struct symbol *sym, const char *def)
{
@@ -72,11 +73,8 @@ enum symbol_type sym_get_type(struct symbol *sym)
if (type == S_TRISTATE) {
if (sym_is_choice_value(sym) && sym->visible == yes)
type = S_BOOLEAN;
- else {
- sym_calc_value(modules_sym);
- if (modules_sym->curr.tri == no)
- type = S_BOOLEAN;
- }
+ else if (modules_val == no)
+ type = S_BOOLEAN;
}
return type;
}
@@ -146,6 +144,8 @@ static void sym_calc_visibility(struct symbol *sym)
prop->visible.tri = expr_calc_value(prop->visible.expr);
tri = E_OR(tri, prop->visible.tri);
}
+ if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
+ tri = yes;
if (sym->visible != tri) {
sym->visible = tri;
sym_set_changed(sym);
@@ -155,6 +155,8 @@ static void sym_calc_visibility(struct symbol *sym)
tri = no;
if (sym->rev_dep.expr)
tri = expr_calc_value(sym->rev_dep.expr);
+ if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
+ tri = yes;
if (sym->rev_dep.tri != tri) {
sym->rev_dep.tri = tri;
sym_set_changed(sym);
@@ -261,14 +263,8 @@ void sym_calc_value(struct symbol *sym)
newval.tri = expr_calc_value(prop->expr);
}
}
- if (sym_get_type(sym) == S_BOOLEAN) {
- if (newval.tri == mod)
- newval.tri = yes;
- if (sym->visible == mod)
- sym->visible = yes;
- if (sym->rev_dep.tri == mod)
- sym->rev_dep.tri = yes;
- }
+ if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
+ newval.tri = yes;
break;
case S_STRING:
case S_HEX:
@@ -300,6 +296,8 @@ void sym_calc_value(struct symbol *sym)
if (memcmp(&oldval, &sym->curr, sizeof(oldval)))
sym_set_changed(sym);
+ if (modules_sym == sym)
+ modules_val = modules_sym->curr.tri;
if (sym_is_choice(sym)) {
int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE);
@@ -320,6 +318,8 @@ void sym_clear_all_valid(void)
for_all_symbols(i, sym)
sym->flags &= ~SYMBOL_VALID;
sym_change_count++;
+ if (modules_sym)
+ sym_calc_value(modules_sym);
}
void sym_set_changed(struct symbol *sym)
@@ -699,7 +699,7 @@ struct symbol *sym_check_deps(struct symbol *sym)
goto out;
for (prop = sym->prop; prop; prop = prop->next) {
- if (prop->type == P_CHOICE)
+ if (prop->type == P_CHOICE || prop->type == P_SELECT)
continue;
sym2 = sym_check_expr_deps(prop->visible.expr);
if (sym2)