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
+6 -3
View File
@@ -165,8 +165,12 @@ METHOD(child_cfg_t, add_proposal, void,
}
}
static bool match_proposal(proposal_t *item, proposal_t *proposal)
CALLBACK(match_proposal, bool,
proposal_t *item, va_list args)
{
proposal_t *proposal;
VA_ARGS_VGET(args, proposal);
return item->equals(item, proposal);
}
@@ -185,8 +189,7 @@ METHOD(child_cfg_t, get_proposals, linked_list_t*,
{
current->strip_dh(current, MODP_NONE);
}
if (proposals->find_first(proposals, (linked_list_match_t)match_proposal,
NULL, current) == SUCCESS)
if (proposals->find_first(proposals, match_proposal, NULL, current))
{
current->destroy(current);
continue;