aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scope.c
diff options
authorLinus Torvalds <torvalds@home.osdl.org>2003-08-02 20:37:16 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:01:00 -0700
commitbdfb7140eaa2700fd3f9db4b46bb3fb9a5d537f7 (patch)
treef4722c40b145cb596e3fe3a18c3f32113831b4a3 /scope.c
parent09ff8b4f71fe3013ec9086261ef02715be139492 (diff)
downloadsparse-dev-bdfb7140eaa2700fd3f9db4b46bb3fb9a5d537f7.tar.gz
More conversion from "iterate()" to an explicit FOR_EACH_PTR()
loop. In particular, this cleans up the compound statement return type handling a lot. It's just a lot more obvious with the straigth loop, and no indirection through an iterator function.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 98c74bea..e3fcb7ec 100644
--- a/scope.c
+++ b/scope.c
@@ -45,7 +45,7 @@ void start_function_scope(void)
start_scope(&block_scope);
}
-static void remove_symbol_scope(struct symbol *sym, void *data, int flags)
+static void remove_symbol_scope(struct symbol *sym)
{
struct symbol **ptr = sym->id_list;
@@ -58,10 +58,13 @@ static void end_scope(struct scope **s)
{
struct scope *scope = *s;
struct symbol_list *symbols = scope->symbols;
+ struct symbol *sym;
*s = scope->next;
scope->symbols = NULL;
- symbol_iterate(symbols, remove_symbol_scope, NULL);
+ FOR_EACH_PTR(symbols, sym) {
+ remove_symbol_scope(sym);
+ } END_FOR_EACH_PTR;
}
void end_symbol_scope(void)