* Sanitize pointer()
@ 2009-03-11 7:08 Al Viro
0 siblings, 0 replies; only message in thread
From: Al Viro @ 2009-03-11 7:08 UTC (permalink / raw)
To: linux-sparse
There's no need to concat the context list into (empty) one of new node,
only to free the original one. Moving the pointer to list instead works
fine...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
parse.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/parse.c b/parse.c
index 28bc0c9..f16d321 100644
--- a/parse.c
+++ b/parse.c
@@ -1592,28 +1592,18 @@ static struct token *direct_declarator(struct token *token, struct decl_state *c
static struct token *pointer(struct token *token, struct decl_state *ctx)
{
- unsigned long modifiers;
- struct symbol *base_type;
-
- modifiers = ctx->ctype.modifiers;
- base_type = ctx->ctype.base_type;
-
while (match_op(token,'*')) {
struct symbol *ptr = alloc_symbol(token->pos, SYM_PTR);
- ptr->ctype.modifiers = modifiers;
+ ptr->ctype.modifiers = ctx->ctype.modifiers;
+ ptr->ctype.base_type = ctx->ctype.base_type;
ptr->ctype.as = ctx->ctype.as;
- concat_ptr_list((struct ptr_list *)ctx->ctype.contexts,
- (struct ptr_list **)&ptr->ctype.contexts);
- ptr->ctype.base_type = base_type;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-11 7:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 7:08 Sanitize pointer() Al Viro
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).