From 5917b333146d7a31f7e9f44ebccb24e557f4a272 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 28 Aug 2017 14:34:47 +0200 Subject: [PATCH] refactor: list_init() should return an integer like all other _init() functions --- include/villas/list.h | 2 +- lib/list.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/villas/list.h b/include/villas/list.h index 3be253561..f6ba29dae 100644 --- a/include/villas/list.h +++ b/include/villas/list.h @@ -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 * diff --git a/lib/list.c b/lib/list.c index 1fa4e03e3..32cac84a4 100644 --- a/lib/list.c +++ b/lib/list.c @@ -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)