File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1083,7 +1083,7 @@ static void randomize_choice_values(struct symbol *csym)
10831083 csym -> flags &= ~(SYMBOL_VALID );
10841084}
10851085
1086- static void set_all_choice_values (struct symbol * csym )
1086+ void set_all_choice_values (struct symbol * csym )
10871087{
10881088 struct property * prop ;
10891089 struct symbol * sym ;
@@ -1100,7 +1100,7 @@ static void set_all_choice_values(struct symbol *csym)
11001100 }
11011101 csym -> flags |= SYMBOL_DEF_USER ;
11021102 /* clear VALID to get value calculated */
1103- csym -> flags &= ~(SYMBOL_VALID );
1103+ csym -> flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES );
11041104}
11051105
11061106void conf_set_all_new_symbols (enum conf_def_mode mode )
@@ -1202,14 +1202,20 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
12021202 * selected in a choice block and we set it to yes,
12031203 * and the rest to no.
12041204 */
1205+ if (mode != def_random ) {
1206+ for_all_symbols (i , csym ) {
1207+ if ((sym_is_choice (csym ) && !sym_has_value (csym )) ||
1208+ sym_is_choice_value (csym ))
1209+ csym -> flags |= SYMBOL_NEED_SET_CHOICE_VALUES ;
1210+ }
1211+ }
1212+
12051213 for_all_symbols (i , csym ) {
12061214 if (sym_has_value (csym ) || !sym_is_choice (csym ))
12071215 continue ;
12081216
12091217 sym_calc_value (csym );
12101218 if (mode == def_random )
12111219 randomize_choice_values (csym );
1212- else
1213- set_all_choice_values (csym );
12141220 }
12151221}
Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ struct symbol {
106106#define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */
107107#define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */
108108
109+ /* choice values need to be set before calculating this symbol value */
110+ #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000
111+
109112#define SYMBOL_MAXLENGTH 256
110113#define SYMBOL_HASHSIZE 9973
111114
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ char *conf_get_default_confname(void);
8787void sym_set_change_count (int count );
8888void sym_add_change_count (int count );
8989void conf_set_all_new_symbols (enum conf_def_mode mode );
90+ void set_all_choice_values (struct symbol * csym );
9091
9192struct conf_printer {
9293 void (* print_symbol )(FILE * , struct symbol * , const char * , void * );
Original file line number Diff line number Diff line change @@ -300,6 +300,14 @@ void sym_calc_value(struct symbol *sym)
300300
301301 if (sym -> flags & SYMBOL_VALID )
302302 return ;
303+
304+ if (sym_is_choice_value (sym ) &&
305+ sym -> flags & SYMBOL_NEED_SET_CHOICE_VALUES ) {
306+ sym -> flags &= ~SYMBOL_NEED_SET_CHOICE_VALUES ;
307+ prop = sym_get_choice_prop (sym );
308+ sym_calc_value (prop_get_symbol (prop ));
309+ }
310+
303311 sym -> flags |= SYMBOL_VALID ;
304312
305313 oldval = sym -> curr ;
@@ -425,6 +433,9 @@ void sym_calc_value(struct symbol *sym)
425433
426434 if (sym -> flags & SYMBOL_AUTO )
427435 sym -> flags &= ~SYMBOL_WRITE ;
436+
437+ if (sym -> flags & SYMBOL_NEED_SET_CHOICE_VALUES )
438+ set_all_choice_values (sym );
428439}
429440
430441void sym_clear_all_valid (void )
You can’t perform that action at this time.
0 commit comments