aboutsummaryrefslogtreecommitdiff
path: root/scripts/config/symbol.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-15 06:01:05 +0000
committerEric Andersen <andersen@codepoet.org>2004-07-15 06:01:05 +0000
commit837f058fb307e0bcf7b9ad4f02a44ea3047f427e (patch)
treebde5459d496b1afc91b7d4a261b66252a47ca414 /scripts/config/symbol.c
parent449f2bca967dc4682a52487fe4a53f13c3623002 (diff)
downloadbusybox-w32-837f058fb307e0bcf7b9ad4f02a44ea3047f427e.tar.gz
busybox-w32-837f058fb307e0bcf7b9ad4f02a44ea3047f427e.tar.bz2
busybox-w32-837f058fb307e0bcf7b9ad4f02a44ea3047f427e.zip
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 'scripts/config/symbol.c')
-rw-r--r--scripts/config/symbol.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/scripts/config/symbol.c b/scripts/config/symbol.c
index 29d8d3e0b..a9fae9c13 100644
--- a/scripts/config/symbol.c
+++ b/scripts/config/symbol.c
@@ -12,25 +12,26 @@
12#include "lkc.h" 12#include "lkc.h"
13 13
14struct symbol symbol_yes = { 14struct symbol symbol_yes = {
15 name: "y", 15 .name = "y",
16 curr: { "y", yes }, 16 .curr = { "y", yes },
17 flags: SYMBOL_YES|SYMBOL_VALID, 17 .flags = SYMBOL_YES|SYMBOL_VALID,
18}, symbol_mod = { 18}, symbol_mod = {
19 name: "m", 19 .name = "m",
20 curr: { "m", mod }, 20 .curr = { "m", mod },
21 flags: SYMBOL_MOD|SYMBOL_VALID, 21 .flags = SYMBOL_MOD|SYMBOL_VALID,
22}, symbol_no = { 22}, symbol_no = {
23 name: "n", 23 .name = "n",
24 curr: { "n", no }, 24 .curr = { "n", no },
25 flags: SYMBOL_NO|SYMBOL_VALID, 25 .flags = SYMBOL_NO|SYMBOL_VALID,
26}, symbol_empty = { 26}, symbol_empty = {
27 name: "", 27 .name = "",
28 curr: { "", no }, 28 .curr = { "", no },
29 flags: SYMBOL_VALID, 29 .flags = SYMBOL_VALID,
30}; 30};
31 31
32int sym_change_count; 32int sym_change_count;
33struct symbol *modules_sym; 33struct symbol *modules_sym;
34tristate modules_val;
34 35
35void sym_add_default(struct symbol *sym, const char *def) 36void sym_add_default(struct symbol *sym, const char *def)
36{ 37{
@@ -72,11 +73,8 @@ enum symbol_type sym_get_type(struct symbol *sym)
72 if (type == S_TRISTATE) { 73 if (type == S_TRISTATE) {
73 if (sym_is_choice_value(sym) && sym->visible == yes) 74 if (sym_is_choice_value(sym) && sym->visible == yes)
74 type = S_BOOLEAN; 75 type = S_BOOLEAN;
75 else { 76 else if (modules_val == no)
76 sym_calc_value(modules_sym); 77 type = S_BOOLEAN;
77 if (modules_sym->curr.tri == no)
78 type = S_BOOLEAN;
79 }
80 } 78 }
81 return type; 79 return type;
82} 80}
@@ -146,6 +144,8 @@ static void sym_calc_visibility(struct symbol *sym)
146 prop->visible.tri = expr_calc_value(prop->visible.expr); 144 prop->visible.tri = expr_calc_value(prop->visible.expr);
147 tri = E_OR(tri, prop->visible.tri); 145 tri = E_OR(tri, prop->visible.tri);
148 } 146 }
147 if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
148 tri = yes;
149 if (sym->visible != tri) { 149 if (sym->visible != tri) {
150 sym->visible = tri; 150 sym->visible = tri;
151 sym_set_changed(sym); 151 sym_set_changed(sym);
@@ -155,6 +155,8 @@ static void sym_calc_visibility(struct symbol *sym)
155 tri = no; 155 tri = no;
156 if (sym->rev_dep.expr) 156 if (sym->rev_dep.expr)
157 tri = expr_calc_value(sym->rev_dep.expr); 157 tri = expr_calc_value(sym->rev_dep.expr);
158 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
159 tri = yes;
158 if (sym->rev_dep.tri != tri) { 160 if (sym->rev_dep.tri != tri) {
159 sym->rev_dep.tri = tri; 161 sym->rev_dep.tri = tri;
160 sym_set_changed(sym); 162 sym_set_changed(sym);
@@ -261,14 +263,8 @@ void sym_calc_value(struct symbol *sym)
261 newval.tri = expr_calc_value(prop->expr); 263 newval.tri = expr_calc_value(prop->expr);
262 } 264 }
263 } 265 }
264 if (sym_get_type(sym) == S_BOOLEAN) { 266 if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
265 if (newval.tri == mod) 267 newval.tri = yes;
266 newval.tri = yes;
267 if (sym->visible == mod)
268 sym->visible = yes;
269 if (sym->rev_dep.tri == mod)
270 sym->rev_dep.tri = yes;
271 }
272 break; 268 break;
273 case S_STRING: 269 case S_STRING:
274 case S_HEX: 270 case S_HEX:
@@ -300,6 +296,8 @@ void sym_calc_value(struct symbol *sym)
300 296
301 if (memcmp(&oldval, &sym->curr, sizeof(oldval))) 297 if (memcmp(&oldval, &sym->curr, sizeof(oldval)))
302 sym_set_changed(sym); 298 sym_set_changed(sym);
299 if (modules_sym == sym)
300 modules_val = modules_sym->curr.tri;
303 301
304 if (sym_is_choice(sym)) { 302 if (sym_is_choice(sym)) {
305 int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE); 303 int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE);
@@ -320,6 +318,8 @@ void sym_clear_all_valid(void)
320 for_all_symbols(i, sym) 318 for_all_symbols(i, sym)
321 sym->flags &= ~SYMBOL_VALID; 319 sym->flags &= ~SYMBOL_VALID;
322 sym_change_count++; 320 sym_change_count++;
321 if (modules_sym)
322 sym_calc_value(modules_sym);
323} 323}
324 324
325void sym_set_changed(struct symbol *sym) 325void sym_set_changed(struct symbol *sym)
@@ -699,7 +699,7 @@ struct symbol *sym_check_deps(struct symbol *sym)
699 goto out; 699 goto out;
700 700
701 for (prop = sym->prop; prop; prop = prop->next) { 701 for (prop = sym->prop; prop; prop = prop->next) {
702 if (prop->type == P_CHOICE) 702 if (prop->type == P_CHOICE || prop->type == P_SELECT)
703 continue; 703 continue;
704 sym2 = sym_check_expr_deps(prop->visible.expr); 704 sym2 = sym_check_expr_deps(prop->visible.expr);
705 if (sym2) 705 if (sym2)