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:
@@ -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 *,
|
||||
|
||||
Reference in New Issue
Block a user