From 4684ca07e388147c24b461bcbdcd5cf84d30a2cd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 25 Jul 2011 08:39:13 +0200 Subject: [PATCH] *_list_free: return NULL Signed-off-by: Sven Verdoolaege --- doc/user.pod | 2 +- include/isl/list.h | 2 +- isl_list_templ.c | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/user.pod b/doc/user.pod index fc77645..f5cfabf 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2268,7 +2268,7 @@ Lists can be created, copied and freed using the following functions. __isl_give isl_set_list *isl_set_list_add( __isl_take isl_set_list *list, __isl_take isl_set *el); - void isl_set_list_free(__isl_take isl_set_list *list); + void *isl_set_list_free(__isl_take isl_set_list *list); C creates an empty list with a capacity for C elements. diff --git a/include/isl/list.h b/include/isl/list.h index 51387c3..765d016 100644 --- a/include/isl/list.h +++ b/include/isl/list.h @@ -25,7 +25,7 @@ isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list); \ __isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \ __isl_give isl_##EL##_list *isl_##EL##_list_copy( \ __isl_keep isl_##EL##_list *list); \ -void isl_##EL##_list_free(__isl_take isl_##EL##_list *list); \ +void *isl_##EL##_list_free(__isl_take isl_##EL##_list *list); \ __isl_give isl_##EL##_list *isl_##EL##_list_add( \ __isl_take isl_##EL##_list *list, \ __isl_take struct isl_##EL *el); \ diff --git a/isl_list_templ.c b/isl_list_templ.c index 0bf8294..00f993d 100644 --- a/isl_list_templ.c +++ b/isl_list_templ.c @@ -85,20 +85,22 @@ error: return NULL; } -void FN(LIST(EL),free)(__isl_take LIST(EL) *list) +void *FN(LIST(EL),free)(__isl_take LIST(EL) *list) { int i; if (!list) - return; + return NULL; if (--list->ref > 0) - return; + return NULL; isl_ctx_deref(list->ctx); for (i = 0; i < list->n; ++i) FN(EL,free)(list->p[i]); free(list); + + return NULL; } int FN(FN(LIST(EL),n),BASE)(__isl_keep LIST(EL) *list) -- 2.7.4