summaryrefslogtreecommitdiffstats
path: root/src/H5Tref.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/H5Tref.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/H5Tref.c')
-rw-r--r--src/H5Tref.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5Tref.c b/src/H5Tref.c
index cac8cf6..511c531 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -309,8 +309,8 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't get encode size")
/* Size on disk, memory size is different */
- dt->shared->size = MAX(H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE + cont_info.blob_id_size,
- ref_encode_size);
+ dt->shared->size =
+ MAX(sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE + cont_info.blob_id_size, ref_encode_size);
dt->shared->u.atomic.prec = 8 * dt->shared->size;
/* Set up the function pointers to access the information on
@@ -778,7 +778,7 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t
H5VL_blob_specific_args_t vol_cb_args; /* Arguments to VOL callback */
/* Skip the size / header */
- p = (const uint8_t *)src_buf + H5R_ENCODE_HEADER_SIZE + H5_SIZEOF_UINT32_T;
+ p = (const uint8_t *)src_buf + H5R_ENCODE_HEADER_SIZE + sizeof(uint32_t);
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_BLOB_ISNULL;
@@ -819,7 +819,7 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf)
/* TODO Should get rid of bg stuff */
if (p_bg) {
/* Skip the size / header */
- p_bg += (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE);
+ p_bg += (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE);
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_BLOB_DELETE;
@@ -929,8 +929,8 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_
blob_size -= H5R_ENCODE_HEADER_SIZE;
/* Skip the size */
- p += H5_SIZEOF_UINT32_T;
- HDassert(src_size > (H5R_ENCODE_HEADER_SIZE + H5_SIZEOF_UINT32_T));
+ p += sizeof(uint32_t);
+ HDassert(src_size > (H5R_ENCODE_HEADER_SIZE + sizeof(uint32_t)));
/* Retrieve blob */
if (H5VL_blob_get(src_file, p, q, blob_size, NULL) < 0)
@@ -974,9 +974,9 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
size_t p_buf_size_left = dst_size;
/* Skip the size / header */
- p_bg += (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE);
- HDassert(p_buf_size_left > (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE));
- p_buf_size_left -= (H5_SIZEOF_UINT32_T + H5R_ENCODE_HEADER_SIZE);
+ p_bg += (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE);
+ HDassert(p_buf_size_left > (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE));
+ p_buf_size_left -= (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE);
/* Set up VOL callback arguments */
vol_cb_args.op_type = H5VL_BLOB_DELETE;
@@ -991,12 +991,12 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf,
p += H5R_ENCODE_HEADER_SIZE;
q += H5R_ENCODE_HEADER_SIZE;
src_size -= H5R_ENCODE_HEADER_SIZE;
- buf_size_left -= H5_SIZEOF_UINT32_T;
+ buf_size_left -= sizeof(uint32_t);
/* Set the size */
UINT32ENCODE(q, src_size);
- HDassert(buf_size_left > H5_SIZEOF_UINT32_T);
- buf_size_left -= H5_SIZEOF_UINT32_T;
+ HDassert(buf_size_left > sizeof(uint32_t));
+ buf_size_left -= sizeof(uint32_t);
/* Store blob */
if (H5VL_blob_put(dst_file, p, src_size, q, NULL) < 0)