aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_urm5.c
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2017-07-17 23:10:09 +0200
committerKristian Evers <kristianevers@gmail.com>2017-07-18 11:47:20 +0200
commitad7a7c1b1d54c69b9df442797a809418d00d647d (patch)
treead9a4dd1bb9aa1fcbc17e82508ec0482d1d6d06d /src/PJ_urm5.c
parent2ec0759b8cdd45deae8b9aba70ec7d23c7c3ddd8 (diff)
downloadPROJ-ad7a7c1b1d54c69b9df442797a809418d00d647d.tar.gz
PROJ-ad7a7c1b1d54c69b9df442797a809418d00d647d.zip
Expanded *_ERROR* macros.
Expanded *_ERROR* macros with calls to proj_errno_set() and proper returns when necessary. Defined a bunch of new PJD_ERR_ constants in projects.h that corresponds to the error numbers in pj_strerrno.c. A few unknown error numbers were replaced by existing ones in pj_strerrno.c.
Diffstat (limited to 'src/PJ_urm5.c')
-rw-r--r--src/PJ_urm5.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/PJ_urm5.c b/src/PJ_urm5.c
index ab853e0e..9d904fc7 100644
--- a/src/PJ_urm5.c
+++ b/src/PJ_urm5.c
@@ -1,5 +1,6 @@
#define PJ_LIB__
-#include <projects.h>
+#include <proj.h>
+#include "projects.h"
PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl., Sph., no inv.\n\tn= q= alpha=";
@@ -44,10 +45,14 @@ PJ *PROJECTION(urm5) {
if (pj_param(P->ctx, P->params, "tn").i) {
Q->n = pj_param(P->ctx, P->params, "dn").f;
- if (Q->n <= 0. || Q->n > 1.)
- E_ERROR(-40)
- } else
- E_ERROR(-40)
+ if (Q->n <= 0. || Q->n > 1.) {
+ proj_errno_set(P, PJD_ERR_N_OUT_OF_RANGE);
+ return freeup_new(0);
+ }
+ } else {
+ proj_errno_set(P, PJD_ERR_N_OUT_OF_RANGE);
+ return freeup_new(0);
+ }
Q->q3 = pj_param(P->ctx, P->params, "dq").f / 3.;
alpha = pj_param(P->ctx, P->params, "ralpha").f;
t = Q->n * sin (alpha);