diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-12-15 17:48:24 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-12-15 17:48:24 +0100 |
| commit | b020666081223adb8a623e6b3ad2c6a3b2ce077a (patch) | |
| tree | 9a05b0e24e005d3e257e90c755d3ebe0a795f649 /src/transformations | |
| parent | 41c4e54f036d0f8fcc37920fac4b0fa462fd92b2 (diff) | |
| download | PROJ-b020666081223adb8a623e6b3ad2c6a3b2ce077a.tar.gz PROJ-b020666081223adb8a623e6b3ad2c6a3b2ce077a.zip | |
horner.cpp: remove uses of EINVAL and EDOM errno
Diffstat (limited to 'src/transformations')
| -rw-r--r-- | src/transformations/horner.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/transformations/horner.cpp b/src/transformations/horner.cpp index e32a6b99..f9403d2b 100644 --- a/src/transformations/horner.cpp +++ b/src/transformations/horner.cpp @@ -115,7 +115,7 @@ struct horner { } // anonymous namespace typedef struct horner HORNER; -static PJ_UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position); +static PJ_UV horner_func (PJ* P, const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position); static HORNER *horner_alloc (size_t order, int complex_polynomia); static void horner_free (HORNER *h); @@ -181,7 +181,7 @@ static HORNER *horner_alloc (size_t order, int complex_polynomia) { /**********************************************************************/ -static PJ_UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) { +static PJ_UV horner_func (PJ* P, const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) { /*********************************************************************** A reimplementation of the classic Engsager/Poder 2D Horner polynomial @@ -237,7 +237,6 @@ summing the tiny high order elements first. case PJ_INV: /* inverse */ break; default: /* invalid */ - errno = EINVAL; return uv_error; } @@ -259,7 +258,7 @@ summing the tiny high order elements first. } if ((fabs(n) > range) || (fabs(e) > range)) { - errno = EDOM; + proj_errno_set(P, PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN); return uv_error; } @@ -297,12 +296,12 @@ summing the tiny high order elements first. static PJ_COORD horner_forward_4d (PJ_COORD point, PJ *P) { - point.uv = horner_func ((HORNER *) P->opaque, PJ_FWD, point.uv); + point.uv = horner_func (P, (HORNER *) P->opaque, PJ_FWD, point.uv); return point; } static PJ_COORD horner_reverse_4d (PJ_COORD point, PJ *P) { - point.uv = horner_func ((HORNER *) P->opaque, PJ_INV, point.uv); + point.uv = horner_func (P, (HORNER *) P->opaque, PJ_INV, point.uv); return point; } @@ -310,7 +309,7 @@ static PJ_COORD horner_reverse_4d (PJ_COORD point, PJ *P) { /**********************************************************************/ -static PJ_UV complex_horner (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) { +static PJ_UV complex_horner (PJ *P, const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) { /*********************************************************************** A reimplementation of a classic Engsager/Poder Horner complex @@ -337,7 +336,6 @@ polynomial evaluation engine. case PJ_INV: /* inverse */ break; default: /* invalid */ - errno = EINVAL; return uv_error; } @@ -366,7 +364,7 @@ polynomial evaluation engine. } if ((fabs(n) > range) || (fabs(e) > range)) { - errno = EDOM; + proj_errno_set(P, PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN); return uv_error; } @@ -387,12 +385,12 @@ polynomial evaluation engine. static PJ_COORD complex_horner_forward_4d (PJ_COORD point, PJ *P) { - point.uv = complex_horner ((HORNER *) P->opaque, PJ_FWD, point.uv); + point.uv = complex_horner (P, (HORNER *) P->opaque, PJ_FWD, point.uv); return point; } static PJ_COORD complex_horner_reverse_4d (PJ_COORD point, PJ *P) { - point.uv = complex_horner ((HORNER *) P->opaque, PJ_INV, point.uv); + point.uv = complex_horner (P, (HORNER *) P->opaque, PJ_INV, point.uv); return point; } |
