From 7c8625dc0c8544c7e562991a0757b9c3d8f858f2 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 26 Jul 2010 23:05:32 +0200 Subject: [PATCH] isl_hash_table_foreach: pass pointer to entry data Signed-off-by: Sven Verdoolaege --- include/isl_hash.h | 4 ++-- isl_hash.c | 4 ++-- isl_stream.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/isl_hash.h b/include/isl_hash.h index 97e008b..53eda85 100644 --- a/include/isl_hash.h +++ b/include/isl_hash.h @@ -66,8 +66,8 @@ struct isl_hash_table_entry *isl_hash_table_find(struct isl_ctx *ctx, int (*eq)(const void *entry, const void *val), const void *val, int reserve); int isl_hash_table_foreach(struct isl_ctx *ctx, - struct isl_hash_table *table, - int (*fn)(void *entry, void *user), void *user); + struct isl_hash_table *table, + int (*fn)(void **entry, void *user), void *user); void isl_hash_table_remove(struct isl_ctx *ctx, struct isl_hash_table *table, struct isl_hash_table_entry *entry); diff --git a/isl_hash.c b/isl_hash.c index 5abf9fd..b7bac23 100644 --- a/isl_hash.c +++ b/isl_hash.c @@ -163,7 +163,7 @@ struct isl_hash_table_entry *isl_hash_table_find(struct isl_ctx *ctx, int isl_hash_table_foreach(struct isl_ctx *ctx, struct isl_hash_table *table, - int (*fn)(void *entry, void *user), void *user) + int (*fn)(void **entry, void *user), void *user) { size_t size; uint32_t h; @@ -171,7 +171,7 @@ int isl_hash_table_foreach(struct isl_ctx *ctx, size = 1 << table->bits; for (h = 0; h < size; ++ h) if (table->entries[h].data && - fn(table->entries[h].data, user) < 0) + fn(&table->entries[h].data, user) < 0) return -1; return 0; diff --git a/isl_stream.c b/isl_stream.c index 7e70a6e..90ca640 100644 --- a/isl_stream.c +++ b/isl_stream.c @@ -538,9 +538,9 @@ int isl_stream_is_empty(struct isl_stream *s) return 0; } -static int free_keyword(void *p, void *user) +static int free_keyword(void **p, void *user) { - struct isl_keyword *keyword = p; + struct isl_keyword *keyword = *p; free(keyword->name); free(keyword); -- 2.7.4