diff options
| author | Thomas Knudsen <busstoptaktik@users.noreply.github.com> | 2017-11-08 12:41:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-08 12:41:09 +0100 |
| commit | 70550ae21c653cceefc2142fa89d0fb6c99101d9 (patch) | |
| tree | f68fff29602e3868a7f2e8d6acb7e935d3ccecb4 /src/proj_4D_api.c | |
| parent | 3ff9899dd4407877ace4daf2794cb759ccdbc235 (diff) | |
| download | PROJ-70550ae21c653cceefc2142fa89d0fb6c99101d9.tar.gz PROJ-70550ae21c653cceefc2142fa89d0fb6c99101d9.zip | |
minor clean ups in and around proj_4D_api (#649)
Diffstat (limited to 'src/proj_4D_api.c')
| -rw-r--r-- | src/proj_4D_api.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c index 07208698..aa076f0f 100644 --- a/src/proj_4D_api.c +++ b/src/proj_4D_api.c @@ -294,27 +294,29 @@ size_t proj_trans_generic ( else coord = pj_inv4d (coord, P); - /* in all full length cases, we overwrite the input with the output */ + /* in all full length cases, we overwrite the input with the output, */ + /* and step on to the next element. */ + /* The casts are somewhat funky, but they compile down to no-ops and */ + /* they tell compilers and static analyzers that we know what we do */ if (nx > 1) { - *x = coord.xyzt.x; - x = (double *) ( ((char *) x) + sx); + *x = coord.xyzt.x; + x = (double *) ((void *) ( ((char *) x) + sx)); } if (ny > 1) { - *y = coord.xyzt.y; - y = (double *) ( ((char *) y) + sy); + *y = coord.xyzt.y; + y = (double *) ((void *) ( ((char *) y) + sy)); } if (nz > 1) { - *z = coord.xyzt.z; - z = (double *) ( ((char *) z) + sz); + *z = coord.xyzt.z; + z = (double *) ((void *) ( ((char *) z) + sz)); } if (nt > 1) { - *t = coord.xyzt.t; - t = (double *) ( ((char *) t) + st); + *t = coord.xyzt.t; + t = (double *) ((void *) ( ((char *) t) + st)); } } + /* Last time around, we update the length 1 cases with their transformed alter egos */ - /* ... or would we rather not? Then what about the nmin==1 case? */ - /* perhaps signalling the non-array case by setting all strides to 0? */ if (nx==1) *x = coord.xyzt.x; if (ny==1) |
