*_list_free: return NULL
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 25 Jul 2011 06:39:13 +0000 (08:39 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 28 Jul 2011 14:38:41 +0000 (16:38 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/list.h
isl_list_templ.c

index fc77645..f5cfabf 100644 (file)
@@ -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<isl_set_list_alloc> creates an empty list with a capacity for
 C<n> elements.
index 51387c3..765d016 100644 (file)
@@ -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);                                \
index 0bf8294..00f993d 100644 (file)
@@ -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)