aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Schwehr <schwehr@google.com>2018-05-04 09:01:27 -0700
committerKurt Schwehr <schwehr@google.com>2018-05-04 09:01:27 -0700
commit72016ab016efe153f475a38596586fecd5b996d2 (patch)
treef2d168a20dcd482448bdf73799f2e209c1e3b91a
parent2f467d57d1846857eb8ac7e855646c19d6b66737 (diff)
downloadPROJ-72016ab016efe153f475a38596586fecd5b996d2.tar.gz
PROJ-72016ab016efe153f475a38596586fecd5b996d2.zip
Convert errno literals to corresponding PJD symbol
-rw-r--r--src/PJ_healpix.c8
-rw-r--r--src/PJ_tmerc.c4
-rw-r--r--src/aasincos.c4
-rw-r--r--src/biveval.c2
-rw-r--r--src/dmstor.c4
-rw-r--r--src/nad_init.c14
-rw-r--r--src/pj_datum_set.c5
-rw-r--r--src/pj_ell_set.c23
-rw-r--r--src/pj_gauss.c2
-rw-r--r--src/pj_gridcatalog.c16
-rw-r--r--src/pj_gridinfo.c30
-rw-r--r--src/pj_mlfn.c2
-rw-r--r--src/pj_phi2.c2
-rw-r--r--src/pj_transform.c2
-rw-r--r--src/pj_utils.c2
-rw-r--r--src/proj_mdist.c2
16 files changed, 66 insertions, 56 deletions
diff --git a/src/PJ_healpix.c b/src/PJ_healpix.c
index f3a9c0f8..c3eae14f 100644
--- a/src/PJ_healpix.c
+++ b/src/PJ_healpix.c
@@ -526,7 +526,7 @@ static LP s_healpix_inverse(XY xy, PJ *P) { /* sphere */
LP lp;
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
- pj_ctx_set_errno(P->ctx, -15);
+ pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
return lp;
}
return healpix_sphere_inverse(xy);
@@ -540,7 +540,7 @@ static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
- pj_ctx_set_errno(P->ctx, -15);
+ pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
return lp;
}
lp = healpix_sphere_inverse(xy);
@@ -574,7 +574,7 @@ static LP s_rhealpix_inverse(XY xy, PJ *P) { /* sphere */
LP lp;
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
- pj_ctx_set_errno(P->ctx, -15);
+ pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
return lp;
}
xy = combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 1);
@@ -590,7 +590,7 @@ static LP e_rhealpix_inverse(XY xy, PJ *P) { /* ellipsoid */
if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
- pj_ctx_set_errno(P->ctx, -15);
+ pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
return lp;
}
xy = combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 1);
diff --git a/src/PJ_tmerc.c b/src/PJ_tmerc.c
index bc77e45b..f0f34c93 100644
--- a/src/PJ_tmerc.c
+++ b/src/PJ_tmerc.c
@@ -38,7 +38,7 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
if( lp.lam < -M_HALFPI || lp.lam > M_HALFPI ) {
xy.x = HUGE_VAL;
xy.y = HUGE_VAL;
- pj_ctx_set_errno( P->ctx, -14 );
+ pj_ctx_set_errno( P->ctx, PJD_ERR_LAT_OR_LON_EXCEED_LIMIT );
return xy;
}
@@ -79,7 +79,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
if( lp.lam < -M_HALFPI || lp.lam > M_HALFPI ) {
xy.x = HUGE_VAL;
xy.y = HUGE_VAL;
- pj_ctx_set_errno( P->ctx, -14 );
+ pj_ctx_set_errno( P->ctx, PJD_ERR_LAT_OR_LON_EXCEED_LIMIT );
return xy;
}
diff --git a/src/aasincos.c b/src/aasincos.c
index 627ec14e..c3915613 100644
--- a/src/aasincos.c
+++ b/src/aasincos.c
@@ -9,7 +9,7 @@ aasin(projCtx ctx,double v) {
if ((av = fabs(v)) >= 1.) {
if (av > ONE_TOL)
- pj_ctx_set_errno( ctx, -19 );
+ pj_ctx_set_errno( ctx, PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE );
return (v < 0. ? -M_HALFPI : M_HALFPI);
}
return asin(v);
@@ -21,7 +21,7 @@ aacos(projCtx ctx, double v) {
if ((av = fabs(v)) >= 1.) {
if (av > ONE_TOL)
- pj_ctx_set_errno( ctx, -19 );
+ pj_ctx_set_errno( ctx, PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE );
return (v < 0. ? M_PI : 0.);
}
return acos(v);
diff --git a/src/biveval.c b/src/biveval.c
index c76a34c7..05e83e21 100644
--- a/src/biveval.c
+++ b/src/biveval.c
@@ -37,7 +37,7 @@ bcheval(projUV in, Tseries *T) {
w.v = ( in.v + in.v - T->a.v ) * T->b.v;
if (fabs(w.u) > NEAR_ONE || fabs(w.v) > NEAR_ONE) {
out.u = out.v = HUGE_VAL;
- pj_errno = -36;
+ pj_errno = PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE;
} else { /* double evaluation */
w2.u = w.u + w.u;
w2.v = w.v + w.v;
diff --git a/src/dmstor.c b/src/dmstor.c
index 27593cb0..23871a85 100644
--- a/src/dmstor.c
+++ b/src/dmstor.c
@@ -51,7 +51,7 @@ dmstor_ctx(projCtx ctx, const char *is, char **rs) {
n = 2; break;
case 'r': case 'R':
if (nl) {
- pj_ctx_set_errno( ctx, -16 );
+ pj_ctx_set_errno( ctx, PJD_ERR_WRONG_FORMAT_DMS_VALUE );
return HUGE_VAL;
}
++s;
@@ -63,7 +63,7 @@ dmstor_ctx(projCtx ctx, const char *is, char **rs) {
continue;
}
if (n < nl) {
- pj_ctx_set_errno( ctx, -16 );
+ pj_ctx_set_errno( ctx, PJD_ERR_WRONG_FORMAT_DMS_VALUE );
return HUGE_VAL;
}
v += tv * vm[n];
diff --git a/src/nad_init.c b/src/nad_init.c
index 571d2569..844dcad2 100644
--- a/src/nad_init.c
+++ b/src/nad_init.c
@@ -88,7 +88,7 @@ int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
pj_log( ctx, PJ_LOG_ERROR,
"ctable loading failed on fread() - binary incompatible?" );
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -111,7 +111,7 @@ struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
if( ct == NULL
|| pj_ctx_fread( ctx, ct, sizeof(struct CTABLE), 1, fid ) != 1 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_dalloc( ct );
return NULL;
}
@@ -120,7 +120,7 @@ struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
if( ct->lim.lam < 1 || ct->lim.lam > 100000
|| ct->lim.phi < 1 || ct->lim.phi > 100000 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_dalloc( ct );
return NULL;
}
@@ -167,7 +167,7 @@ int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
"ctable2 loading failed on fread() - binary incompatible?\n" );
}
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -193,7 +193,7 @@ struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid )
if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return NULL;
}
@@ -206,7 +206,7 @@ struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid )
if( strncmp(header,"CTABLE V2",9) != 0 )
{
pj_log( ctx, PJ_LOG_ERROR, "ctable2 - wrong header!" );
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return NULL;
}
@@ -230,7 +230,7 @@ struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid )
if( ct->lim.lam < 1 || ct->lim.lam > 100000
|| ct->lim.phi < 1 || ct->lim.phi > 100000 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_dalloc( ct );
return NULL;
}
diff --git a/src/pj_datum_set.c b/src/pj_datum_set.c
index 374beda2..e527ff84 100644
--- a/src/pj_datum_set.c
+++ b/src/pj_datum_set.c
@@ -68,7 +68,10 @@ int pj_datum_set(projCtx ctx, paralist *pl, PJ *projdef)
/* find the datum definition */
for (i = 0; (s = pj_datums[i].id) && strcmp(name, s) ; ++i) {}
- if (!s) { pj_ctx_set_errno(ctx, -9); return 1; }
+ if (!s) {
+ pj_ctx_set_errno(ctx, PJD_ERR_UNKNOWN_ELLP_PARAM);
+ return 1;
+ }
if( pj_datums[i].ellipse_id && strlen(pj_datums[i].ellipse_id) > 0 )
{
diff --git a/src/pj_ell_set.c b/src/pj_ell_set.c
index 1f9bbd91..fc655289 100644
--- a/src/pj_ell_set.c
+++ b/src/pj_ell_set.c
@@ -630,7 +630,10 @@ int pj_ell_set (projCtx ctx, paralist *pl, double *a, double *es) {
for (start = pl; start && start->next ; start = start->next) ;
for (i = 0; (s = pj_ellps[i].id) && strcmp(name, s) ; ++i) ;
- if (!s) { pj_ctx_set_errno( ctx, -9); return 1; }
+ if (!s) {
+ pj_ctx_set_errno( ctx, PJD_ERR_UNKNOWN_ELLP_PARAM);
+ return 1;
+ }
start->next = pj_mkparam(pj_ellps[i].major);
start->next->next = pj_mkparam(pj_ellps[i].ell);
}
@@ -645,7 +648,7 @@ int pj_ell_set (projCtx ctx, paralist *pl, double *a, double *es) {
} else if (pj_param(ctx,pl, "trf").i) { /* recip flattening */
*es = pj_param(ctx,pl, "drf").f;
if (*es == 0.0) {
- pj_ctx_set_errno( ctx, -10);
+ pj_ctx_set_errno(ctx, PJD_ERR_REV_FLATTENING_IS_ZERO);
goto bomb;
}
*es = 1./ *es;
@@ -676,7 +679,7 @@ int pj_ell_set (projCtx ctx, paralist *pl, double *a, double *es) {
*es = 0.;
} else if (pj_param(ctx,pl, "bR_h").i) { /* sphere--harmonic mean */
if ( (*a + b) == 0.0) {
- pj_ctx_set_errno(ctx, -20);
+ pj_ctx_set_errno(ctx, PJD_ERR_TOLERANCE_CONDITION);
goto bomb;
}
*a = 2. * *a * b / (*a + b);
@@ -687,7 +690,7 @@ int pj_ell_set (projCtx ctx, paralist *pl, double *a, double *es) {
tmp = sin(pj_param(ctx,pl, i ? "rR_lat_a" : "rR_lat_g").f);
if (fabs(tmp) > M_HALFPI) {
- pj_ctx_set_errno(ctx,-11);
+ pj_ctx_set_errno(ctx, PJD_ERR_REF_RAD_LARGER_THAN_90);
goto bomb;
}
tmp = 1. - *es * tmp * tmp;
@@ -705,10 +708,14 @@ bomb:
return 1;
}
/* some remaining checks */
- if (*es < 0.)
- { pj_ctx_set_errno( ctx, -12); return 1; }
- if (*a <= 0.)
- { pj_ctx_set_errno( ctx, -13); return 1; }
+ if (*es < 0.) {
+ pj_ctx_set_errno(ctx, PJD_ERR_ES_LESS_THAN_ZERO);
+ return 1;
+ }
+ if (*a <= 0.) {
+ pj_ctx_set_errno(ctx, PJD_ERR_MAJOR_AXIS_NOT_GIVEN);
+ return 1;
+ }
return 0;
}
#endif
diff --git a/src/pj_gauss.c b/src/pj_gauss.c
index 4f27ac12..108ac059 100644
--- a/src/pj_gauss.c
+++ b/src/pj_gauss.c
@@ -92,6 +92,6 @@ LP pj_inv_gauss(projCtx ctx, LP slp, const void *data) {
}
/* convergence failed */
if (!i)
- pj_ctx_set_errno( ctx, -17 );
+ pj_ctx_set_errno(ctx, PJD_ERR_NON_CONV_INV_MERI_DIST);
return (elp);
}
diff --git a/src/pj_gridcatalog.c b/src/pj_gridcatalog.c
index 8777185b..0498d5b0 100644
--- a/src/pj_gridcatalog.c
+++ b/src/pj_gridcatalog.c
@@ -139,8 +139,8 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
&(defn->last_after_date));
if( defn->last_after_grid == NULL )
{
- pj_ctx_set_errno( defn->ctx, -38 );
- return -38;
+ pj_ctx_set_errno( defn->ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
+ return PJD_ERR_FAILED_TO_LOAD_GRID;
}
}
gi = defn->last_after_grid;
@@ -149,8 +149,8 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
/* load the grid shift info if we don't have it. */
if( gi->ct->cvs == NULL && !pj_gridinfo_load( defn->ctx, gi ) )
{
- pj_ctx_set_errno( defn->ctx, -38 );
- return -38;
+ pj_ctx_set_errno( defn->ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
+ return PJD_ERR_FAILED_TO_LOAD_GRID;
}
output_after = nad_cvt( input, inverse, gi->ct );
@@ -187,8 +187,8 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
&(defn->last_before_date));
if( defn->last_before_grid == NULL )
{
- pj_ctx_set_errno( defn->ctx, -38 );
- return -38;
+ pj_ctx_set_errno( defn->ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
+ return PJD_ERR_FAILED_TO_LOAD_GRID;
}
}
@@ -198,8 +198,8 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
/* load the grid shift info if we don't have it. */
if( gi->ct->cvs == NULL && !pj_gridinfo_load( defn->ctx, gi ) )
{
- pj_ctx_set_errno( defn->ctx, -38 );
- return -38;
+ pj_ctx_set_errno( defn->ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
+ return PJD_ERR_FAILED_TO_LOAD_GRID;
}
output_before = nad_cvt( input, inverse, gi->ct );
diff --git a/src/pj_gridinfo.c b/src/pj_gridinfo.c
index 19113fca..442b3fe6 100644
--- a/src/pj_gridinfo.c
+++ b/src/pj_gridinfo.c
@@ -146,7 +146,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
if( fid == NULL )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -173,7 +173,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
if( fid == NULL )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -205,7 +205,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
if( fid == NULL )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -235,7 +235,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
{
pj_dalloc( row_buf );
pj_dalloc( ct_tmp.cvs );
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -286,7 +286,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
if( fid == NULL )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -316,7 +316,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
{
pj_dalloc( row_buf );
pj_dalloc( ct_tmp.cvs );
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -361,7 +361,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
if( fid == NULL )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
pj_release_lock();
return 0;
}
@@ -445,7 +445,7 @@ static int pj_gridinfo_init_ntv2( projCtx ctx, PAFile fid, PJ_GRIDINFO *gilist )
/* -------------------------------------------------------------------- */
if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -488,13 +488,13 @@ static int pj_gridinfo_init_ntv2( projCtx ctx, PAFile fid, PJ_GRIDINFO *gilist )
/* -------------------------------------------------------------------- */
if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
if( strncmp((const char *) header,"SUB_NAME",8) != 0 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -555,7 +555,7 @@ static int pj_gridinfo_init_ntv2( projCtx ctx, PAFile fid, PJ_GRIDINFO *gilist )
gs_count, ct->lim.lam, ct->lim.phi,
ct->lim.lam * ct->lim.phi );
pj_dalloc(ct);
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -670,7 +670,7 @@ static int pj_gridinfo_init_ntv1( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
/* -------------------------------------------------------------------- */
if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -692,7 +692,7 @@ static int pj_gridinfo_init_ntv1( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
{
pj_log( ctx, PJ_LOG_ERROR,
"NTv1 grid shift file has wrong record count, corrupt?" );
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -757,7 +757,7 @@ static int pj_gridinfo_init_gtx( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
/* -------------------------------------------------------------------- */
if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
{
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
@@ -783,7 +783,7 @@ static int pj_gridinfo_init_gtx( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
{
pj_log( ctx, PJ_LOG_ERROR,
"gtx file header has invalid extents, corrupt?");
- pj_ctx_set_errno( ctx, -38 );
+ pj_ctx_set_errno( ctx, PJD_ERR_FAILED_TO_LOAD_GRID );
return 0;
}
diff --git a/src/pj_mlfn.c b/src/pj_mlfn.c
index dc8aa2fc..24e7b63a 100644
--- a/src/pj_mlfn.c
+++ b/src/pj_mlfn.c
@@ -56,6 +56,6 @@ pj_inv_mlfn(projCtx ctx, double arg, double es, double *en) {
if (fabs(t) < EPS)
return phi;
}
- pj_ctx_set_errno( ctx, -17 );
+ pj_ctx_set_errno( ctx, PJD_ERR_NON_CONV_INV_MERI_DIST );
return phi;
}
diff --git a/src/pj_phi2.c b/src/pj_phi2.c
index 00b73f70..13419df8 100644
--- a/src/pj_phi2.c
+++ b/src/pj_phi2.c
@@ -23,6 +23,6 @@ pj_phi2(projCtx ctx, double ts, double e) {
break;
}
if (i <= 0)
- pj_ctx_set_errno( ctx, -18 );
+ pj_ctx_set_errno( ctx, PJD_ERR_NON_CON_INV_PHI2 );
return Phi;
}
diff --git a/src/pj_transform.c b/src/pj_transform.c
index aaa8c1e4..168711ba 100644
--- a/src/pj_transform.c
+++ b/src/pj_transform.c
@@ -597,7 +597,7 @@ int pj_geodetic_to_geocentric( double a, double es,
if( pj_Convert_Geodetic_To_Geocentric( &gi, y[io], x[io], z[io],
x+io, y+io, z+io ) != 0 )
{
- ret_errno = -14;
+ ret_errno = PJD_ERR_LAT_OR_LON_EXCEED_LIMIT;
x[io] = y[io] = HUGE_VAL;
/* but keep processing points! */
}
diff --git a/src/pj_utils.c b/src/pj_utils.c
index d2037032..5a1faf72 100644
--- a/src/pj_utils.c
+++ b/src/pj_utils.c
@@ -113,7 +113,7 @@ PJ *pj_latlong_from_proj( PJ *pj_in )
}
else
{
- pj_ctx_set_errno( pj_in->ctx, -13 );
+ pj_ctx_set_errno( pj_in->ctx, PJD_ERR_MAJOR_AXIS_NOT_GIVEN );
return NULL;
}
diff --git a/src/proj_mdist.c b/src/proj_mdist.c
index 4ab50ee9..02d9ebee 100644
--- a/src/proj_mdist.c
+++ b/src/proj_mdist.c
@@ -117,6 +117,6 @@ proj_inv_mdist(projCtx ctx, double dist, const void *data) {
return phi;
}
/* convergence failed */
- pj_ctx_set_errno(ctx, -17);
+ pj_ctx_set_errno(ctx, PJD_ERR_NON_CONV_INV_MERI_DIST);
return phi;
}