From 046270a85faf20f38d01e02942d197db74bb8542 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Fri, 20 Nov 2020 16:37:12 +0100 Subject: Remove old pj_ memory (de)allocation functions Gone are pj_malloc, pj_calloc, pj_dalloc and pj_dealloc. Their primary function as API memory functions in proj_api.h is no longer there and the other use as a workaround for old errno problems is no longer valid either. Replaced with malloc and free across the codebase. --- src/transformations/horner.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/transformations/horner.cpp') diff --git a/src/transformations/horner.cpp b/src/transformations/horner.cpp index a6638773..2c049186 100644 --- a/src/transformations/horner.cpp +++ b/src/transformations/horner.cpp @@ -89,8 +89,8 @@ PROJ_HEAD(horner, "Horner polynomial evaluation"); /* make horner.h interface with proj's memory management */ -#define horner_dealloc(x) pj_dealloc(x) -#define horner_calloc(n,x) pj_calloc(n,x) +#define horner_dealloc(x) free(x) +#define horner_calloc(n,x) calloc(n,x) namespace { // anonymous namespace struct horner { @@ -412,7 +412,7 @@ static int parse_coefs (PJ *P, double *coefs, const char *param, int ncoefs) { char *buf, *init, *next = nullptr; int i; - buf = static_cast(pj_calloc (strlen (param) + 2, sizeof(char))); + buf = static_cast(calloc (strlen (param) + 2, sizeof(char))); if (nullptr==buf) { proj_log_error (P, "Horner: No memory left"); return 0; @@ -420,12 +420,12 @@ static int parse_coefs (PJ *P, double *coefs, const char *param, int ncoefs) { sprintf (buf, "t%s", param); if (0==pj_param (P->ctx, P->params, buf).i) { - pj_dealloc (buf); + free (buf); return 0; } sprintf (buf, "s%s", param); init = pj_param(P->ctx, P->params, buf).s; - pj_dealloc (buf); + free (buf); for (i = 0; i < ncoefs; i++) { if (i > 0) { -- cgit v1.2.3