1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

refactor: list_init() should return an integer like all other _init() functions

This commit is contained in:
Steffen Vogel 2017-08-28 14:34:47 +02:00
parent 50b3529c90
commit 5917b33314
2 changed files with 4 additions and 2 deletions

View file

@ -67,7 +67,7 @@ struct list {
*
* @param l A pointer to the list data structure.
*/
void list_init(struct list *l);
int list_init(struct list *l);
/** Destroy a list and call destructors for all list elements
*

View file

@ -47,7 +47,7 @@ static int cmp_sort(const void *a, const void *b, void *thunk) {
return cmp(*(void **) a, *(void **) b);
}
void list_init(struct list *l)
int list_init(struct list *l)
{
assert(l->state == STATE_DESTROYED);
@ -58,6 +58,8 @@ void list_init(struct list *l)
l->array = NULL;
l->state = STATE_INITIALIZED;
return 0;
}
int list_destroy(struct list *l, dtor_cb_t destructor, bool release)