aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2006-12-15 00:37:40 +0300
committerJosh Triplett <josh@freedesktop.org>2007-02-22 19:57:08 -0800
commit35fc4ae6e7a789a9a739c3a68af7dd8630c3e10c (patch)
treec973230dec283a83bc35a2154aa6e9097a673a62 /dissect.c
parentMake the ptrlist using the sparse allocator. (diff)
downloadsparse-35fc4ae6e7a789a9a739c3a68af7dd8630c3e10c.tar.gz
sparse-35fc4ae6e7a789a9a739c3a68af7dd8630c3e10c.tar.bz2
sparse-35fc4ae6e7a789a9a739c3a68af7dd8630c3e10c.zip
dissect: cleanup report_implicit()
It doesn't make sense to do report_implicit() for the anonymous structures, check "type->ident != NULL". Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Diffstat (limited to 'dissect.c')
-rw-r--r--dissect.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dissect.c b/dissect.c
index 471eac0..81e3ab7 100644
--- a/dissect.c
+++ b/dissect.c
@@ -130,12 +130,14 @@ static void report_implicit(usage_t mode, struct position *pos, struct symbol *t
if (type->type != SYM_STRUCT && type->type != SYM_UNION)
return;
- if (reporter->r_member) {
+ if (!reporter->r_member)
+ return;
+
+ if (type->ident != NULL)
reporter->r_member(mode, pos, type, NULL);
- DO_LIST(type->symbol_list, mem,
- report_implicit(mode, pos, base_type(mem)));
- }
+ DO_LIST(type->symbol_list, mem,
+ report_implicit(mode, pos, base_type(mem)));
}
static inline struct symbol *expr_symbol(struct expression *expr)