isl_set_free: return NULL
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 30 Jun 2012 12:47:04 +0000 (14:47 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 2 Aug 2012 10:20:08 +0000 (12:20 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/set.h
isl_map.c

index 53725a8..b8770c0 100644 (file)
@@ -1220,7 +1220,7 @@ functions.
        __isl_give isl_union_map *isl_union_map_copy(
                __isl_keep isl_union_map *umap);
        void isl_basic_set_free(__isl_take isl_basic_set *bset);
-       void isl_set_free(__isl_take isl_set *set);
+       void *isl_set_free(__isl_take isl_set *set);
        void *isl_union_set_free(__isl_take isl_union_set *uset);
        void isl_basic_map_free(__isl_take isl_basic_map *bmap);
        void isl_map_free(__isl_take isl_map *map);
index 6be9ba4..ae45890 100644 (file)
@@ -251,7 +251,7 @@ __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
                                                __isl_take isl_basic_set *bset);
 struct isl_set *isl_set_finalize(struct isl_set *set);
 __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
-void isl_set_free(__isl_take isl_set *set);
+void *isl_set_free(__isl_take isl_set *set);
 struct isl_set *isl_set_dup(struct isl_set *set);
 __isl_constructor
 __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset);
index 44a2056..fc4835e 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -2471,21 +2471,23 @@ __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
                                                (struct isl_basic_map *)bset);
 }
 
-void isl_set_free(struct isl_set *set)
+void *isl_set_free(__isl_take isl_set *set)
 {
        int i;
 
        if (!set)
-               return;
+               return NULL;
 
        if (--set->ref > 0)
-               return;
+               return NULL;
 
        isl_ctx_deref(set->ctx);
        for (i = 0; i < set->n; ++i)
                isl_basic_set_free(set->p[i]);
        isl_space_free(set->dim);
        free(set);
+
+       return NULL;
 }
 
 void isl_set_print_internal(struct isl_set *set, FILE *out, int indent)