diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2017-07-17 23:10:09 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2017-07-18 11:47:20 +0200 |
| commit | ad7a7c1b1d54c69b9df442797a809418d00d647d (patch) | |
| tree | ad9a4dd1bb9aa1fcbc17e82508ec0482d1d6d06d /src/PJ_cc.c | |
| parent | 2ec0759b8cdd45deae8b9aba70ec7d23c7c3ddd8 (diff) | |
| download | PROJ-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_cc.c')
| -rw-r--r-- | src/PJ_cc.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/PJ_cc.c b/src/PJ_cc.c index 1b5d3152..d43f5a88 100644 --- a/src/PJ_cc.c +++ b/src/PJ_cc.c @@ -1,5 +1,6 @@ #define PJ_LIB__ -#include <projects.h> +#include <proj.h> +#include "projects.h" PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph"; #define EPS10 1.e-10 @@ -7,19 +8,22 @@ PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph"; static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ XY xy = {0.0,0.0}; - if (fabs (fabs(lp.phi) - M_HALFPI) <= EPS10) F_ERROR; - xy.x = lp.lam; - xy.y = tan(lp.phi); - return xy; + if (fabs (fabs(lp.phi) - M_HALFPI) <= EPS10) { + proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION); + return xy; + } + xy.x = lp.lam; + xy.y = tan(lp.phi); + return xy; } static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ LP lp = {0.0,0.0}; - (void) P; - lp.phi = atan(xy.y); - lp.lam = xy.x; - return lp; + (void) P; + lp.phi = atan(xy.y); + lp.lam = xy.x; + return lp; } |
