projects
/
carl9170fw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://github.com/chunkeey/carl9170fw
[carl9170fw.git]
/
config
/
symbol.c
diff --git
a/config/symbol.c
b/config/symbol.c
index 071f00c3046e69e77112a4e5cf56d4f686fc101f..ecc5aa5f865db7d253facefc10cc77fc2404e41d 100644
(file)
--- a/
config/symbol.c
+++ b/
config/symbol.c
@@
-262,11
+262,18
@@
static struct symbol *sym_calc_choice(struct symbol *sym)
struct symbol *def_sym;
struct property *prop;
struct expr *e;
struct symbol *def_sym;
struct property *prop;
struct expr *e;
+ int flags;
/* first calculate all choice values' visibilities */
/* first calculate all choice values' visibilities */
+ flags = sym->flags;
prop = sym_get_choice_prop(sym);
prop = sym_get_choice_prop(sym);
- expr_list_for_each_sym(prop->expr, e, def_sym)
+ expr_list_for_each_sym(prop->expr, e, def_sym)
{
sym_calc_visibility(def_sym);
sym_calc_visibility(def_sym);
+ if (def_sym->visible != no)
+ flags &= def_sym->flags;
+ }
+
+ sym->flags &= flags | ~SYMBOL_DEF_USER;
/* is the user choice visible? */
def_sym = sym->def[S_DEF_USER].val;
/* is the user choice visible? */
def_sym = sym->def[S_DEF_USER].val;
@@
-649,11
+656,11
@@
bool sym_set_string_value(struct symbol *sym, const char *newval)
size = strlen(newval) + 1;
if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) {
size += 2;
size = strlen(newval) + 1;
if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) {
size += 2;
- sym->def[S_DEF_USER].val = val = malloc(size);
+ sym->def[S_DEF_USER].val = val =
x
malloc(size);
*val++ = '0';
*val++ = 'x';
} else if (!oldval || strcmp(oldval, newval))
*val++ = '0';
*val++ = 'x';
} else if (!oldval || strcmp(oldval, newval))
- sym->def[S_DEF_USER].val = val = malloc(size);
+ sym->def[S_DEF_USER].val = val =
x
malloc(size);
else
return true;
else
return true;
@@
-805,7
+812,7
@@
struct symbol *sym_lookup(const char *name, int flags)
hash = 0;
}
hash = 0;
}
- symbol = malloc(sizeof(*symbol));
+ symbol =
x
malloc(sizeof(*symbol));
memset(symbol, 0, sizeof(*symbol));
symbol->name = new_name;
symbol->type = S_UNKNOWN;
memset(symbol, 0, sizeof(*symbol));
symbol->name = new_name;
symbol->type = S_UNKNOWN;
@@
-856,7
+863,7
@@
const char *sym_expand_string_value(const char *in)
size_t reslen;
reslen = strlen(in) + 1;
size_t reslen;
reslen = strlen(in) + 1;
- res = malloc(reslen);
+ res =
x
malloc(reslen);
res[0] = '\0';
while ((src = strchr(in, '$'))) {
res[0] = '\0';
while ((src = strchr(in, '$'))) {
@@
-914,7
+921,7
@@
const char *sym_escape_string_value(const char *in)
p++;
}
p++;
}
- res = malloc(reslen);
+ res =
x
malloc(reslen);
res[0] = '\0';
strcat(res, "\"");
res[0] = '\0';
strcat(res, "\"");
@@
-1221,7
+1228,7
@@
struct property *prop_alloc(enum prop_type type, struct symbol *sym)
struct property *prop;
struct property **propp;
struct property *prop;
struct property **propp;
- prop = malloc(sizeof(*prop));
+ prop =
x
malloc(sizeof(*prop));
memset(prop, 0, sizeof(*prop));
prop->type = type;
prop->sym = sym;
memset(prop, 0, sizeof(*prop));
prop->type = type;
prop->sym = sym;