From bf6b89c8414844b53497ff222f47e425345ad797 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 13 Nov 2019 14:38:22 -0600 Subject: Quiet decleration-after-statement warnings. --- src/H5Rint.c | 2 +- test/dsets.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/H5Rint.c b/src/H5Rint.c index 504ae06..9fbc7ef 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -1169,8 +1169,8 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc) /* Don't encode if buffer size isn't big enough or buffer is empty */ if(buf && *nalloc >= ((size_t)buf_size + 2 * H5_SIZEOF_UINT32_T)) { - p = (uint8_t *)buf; int rank; + p = (uint8_t *)buf; /* Encode the size for safety check */ UINT32ENCODE(p, (uint32_t)buf_size); diff --git a/test/dsets.c b/test/dsets.c index eaa469f..aa84833 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -7065,16 +7065,15 @@ static void make_random_offset_and_increment(long nelts, long *offsetp, long *incp) { long inc; - - HDassert(0 < nelts); - - *offsetp = HDrandom() % nelts; - /* `maxinc` is chosen so that for any `x` in [0, nelts - 1], * `x + maxinc` does not overflow a long. */ const long maxinc = MIN(nelts - 1, LONG_MAX - nelts); + HDassert(0 < nelts); + + *offsetp = HDrandom() % nelts; + /* Choose a random number in [1, nelts - 1]. If its greatest divisor * in common with `nelts` is 1, then it will "generate" the additive ring * [0, nelts - 1], so let it be our increment. Otherwise, choose a new -- cgit v0.12