X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fstrmap%2Fstrmap.c;h=9fa51d0d40db4cf89fb16041585d71ea163b2238;hb=5f551788224a3cf0988ae490a807b20292822f20;hp=872ca544c6aab1fa3b9d813534b74486cf77ec70;hpb=8bb0697b44f0dc4168f72ee621a291d68fefd4ad;p=ccan diff --git a/ccan/strmap/strmap.c b/ccan/strmap/strmap.c index 872ca544..9fa51d0d 100644 --- a/ccan/strmap/strmap.c +++ b/ccan/strmap/strmap.c @@ -174,17 +174,19 @@ char *strmap_del_(struct strmap *map, const char *member, void **valuep) } static bool iterate(struct strmap n, - bool (*handle)(const char *, void *, void *), void *data) + bool (*handle)(const char *, void *, void *), + const void *data) { if (n.v) - return handle(n.u.s, n.v, data); + return handle(n.u.s, n.v, (void *)data); return iterate(n.u.n->child[0], handle, data) - || iterate(n.u.n->child[1], handle, data); + && iterate(n.u.n->child[1], handle, data); } void strmap_iterate_(const struct strmap *map, - bool (*handle)(const char *, void *, void *), void *data) + bool (*handle)(const char *, void *, void *), + const void *data) { /* Empty map? */ if (!map->u.n)