From f8f41422339018d4c3169d34cbc1df10341723bd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 30 Jun 2012 14:47:04 +0200 Subject: [PATCH] isl_set_free: return NULL Signed-off-by: Sven Verdoolaege --- doc/user.pod | 2 +- include/isl/set.h | 2 +- isl_map.c | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/user.pod b/doc/user.pod index 53725a89..b8770c06 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -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); diff --git a/include/isl/set.h b/include/isl/set.h index 6be9ba41..ae45890a 100644 --- a/include/isl/set.h +++ b/include/isl/set.h @@ -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); diff --git a/isl_map.c b/isl_map.c index 44a2056f..fc4835e4 100644 --- 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) -- 2.11.4.GIT