[CLASSES]: Pass the cookie to the filter in cu__for_each_function

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2006-12-20 12:05:29 -02:00
parent 5484abff49
commit 5cb0779231
3 changed files with 7 additions and 4 deletions

View File

@ -1191,7 +1191,8 @@ int cu__for_each_class(struct cu *self,
int cu__for_each_function(struct cu *cu,
int (*iterator)(struct function *func, void *cookie),
void *cookie,
struct function *(*filter)(struct function *function))
struct function *(*filter)(struct function *function,
void *cookie))
{
struct function *pos;
@ -1199,7 +1200,7 @@ int cu__for_each_function(struct cu *cu,
list_for_each_entry(pos, &cu->functions, tag.node) {
struct function *function = pos;
if (filter != NULL) {
function = filter(pos);
function = filter(pos, cookie);
if (function == NULL)
continue;
}

View File

@ -166,7 +166,8 @@ extern int cu__for_each_function(struct cu *cu,
int (*iterator)(struct function *func,
void *cookie),
void *cookie,
struct function *(*filter)(struct function *function));
struct function *(*filter)(struct function *function,
void *cookie));
extern void cus__for_each_cu(struct cus *self,
int (*iterator)(struct cu *cu,
void *cookie),

View File

@ -175,7 +175,8 @@ static void fn_stats__chkdupdef(const struct function *self,
putchar('\n');
}
static struct function *function__filter(struct function *function)
static struct function *function__filter(struct function *function,
void *cookie)
{
struct fn_stats *fstats;