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
+7 -6
View File
@@ -92,11 +92,12 @@ static void overlay_destroy(overlay_t *this)
free(this);
}
/**
* compare two overlays by path
*/
static bool overlay_equals(overlay_t *this, overlay_t *other)
CALLBACK(overlay_equals, bool,
overlay_t *this, va_list args)
{
overlay_t *other;
VA_ARGS_VGET(args, other);
return streq(this->path, other->path);
}
@@ -108,8 +109,8 @@ static bool overlay_remove(private_cowfs_t *this, char *path)
{
overlay_t over, *current;
over.path = path;
if (this->overlays->find_first(this->overlays,
(linked_list_match_t)overlay_equals, (void**)&current, &over) != SUCCESS)
if (!this->overlays->find_first(this->overlays, overlay_equals,
(void**)&current, &over))
{
return FALSE;
}