From 70550ae21c653cceefc2142fa89d0fb6c99101d9 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Wed, 8 Nov 2017 12:41:09 +0100 Subject: minor clean ups in and around proj_4D_api (#649) --- src/proj_4D_api.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/proj_4D_api.c') 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) -- cgit v1.2.3