aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Li <sparse@chrisli.org>2008-12-18 01:33:19 +0300
committerAlexey Zaytsev <alexey.zaytsev@gmail.com>2008-12-18 21:10:59 +0300
commitcaffda221c4e2db78b03f5e6f8c43d1104f02004 (patch)
treec1fcd03b95b172a309e6b80f4a4fb030c3a07bb6
parent383fe762a3c5d4a5c6dae2046e852e17ea6385d3 (diff)
downloadsparse-caffda221c4e2db78b03f5e6f8c43d1104f02004.tar.gz
sparse-caffda221c4e2db78b03f5e6f8c43d1104f02004.tar.xz
sparse-caffda221c4e2db78b03f5e6f8c43d1104f02004.zip
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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/parse.c b/parse.c
index 915ae20..eb31871 100644
--- a/parse.c
+++ b/parse.c
@@ -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;
}