summaryrefslogtreecommitdiffstats
path: root/src/H5Rint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Rint.c')
-rw-r--r--src/H5Rint.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/H5Rint.c b/src/H5Rint.c
index b714f09..7ee4ecc 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -588,11 +588,18 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id)
supported = 0;
if (H5VL_introspect_opt_query(vol_obj, H5VL_SUBCLS_FILE, H5VL_NATIVE_FILE_POST_OPEN, &supported) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "can't check for 'post open' operation")
- if (supported & H5VL_OPT_QUERY_SUPPORTED)
- if (H5VL_file_optional(vol_obj, H5VL_NATIVE_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT,
- H5_REQUEST_NULL) < 0)
+ if (supported & H5VL_OPT_QUERY_SUPPORTED) {
+ H5VL_optional_args_t vol_cb_args; /* Arguments to VOL callback */
+
+ /* Set up VOL callback arguments */
+ vol_cb_args.op_type = H5VL_NATIVE_FILE_POST_OPEN;
+ vol_cb_args.args = NULL;
+
+ /* Make the 'post open' callback */
+ if (H5VL_file_optional(vol_obj, &vol_cb_args, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID,
"unable to make file 'post open' callback")
+ } /* end if */
/* Attach loc_id to reference */
if (H5R__set_loc_id((H5R_ref_priv_t *)ref, ret_value, FALSE, TRUE) < 0)
@@ -1143,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() */
@@ -1171,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 */
@@ -1185,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)
@@ -1218,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;
@@ -1234,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)
@@ -1265,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)