From eb32f341579b0a18f347f606a876dabeebf9bff9 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 1 Sep 2011 16:21:18 +0200 Subject: [PATCH] isl_qpolynomial_free: return NULL Signed-off-by: Sven Verdoolaege --- doc/user.pod | 2 +- include/isl/polynomial.h | 2 +- isl_polynomial.c | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/user.pod b/doc/user.pod index 93106a8..c9ea656 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2919,7 +2919,7 @@ functions. __isl_give isl_qpolynomial *isl_qpolynomial_copy( __isl_keep isl_qpolynomial *qp); - void isl_qpolynomial_free(__isl_take isl_qpolynomial *qp); + void *isl_qpolynomial_free(__isl_take isl_qpolynomial *qp); __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy( __isl_keep isl_pw_qpolynomial *pwqp); diff --git a/include/isl/polynomial.h b/include/isl/polynomial.h index 2b2ac4c..3fc3cd5 100644 --- a/include/isl/polynomial.h +++ b/include/isl/polynomial.h @@ -42,7 +42,7 @@ __isl_give isl_qpolynomial *isl_qpolynomial_div(__isl_take isl_div *div); __isl_give isl_qpolynomial *isl_qpolynomial_var(__isl_take isl_dim *dim, enum isl_dim_type type, unsigned pos); __isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp); -void isl_qpolynomial_free(__isl_take isl_qpolynomial *qp); +void *isl_qpolynomial_free(__isl_take isl_qpolynomial *qp); int isl_qpolynomial_plain_is_equal(__isl_keep isl_qpolynomial *qp1, __isl_keep isl_qpolynomial *qp2); diff --git a/isl_polynomial.c b/isl_polynomial.c index 2ec67f2..0d2a125 100644 --- a/isl_polynomial.c +++ b/isl_polynomial.c @@ -1018,19 +1018,20 @@ __isl_give isl_qpolynomial *isl_qpolynomial_cow(__isl_take isl_qpolynomial *qp) return isl_qpolynomial_dup(qp); } -void isl_qpolynomial_free(__isl_take isl_qpolynomial *qp) +void *isl_qpolynomial_free(__isl_take isl_qpolynomial *qp) { if (!qp) - return; + return NULL; if (--qp->ref > 0) - return; + return NULL; isl_dim_free(qp->dim); isl_mat_free(qp->div); isl_upoly_free(qp->upoly); free(qp); + return NULL; } __isl_give struct isl_upoly *isl_upoly_var_pow(isl_ctx *ctx, int pos, int power) -- 2.7.4