linked-list: Change return value of find_first() and signature of its callback

This avoids the unportable five pointer hack.
This commit is contained in:
Tobias Brunner
2017-05-26 13:56:44 +02:00
parent 8a2e4d4a8b
commit 2e4d110d1e
29 changed files with 526 additions and 398 deletions
@@ -106,12 +106,13 @@ METHOD(enumerator_t, enumerate_attrs, bool,
return FALSE;
}
/**
* Check if the given host has a matching address family
*/
static bool is_family(host_t *host, int *family)
CALLBACK(is_family, bool,
host_t *host, va_list args)
{
return host->get_family(host) == *family;
int family;
VA_ARGS_VGET(args, family);
return host->get_family(host) == family;
}
/**
@@ -119,7 +120,7 @@ static bool is_family(host_t *host, int *family)
*/
static bool has_host_family(linked_list_t *list, int family)
{
return list->find_first(list, (void*)is_family, NULL, &family) == SUCCESS;
return list->find_first(list, is_family, NULL, family);
}
METHOD(attribute_handler_t, create_attribute_enumerator, enumerator_t *,