From c872d1883ffe12e392450c48e231eefc3f41a53f Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 16 Aug 2012 17:19:56 +0200 Subject: [PATCH] isl_map_free: return NULL Signed-off-by: Sven Verdoolaege --- doc/user.pod | 2 +- include/isl/map.h | 2 +- isl_map.c | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/user.pod b/doc/user.pod index e30eb97..2a286eb 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -1284,7 +1284,7 @@ functions. 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); + void *isl_map_free(__isl_take isl_map *map); void *isl_union_map_free(__isl_take isl_union_map *umap); Other sets and relations can be constructed by starting diff --git a/include/isl/map.h b/include/isl/map.h index fdef473..7f86644 100644 --- a/include/isl/map.h +++ b/include/isl/map.h @@ -308,7 +308,7 @@ __isl_give isl_map *isl_map_lex_ge_first(__isl_take isl_space *dim, unsigned n); __isl_give isl_map *isl_map_lex_gt(__isl_take isl_space *set_dim); __isl_give isl_map *isl_map_lex_ge(__isl_take isl_space *set_dim); struct isl_map *isl_map_finalize(struct isl_map *map); -void isl_map_free(__isl_take isl_map *map); +void *isl_map_free(__isl_take isl_map *map); __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map); struct isl_map *isl_map_extend(struct isl_map *base, unsigned nparam, unsigned n_in, unsigned n_out); diff --git a/isl_map.c b/isl_map.c index 3d06e71..a43f5af 100644 --- a/isl_map.c +++ b/isl_map.c @@ -5059,21 +5059,23 @@ error: return NULL; } -void isl_map_free(struct isl_map *map) +void *isl_map_free(struct isl_map *map) { int i; if (!map) - return; + return NULL; if (--map->ref > 0) - return; + return NULL; isl_ctx_deref(map->ctx); for (i = 0; i < map->n; ++i) isl_basic_map_free(map->p[i]); isl_space_free(map->dim); free(map); + + return NULL; } struct isl_map *isl_map_extend(struct isl_map *base, -- 2.7.4