File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -888,7 +888,7 @@ int conf_write(const char *name)
888888 "# %s\n"
889889 "#\n" , str );
890890 need_newline = false;
891- } else if (!(sym -> flags & SYMBOL_CHOICE ) &&
891+ } else if (!sym_is_choice (sym ) &&
892892 !(sym -> flags & SYMBOL_WRITTEN )) {
893893 sym_calc_value (sym );
894894 if (!(sym -> flags & SYMBOL_WRITE ))
Original file line number Diff line number Diff line change 7272/*
7373 * Represents a configuration symbol.
7474 *
75- * Choices are represented as a special kind of symbol and have the
76- * SYMBOL_CHOICE bit set in 'flags'.
75+ * Choices are represented as a special kind of symbol with null name.
7776 */
7877struct symbol {
7978 /* link node for the hash table */
@@ -131,7 +130,6 @@ struct symbol {
131130
132131#define SYMBOL_CONST 0x0001 /* symbol is const */
133132#define SYMBOL_CHECK 0x0008 /* used during dependency checking */
134- #define SYMBOL_CHOICE 0x0010 /* start of a choice block (null name) */
135133#define SYMBOL_CHOICEVAL 0x0020 /* used as a value in a choice block */
136134#define SYMBOL_VALID 0x0080 /* set when symbol.curr is calculated */
137135#define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */
Original file line number Diff line number Diff line change @@ -83,8 +83,6 @@ static const char *dbg_sym_flags(int val)
8383 strcat (buf , "const/" );
8484 if (val & SYMBOL_CHECK )
8585 strcat (buf , "check/" );
86- if (val & SYMBOL_CHOICE )
87- strcat (buf , "choice/" );
8886 if (val & SYMBOL_CHOICEVAL )
8987 strcat (buf , "choiceval/" );
9088 if (val & SYMBOL_VALID )
Original file line number Diff line number Diff line change @@ -129,7 +129,8 @@ static inline struct symbol *sym_get_choice_value(struct symbol *sym)
129129
130130static inline bool sym_is_choice (struct symbol * sym )
131131{
132- return sym -> flags & SYMBOL_CHOICE ? true : false;
132+ /* A choice is a symbol with no name */
133+ return sym -> name == NULL ;
133134}
134135
135136static inline bool sym_is_choice_value (struct symbol * sym )
Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ config_option: T_MODULES T_EOL
224224
225225choice : T_CHOICE T_EOL
226226{
227- struct symbol *sym = sym_lookup(NULL , SYMBOL_CHOICE );
227+ struct symbol *sym = sym_lookup(NULL , 0 );
228228 sym->flags |= SYMBOL_NO_WRITE;
229229 menu_add_entry (sym);
230230 menu_add_expr (P_CHOICE, NULL , NULL );
Original file line number Diff line number Diff line change @@ -827,7 +827,7 @@ struct symbol *sym_lookup(const char *name, int flags)
827827 if (symbol -> name &&
828828 !strcmp (symbol -> name , name ) &&
829829 (flags ? symbol -> flags & flags
830- : !(symbol -> flags & ( SYMBOL_CONST | SYMBOL_CHOICE ) )))
830+ : !(symbol -> flags & SYMBOL_CONST )))
831831 return symbol ;
832832 }
833833 new_name = xstrdup (name );
You can’t perform that action at this time.
0 commit comments