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:
parent
50b3529c90
commit
5917b33314
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue