P_CHOICE is a pseudo property used to link a choice with its members. There is no more code relying on this, except for some debug code.
Unified · Split
| @@ -167,7 +167,6 @@ enum prop_type { · 166 unmodified lines | |||
| 167 | P_COMMENT, /* text associated with a comment */ | 167 | P_COMMENT, /* text associated with a comment */ |
| 168 | P_MENU, /* prompt associated with a menu or menuconfig symbol */ | 168 | P_MENU, /* prompt associated with a menu or menuconfig symbol */ |
| 169 | P_DEFAULT, /* default y */ | 169 | P_DEFAULT, /* default y */ |
| 170 | P_CHOICE, /* choice value */ | ||
| 171 | P_SELECT, /* select BAR */ | 170 | P_SELECT, /* select BAR */ |
| 172 | P_IMPLY, /* imply BAR */ | 171 | P_IMPLY, /* imply BAR */ |
| 173 | P_RANGE, /* range 7..100 (for a symbol) */ | 172 | P_RANGE, /* range 7..100 (for a symbol) */ |
| @@ -181,7 +180,7 @@ struct property { · 7 unmodified lines | |||
| 181 | struct expr_value visible; | 180 | struct expr_value visible; |
| 182 | struct expr *expr; /* the optional conditional part of the property */ | 181 | struct expr *expr; /* the optional conditional part of the property */ |
| 183 | struct menu *menu; /* the menu the property are associated with | 182 | struct menu *menu; /* the menu the property are associated with |
| 184 | * valid for: P_SELECT, P_RANGE, P_CHOICE, | 183 | * valid for: P_SELECT, P_RANGE, |
| 185 | * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */ | 184 | * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */ |
| 186 | const char *filename; /* what file was this property defined */ | 185 | const char *filename; /* what file was this property defined */ |
| 187 | int lineno; /* what lineno was this property defined */ | 186 | int lineno; /* what lineno was this property defined */ |
| @@ -191,7 +190,6 @@ struct property { · 3 unmodified lines | |||
| 191 | for (st = sym->prop; st; st = st->next) \ | 190 | for (st = sym->prop; st; st = st->next) \ |
| 192 | if (st->type == (tok)) | 191 | if (st->type == (tok)) |
| 193 | #define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT) | 192 | #define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT) |
| 194 | #define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE) | ||
| 195 | #define for_all_prompts(sym, st) \ | 193 | #define for_all_prompts(sym, st) \ |
| 196 | for (st = sym->prop; st; st = st->next) \ | 194 | for (st = sym->prop; st; st = st->next) \ |
| 197 | if (st->text) | 195 | if (st->text) |
| @@ -34,7 +34,6 @@ bool sym_string_valid(struct symbol *sym, const char *newval); · 33 unmodified lines | |||
| 34 | bool sym_string_within_range(struct symbol *sym, const char *str); | 34 | bool sym_string_within_range(struct symbol *sym, const char *str); |
| 35 | bool sym_set_string_value(struct symbol *sym, const char *newval); | 35 | bool sym_set_string_value(struct symbol *sym, const char *newval); |
| 36 | bool sym_is_changeable(struct symbol *sym); | 36 | bool sym_is_changeable(struct symbol *sym); |
| 37 | struct property * sym_get_choice_prop(struct symbol *sym); | ||
| 38 | struct menu *sym_get_choice_menu(struct symbol *sym); | 37 | struct menu *sym_get_choice_menu(struct symbol *sym); |
| 39 | const char * sym_get_string_value(struct symbol *sym); | 38 | const char * sym_get_string_value(struct symbol *sym); |
| 40 | 39 | ||
| @@ -306,7 +306,7 @@ static void _menu_finalize(struct menu *parent, bool inside_choice) · 305 unmodified lines | |||
| 306 | struct menu *menu, *last_menu; | 306 | struct menu *menu, *last_menu; |
| 307 | struct symbol *sym; | 307 | struct symbol *sym; |
| 308 | struct property *prop; | 308 | struct property *prop; |
| 309 | struct expr *parentdep, *basedep, *dep, *dep2, **ep; | 309 | struct expr *parentdep, *basedep, *dep, *dep2; |
| 310 | 310 | ||
| 311 | sym = parent->sym; | 311 | sym = parent->sym; |
| 312 | if (parent->list) { | 312 | if (parent->list) { |
| @@ -490,14 +490,7 @@ static void _menu_finalize(struct menu *parent, bool inside_choice) · 177 unmodified lines | |||
| 490 | for (menu = parent->list; menu; menu = menu->next) { | 490 | for (menu = parent->list; menu; menu = menu->next) { |
| 491 | if (sym && sym_is_choice(sym) && | 491 | if (sym && sym_is_choice(sym) && |
| 492 | menu->sym && !sym_is_choice_value(menu->sym)) { | 492 | menu->sym && !sym_is_choice_value(menu->sym)) { |
| 493 | current_entry = menu; | ||
| 494 | menu->sym->flags |= SYMBOL_CHOICEVAL; | 493 | menu->sym->flags |= SYMBOL_CHOICEVAL; |
| 495 | menu_add_symbol(P_CHOICE, sym, NULL); | ||
| 496 | prop = sym_get_choice_prop(sym); | ||
| 497 | for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) | ||
| 498 | ; | ||
| 499 | *ep = expr_alloc_one(E_LIST, NULL); | ||
| 500 | (*ep)->right.sym = menu->sym; | ||
| 501 | } | 494 | } |
| 502 | 495 | ||
| 503 | /* | 496 | /* |
| @@ -241,7 +241,6 @@ choice: T_CHOICE T_EOL · 240 unmodified lines | |||
| 241 | struct symbol *sym = sym_lookup(NULL, 0); | 241 | struct symbol *sym = sym_lookup(NULL, 0); |
| 242 | 242 | ||
| 243 | menu_add_entry(sym); | 243 | menu_add_entry(sym); |
| 244 | menu_add_expr(P_CHOICE, NULL, NULL); | ||
| 245 | menu_set_type(S_BOOLEAN); | 244 | menu_set_type(S_BOOLEAN); |
| 246 | INIT_LIST_HEAD(¤t_entry->choice_members); | 245 | INIT_LIST_HEAD(¤t_entry->choice_members); |
| 247 | 246 | ||
| @@ -696,9 +695,6 @@ static void print_symbol(FILE *out, struct menu *menu) · 448 unmodified lines | |||
| 696 | } | 695 | } |
| 697 | fputc('\n', out); | 696 | fputc('\n', out); |
| 698 | break; | 697 | break; |
| 699 | case P_CHOICE: | ||
| 700 | fputs(" #choice value\n", out); | ||
| 701 | break; | ||
| 702 | case P_SELECT: | 698 | case P_SELECT: |
| 703 | fputs( " select ", out); | 699 | fputs( " select ", out); |
| 704 | expr_fprint(prop->expr, out); | 700 | expr_fprint(prop->expr, out); |
| @@ -1101,14 +1101,6 @@ QString ConfigInfoView::debug_info(struct symbol *sym) · 1100 unmodified lines | |||
| 1101 | &stream, E_NONE); | 1101 | &stream, E_NONE); |
| 1102 | stream << "<br>"; | 1102 | stream << "<br>"; |
| 1103 | break; | 1103 | break; |
| 1104 | case P_CHOICE: | ||
| 1105 | if (sym_is_choice(sym)) { | ||
| 1106 | stream << "choice: "; | ||
| 1107 | expr_print(prop->expr, expr_print_help, | ||
| 1108 | &stream, E_NONE); | ||
| 1109 | stream << "<br>"; | ||
| 1110 | } | ||
| 1111 | break; | ||
| 1112 | default: | 1104 | default: |
| 1113 | stream << "unknown property: "; | 1105 | stream << "unknown property: "; |
| 1114 | stream << prop_get_type_name(prop->type); | 1106 | stream << prop_get_type_name(prop->type); |
| @@ -68,15 +68,6 @@ const char *sym_type_name(enum symbol_type type) · 67 unmodified lines | |||
| 68 | return "???"; | 68 | return "???"; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | struct property *sym_get_choice_prop(struct symbol *sym) | ||
| 72 | { | ||
| 73 | struct property *prop; | ||
| 74 | |||
| 75 | for_all_choices(sym, prop) | ||
| 76 | return prop; | ||
| 77 | return NULL; | ||
| 78 | } | ||
| 79 | |||
| 80 | /** | 71 | /** |
| 81 | * sym_get_choice_menu - get the parent choice menu if present | 72 | * sym_get_choice_menu - get the parent choice menu if present |
| 82 | * | 73 | * |
| @@ -1225,8 +1216,7 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym) · 1142 unmodified lines | |||
| 1225 | stack.expr = NULL; | 1216 | stack.expr = NULL; |
| 1226 | 1217 | ||
| 1227 | for (prop = sym->prop; prop; prop = prop->next) { | 1218 | for (prop = sym->prop; prop; prop = prop->next) { |
| 1228 | if (prop->type == P_CHOICE || prop->type == P_SELECT || | 1219 | if (prop->type == P_SELECT || prop->type == P_IMPLY) |
| 1229 | prop->type == P_IMPLY) | ||
| 1230 | continue; | 1220 | continue; |
| 1231 | stack.prop = prop; | 1221 | stack.prop = prop; |
| 1232 | sym2 = sym_check_expr_deps(prop->visible.expr); | 1222 | sym2 = sym_check_expr_deps(prop->visible.expr); |
| @@ -1343,8 +1333,6 @@ const char *prop_get_type_name(enum prop_type type) · 110 unmodified lines | |||
| 1343 | return "menu"; | 1333 | return "menu"; |
| 1344 | case P_DEFAULT: | 1334 | case P_DEFAULT: |
| 1345 | return "default"; | 1335 | return "default"; |
| 1346 | case P_CHOICE: | ||
| 1347 | return "choice"; | ||
| 1348 | case P_SELECT: | 1336 | case P_SELECT: |
| 1349 | return "select"; | 1337 | return "select"; |
| 1350 | case P_IMPLY: | 1338 | case P_IMPLY: |