diff options
author | Christopher Li <sparse@chrisli.org> | 2008-12-18 01:33:19 +0300 |
---|---|---|
committer | Alexey Zaytsev <alexey.zaytsev@gmail.com> | 2008-12-18 21:10:59 +0300 |
commit | caffda221c4e2db78b03f5e6f8c43d1104f02004 (patch) | |
tree | c1fcd03b95b172a309e6b80f4a4fb030c3a07bb6 | |
parent | 383fe762a3c5d4a5c6dae2046e852e17ea6385d3 (diff) | |
download | sparse-caffda221c4e2db78b03f5e6f8c43d1104f02004.tar.gz |
Add enum member list to the parent
Signed-Off-By: Christopher Li <sparse@chrisli.org>
Acked-by: Thomas Schmid <Thomas.Schmid@br-automation.com>
-rw-r--r-- | parse.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -665,7 +665,6 @@ static struct token *parse_enum_declaration(struct token *token, struct symbol * unsigned long long lastval = 0; struct symbol *ctype = NULL, *base_type = NULL; Num upper = {-1, 0}, lower = {1, 0}; - struct symbol_list *entries = NULL; parent->examined = 1; parent->ctype.base_type = &int_ctype; @@ -701,7 +700,7 @@ static struct token *parse_enum_declaration(struct token *token, struct symbol * sym->initializer = expr; sym->enum_member = 1; sym->ctype.base_type = parent; - add_ptr_list(&entries, sym); + add_ptr_list(&parent->symbol_list, sym); if (base_type != &bad_ctype) { if (ctype->type == SYM_NODE) @@ -777,8 +776,7 @@ static struct token *parse_enum_declaration(struct token *token, struct symbol * parent->ctype.modifiers |= (base_type->ctype.modifiers & MOD_UNSIGNED); parent->examined = 0; - cast_enum_list(entries, base_type); - free_ptr_list(&entries); + cast_enum_list(parent->symbol_list, base_type); return token; } |