From 36747435272d0f30f8f14773adcb512c257f704a Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 3 Oct 2012 17:05:22 +0200 Subject: [PATCH] pet_array_free: return NULL pointer of type struct pet_array * Returning a pointer of type struct pet_array * makes it easier to assign the result to a variable of that type in C++. Signed-off-by: Sven Verdoolaege --- scop.c | 6 +++--- scop.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scop.c b/scop.c index 9e6e519..f219582 100644 --- a/scop.c +++ b/scop.c @@ -643,7 +643,7 @@ void pet_stmt_dump(struct pet_stmt *stmt) stmt_dump(stmt, 0); } -void *pet_array_free(struct pet_array *array) +struct pet_array *pet_array_free(struct pet_array *array) { if (!array) return NULL; @@ -2194,8 +2194,8 @@ static __isl_give isl_space *array_collect_params(struct pet_array *array, return dim; error: - isl_space_free(dim); - return pet_array_free(array); + pet_array_free(array); + return isl_space_free(dim); } /* Add all parameters in "scop" to "dim" and return the result. diff --git a/scop.h b/scop.h index 602c092..954e712 100644 --- a/scop.h +++ b/scop.h @@ -43,7 +43,7 @@ void pet_stmt_dump(struct pet_stmt *stmt); void *pet_stmt_free(struct pet_stmt *stmt); void pet_array_dump(struct pet_array *array); -void *pet_array_free(struct pet_array *array); +struct pet_array *pet_array_free(struct pet_array *array); struct pet_stmt *pet_stmt_prefix(struct pet_stmt *stmt, int pos); -- 2.11.4.GIT