From: "Christopher Li" <sparse@chrisli.org>
To: Thomas Schmid <Thomas.Schmid@br-automation.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: Re: [PATCH 15/16] deal with enum members without excessive PITA
Date: Fri, 14 Dec 2007 13:01:03 -0800 [thread overview]
Message-ID: <70318cbf0712141301s7bafda84ta7d7b087a0f13685@mail.gmail.com> (raw)
In-Reply-To: <OF6BBF04CB.C9CFEDC1-ONC12573B1.003FBE96-C12573B1.0042C7E1@br-automation.com>
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
On Dec 14, 2007 4:09 AM, Thomas Schmid <Thomas.Schmid@br-automation.com> wrote:
> How about the idea, looping over the syms within global_scope?
I think that will work too.
> > > It should be trivial make a patch to add members to the parent
> > symbol->symbol_list though.
> Would you possibly?
Can you try the attached patch?
Chris
[-- Attachment #2: enum-members --]
[-- Type: application/octet-stream, Size: 1171 bytes --]
Add enum member list to the parent
Signed-Off-By: Christopher Li <sparse@chrisli.org>
Index: sparse/parse.c
===================================================================
--- sparse.orig/parse.c 2007-12-14 12:33:05.000000000 -0800
+++ sparse/parse.c 2007-12-14 12:42:39.000000000 -0800
@@ -651,7 +651,6 @@ static struct token *parse_enum_declarat
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;
@@ -687,7 +686,7 @@ static struct token *parse_enum_declarat
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)
@@ -763,8 +762,7 @@ static struct token *parse_enum_declarat
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;
}
next prev parent reply other threads:[~2007-12-14 21:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-24 8:05 [PATCH 15/16] deal with enum members without excessive PITA Al Viro
2007-12-13 14:21 ` Thomas Schmid
2007-12-14 0:18 ` Christopher Li
2007-12-14 12:09 ` Antwort: " Thomas Schmid
2007-12-14 21:01 ` Christopher Li [this message]
2007-12-17 13:15 ` Antwort: " Thomas Schmid
2008-04-25 5:27 ` Thomas Schmid
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70318cbf0712141301s7bafda84ta7d7b087a0f13685@mail.gmail.com \
--to=sparse@chrisli.org \
--cc=Thomas.Schmid@br-automation.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).