From 9ca5fc86a100303f29953d1b63f3de3490ebfec2 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Wed, 30 May 2018 08:07:44 +0200 Subject: [PATCH] isl_ast_graft_free: return isl_ast_graft * instead of void * While the currently returned void pointer is automatically converted to "isl_ast_graft *" where needed, it is both clearer and more in line with other isl functions to return a pointer to the type of the object that is freed. This allows analysis tools to catch bugs where the return type is implicitly converted to a different type. Signed-off-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- isl_ast_graft.c | 2 +- isl_ast_graft_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/isl_ast_graft.c b/isl_ast_graft.c index 0c616052..5c79eae0 100644 --- a/isl_ast_graft.c +++ b/isl_ast_graft.c @@ -993,7 +993,7 @@ __isl_give isl_ast_node *isl_ast_node_from_graft_list( return isl_ast_node_from_ast_node_list(node_list); } -void *isl_ast_graft_free(__isl_take isl_ast_graft *graft) +__isl_null isl_ast_graft *isl_ast_graft_free(__isl_take isl_ast_graft *graft) { if (!graft) return NULL; diff --git a/isl_ast_graft_private.h b/isl_ast_graft_private.h index 400b9a88..0456a6f8 100644 --- a/isl_ast_graft_private.h +++ b/isl_ast_graft_private.h @@ -53,7 +53,7 @@ __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse( __isl_keep isl_ast_build *build); __isl_give isl_ast_graft *isl_ast_graft_alloc_domain( __isl_take isl_map *schedule, __isl_keep isl_ast_build *build); -void *isl_ast_graft_free(__isl_take isl_ast_graft *graft); +__isl_null isl_ast_graft *isl_ast_graft_free(__isl_take isl_ast_graft *graft); __isl_give isl_ast_graft_list *isl_ast_graft_list_sort_guard( __isl_take isl_ast_graft_list *list); -- 2.11.4.GIT