summaryrefslogtreecommitdiffstats
path: root/src/H5Rint.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-11-08 18:44:06 (GMT)
committerGitHub <noreply@github.com>2021-11-08 18:44:06 (GMT)
commit9cea7c9bb9c2a73649e586cdc3bb5483a521022f (patch)
tree305edbf8a3d02fd0907aa3c81a46cca1e21cd983 /src/H5Rint.c
parenta8d03d30ffae22682d044782a17cefa1854de8ea (diff)
downloadhdf5-9cea7c9bb9c2a73649e586cdc3bb5483a521022f.zip
hdf5-9cea7c9bb9c2a73649e586cdc3bb5483a521022f.tar.gz
hdf5-9cea7c9bb9c2a73649e586cdc3bb5483a521022f.tar.bz2
Assume C99 fixed sized ints exist, use them (#470)
* Committing clang-format changes * Assume C99 fixed sized ints exist, use them * Assume H5_SIZEOF_LONG_DOUBLE != 0, `long double` has existed since C89 Note, this is only assuming that `long double` exists, no assumptions about its size have been touched. Didn't remove any code that does things like test if `long double` and `double` have different sizes. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Rint.c')
-rw-r--r--src/H5Rint.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c
index e1a5dcd..7ee4ecc 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -1150,7 +1150,7 @@ H5R__encode_obj_token(const H5O_token_t *obj_token, size_t token_size, unsigned
/* Encode token */
H5MM_memcpy(p, obj_token, token_size);
}
- *nalloc = token_size + H5_SIZEOF_UINT8_T;
+ *nalloc = token_size + sizeof(uint8_t);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5R__encode_obj_token() */
@@ -1178,7 +1178,7 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj
HDassert(token_size);
/* Don't decode if buffer size isn't big enough */
- if (*nbytes < H5_SIZEOF_UINT8_T)
+ if (*nbytes < sizeof(uint8_t))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small")
/* Get token size */
@@ -1192,7 +1192,7 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj
/* Decode token */
H5MM_memcpy(obj_token, p, *token_size);
- *nbytes = (size_t)(*token_size + H5_SIZEOF_UINT8_T);
+ *nbytes = (size_t)(*token_size + sizeof(uint8_t));
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1225,7 +1225,7 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc)
"Cannot determine amount of space needed for serializing selection")
/* 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)) {
+ if (buf && *nalloc >= ((size_t)buf_size + 2 * sizeof(uint32_t))) {
int rank;
p = (uint8_t *)buf;
@@ -1241,7 +1241,7 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc)
if (H5S_SELECT_SERIALIZE(space, (unsigned char **)&p) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTENCODE, FAIL, "can't serialize selection")
} /* end if */
- *nalloc = (size_t)buf_size + 2 * H5_SIZEOF_UINT32_T;
+ *nalloc = (size_t)buf_size + 2 * sizeof(uint32_t);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1272,16 +1272,16 @@ H5R__decode_region(const unsigned char *buf, size_t *nbytes, H5S_t **space_ptr)
HDassert(space_ptr);
/* Don't decode if buffer size isn't big enough */
- if (*nbytes < (2 * H5_SIZEOF_UINT32_T))
+ if (*nbytes < (2 * sizeof(uint32_t)))
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, FAIL, "Buffer size is too small")
/* Decode the selection size */
UINT32DECODE(p, buf_size);
- buf_size += H5_SIZEOF_UINT32_T;
+ buf_size += sizeof(uint32_t);
/* Decode the extent rank */
UINT32DECODE(p, rank);
- buf_size += H5_SIZEOF_UINT32_T;
+ buf_size += sizeof(uint32_t);
/* Don't decode if buffer size isn't big enough */
if (*nbytes < buf_size)