aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_somerc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/PJ_somerc.c')
-rw-r--r--src/PJ_somerc.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/PJ_somerc.c b/src/PJ_somerc.c
index 751d0c77..7324d48a 100644
--- a/src/PJ_somerc.c
+++ b/src/PJ_somerc.c
@@ -1,4 +1,5 @@
#define PJ_LIB__
+#include <errno.h>
#include <proj.h>
#include "projects.h"
@@ -63,31 +64,11 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-#if 0
-FREEUP; if (P) pj_dalloc(P); }
-#endif
-
-
-static void *freeup_new (PJ *P) { /* Destructor */
- if (0==P)
- return 0;
- if (0==P->opaque)
- return pj_dealloc (P);
- pj_dealloc (P->opaque);
- return pj_dealloc(P);
-}
-
-static void freeup (PJ *P) {
- freeup_new (P);
- return;
-}
-
-
PJ *PROJECTION(somerc) {
double cp, phip0, sp;
struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque));
if (0==Q)
- return freeup_new (P);
+ return pj_default_destructor (P, ENOMEM);
P->opaque = Q;