aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PJ_cart.c4
-rw-r--r--src/PJ_patterson.c2
-rw-r--r--src/pj_transform.c25
3 files changed, 20 insertions, 11 deletions
diff --git a/src/PJ_cart.c b/src/PJ_cart.c
index b4fc60b2..6fed9985 100644
--- a/src/PJ_cart.c
+++ b/src/PJ_cart.c
@@ -64,7 +64,7 @@ PROJ_HEAD(cart, "Geodetic/cartesian conversions");
and
Wikipedia: Geographic Coordinate Conversion,
- https://en.m.wikipedia.org/wiki/Geographic_coordinate_conversion
+ https://en.wikipedia.org/wiki/Geographic_coordinate_conversion
(WP, below).
@@ -94,7 +94,7 @@ PROJ_HEAD(cart, "Geodetic/cartesian conversions");
Wikipedia: Earth Radius
https://en.wikipedia.org/wiki/Earth_radius#Radius_at_a_given_geodetic_latitude
- (Derivation and commentary at http://gis.stackexchange.com/questions/20200/how-do-you-compute-the-earths-radius-at-a-given-geodetic-latitude)
+ (Derivation and commentary at https://gis.stackexchange.com/q/20200)
(WP2, below)
diff --git a/src/PJ_patterson.c b/src/PJ_patterson.c
index a15c730f..b54847f2 100644
--- a/src/PJ_patterson.c
+++ b/src/PJ_patterson.c
@@ -33,7 +33,7 @@
* Patterson, T., Savric, B., and Jenny, B. (2015). Cartographic Perspectives
* (No.78). Describes the projection design and characteristics, and
* developing the equations. doi:10.14714/CP78.1270
- * http://dx.doi.org/10.14714/CP78.1270
+ * https://doi.org/10.14714/CP78.1270
*
* Port to PROJ.4 by Micah Cochran, 26 March 2016
*/
diff --git a/src/pj_transform.c b/src/pj_transform.c
index 93094f01..84ebe2d9 100644
--- a/src/pj_transform.c
+++ b/src/pj_transform.c
@@ -27,6 +27,7 @@
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
+#include <errno.h>
#include <math.h>
#include <string.h>
@@ -206,12 +207,14 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
projected_loc = pj_fwd3d( geodetic_loc, P);
if( P->ctx->last_errno != 0 )
{
- if( (P->ctx->last_errno != 33 /*EDOM*/
- && P->ctx->last_errno != 34 /*ERANGE*/ )
+ if( (P->ctx->last_errno != EDOM
+ && P->ctx->last_errno != ERANGE)
&& (P->ctx->last_errno > 0
|| P->ctx->last_errno < -44 || n == 1
|| transient_error[-P->ctx->last_errno] == 0 ) )
+ {
return P->ctx->last_errno;
+ }
else
{
projected_loc.u = HUGE_VAL;
@@ -242,12 +245,14 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
projected_loc = pj_fwd( geodetic_loc, P );
if( P->ctx->last_errno != 0 )
{
- if( (P->ctx->last_errno != 33 /*EDOM*/
- && P->ctx->last_errno != 34 /*ERANGE*/ )
+ if( (P->ctx->last_errno != EDOM
+ && P->ctx->last_errno != ERANGE)
&& (P->ctx->last_errno > 0
|| P->ctx->last_errno < -44 || n == 1
|| transient_error[-P->ctx->last_errno] == 0 ) )
+ {
return P->ctx->last_errno;
+ }
else
{
projected_loc.u = HUGE_VAL;
@@ -310,12 +315,14 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
geodetic_loc = pj_inv3d(projected_loc, P);
if( P->ctx->last_errno != 0 )
{
- if( (P->ctx->last_errno != 33 /*EDOM*/
- && P->ctx->last_errno != 34 /*ERANGE*/ )
+ if( (P->ctx->last_errno != EDOM
+ && P->ctx->last_errno != ERANGE)
&& (P->ctx->last_errno > 0
|| P->ctx->last_errno < -44 || n == 1
|| transient_error[-P->ctx->last_errno] == 0 ) )
+ {
return P->ctx->last_errno;
+ }
else
{
geodetic_loc.u = HUGE_VAL;
@@ -347,12 +354,14 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
geodetic_loc = pj_inv( projected_loc, P );
if( P->ctx->last_errno != 0 )
{
- if( (P->ctx->last_errno != 33 /*EDOM*/
- && P->ctx->last_errno != 34 /*ERANGE*/ )
+ if( (P->ctx->last_errno != EDOM
+ && P->ctx->last_errno != ERANGE)
&& (P->ctx->last_errno > 0
|| P->ctx->last_errno < -44 || n == 1
|| transient_error[-P->ctx->last_errno] == 0 ) )
+ {
return P->ctx->last_errno;
+ }
else
{
geodetic_loc.u = HUGE_VAL;