summaryrefslogtreecommitdiff
path: root/src/basic/set.h
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-06-16 14:44:43 +0200
committerMichal Schmidt <mschmidt@redhat.com>2015-06-16 14:44:43 +0200
commit9ef41ffeec0a677f0c8006b17e5ff1c8434418a3 (patch)
treeb0f66b97ddf0e13c4cd1240fc0fd7ef6ad618a82 /src/basic/set.h
parentaab723074c368f65aaf2748d0c530ba9a1e6ad3e (diff)
parent8927b1dad2d4a7330174cb924090b4635a2547fb (diff)
Merge pull request #197 from dvdhrm/hashmap
hashmap: fix iterators to not skip entries
Diffstat (limited to 'src/basic/set.h')
-rw-r--r--src/basic/set.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/set.h b/src/basic/set.h
index 4dffecd39d..51e40d3a6c 100644
--- a/src/basic/set.h
+++ b/src/basic/set.h
@@ -91,7 +91,7 @@ static inline unsigned set_buckets(Set *s) {
return internal_hashmap_buckets(HASHMAP_BASE(s));
}
-void *set_iterate(Set *s, Iterator *i);
+bool set_iterate(Set *s, Iterator *i, void **value);
static inline void set_clear(Set *s) {
internal_hashmap_clear(HASHMAP_BASE(s));
@@ -125,7 +125,7 @@ int set_put_strdup(Set *s, const char *p);
int set_put_strdupv(Set *s, char **l);
#define SET_FOREACH(e, s, i) \
- for ((i) = ITERATOR_FIRST, (e) = set_iterate((s), &(i)); (e); (e) = set_iterate((s), &(i)))
+ for ((i) = ITERATOR_FIRST; set_iterate((s), &(i), (void**)&(e)); )
DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free);
DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free_free);