diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-01-11 12:22:24 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-01-11 13:46:52 +0100 |
| commit | 754f62987a8035497236e2fae24cc4e9d8d91937 (patch) | |
| tree | dcea8b969011a218a1def67ccb12efbd192ceb85 /src | |
| parent | 29916584ae00a16ef0974d419a89d6f12edecc12 (diff) | |
| download | PROJ-754f62987a8035497236e2fae24cc4e9d8d91937.tar.gz PROJ-754f62987a8035497236e2fae24cc4e9d8d91937.zip | |
axisswap initialization: avoid switch case fallthrough
case without break are really confusing, and should be avoided as much
as possible IMHO.
Also error out if a unrecognized character is provided as the axis value.
Diffstat (limited to 'src')
| -rw-r--r-- | src/PJ_axisswap.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/PJ_axisswap.c b/src/PJ_axisswap.c index f7e89c33..d57834fc 100644 --- a/src/PJ_axisswap.c +++ b/src/PJ_axisswap.c @@ -211,19 +211,31 @@ PJ *CONVERSION(axisswap,0) { switch(P->axis[i]) { case 'w': Q->sign[i] = -1; + Q->axis[i] = 0; + break; case 'e': + Q->sign[i] = 1; Q->axis[i] = 0; break; case 's': Q->sign[i] = -1; + Q->axis[i] = 1; + break; case 'n': + Q->sign[i] = 1; Q->axis[i] = 1; break; case 'd': Q->sign[i] = -1; + Q->axis[i] = 2; + break; case 'u': + Q->sign[i] = 1; Q->axis[i] = 2; break; + default: + proj_log_error(P, "axisswap: unknown axis '%c'", P->axis[i]); + return pj_default_destructor(P, PJD_ERR_AXIS); } } n = 3; |
