isl_space_free: return NULL
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 6 Sep 2012 13:40:44 +0000 (15:40 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 6 Sep 2012 13:43:39 +0000 (15:43 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/space.h
isl_space.c

index 5a9d5cb..e21077e 100644 (file)
@@ -632,7 +632,7 @@ parameters is discouraged.
        __isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
                unsigned nparam, unsigned dim);
        __isl_give isl_space *isl_space_copy(__isl_keep isl_space *space);
-       void isl_space_free(__isl_take isl_space *space);
+       void *isl_space_free(__isl_take isl_space *space);
        unsigned isl_space_dim(__isl_keep isl_space *space,
                enum isl_dim_type type);
 
index 64ac5f0..4f20f25 100644 (file)
@@ -38,7 +38,7 @@ __isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
                        unsigned nparam, unsigned dim);
 __isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx, unsigned nparam);
 __isl_give isl_space *isl_space_copy(__isl_keep isl_space *dim);
-void isl_space_free(__isl_take isl_space *dim);
+void *isl_space_free(__isl_take isl_space *dim);
 
 int isl_space_is_params(__isl_keep isl_space *space);
 int isl_space_is_set(__isl_keep isl_space *space);
index 0f99d7c..625ea36 100644 (file)
@@ -333,15 +333,15 @@ __isl_give isl_space *isl_space_copy(__isl_keep isl_space *dim)
        return dim;
 }
 
-void isl_space_free(__isl_take isl_space *dim)
+void *isl_space_free(__isl_take isl_space *dim)
 {
        int i;
 
        if (!dim)
-               return;
+               return NULL;
 
        if (--dim->ref > 0)
-               return;
+               return NULL;
 
        isl_id_free(dim->tuple_id[0]);
        isl_id_free(dim->tuple_id[1]);
@@ -355,6 +355,8 @@ void isl_space_free(__isl_take isl_space *dim)
        isl_ctx_deref(dim->ctx);
        
        free(dim);
+
+       return NULL;
 }
 
 /* Check if "s" is a valid dimension or tuple name.