Skip to content

Commit

Permalink
Replace non-VOL calls with VOL calls - part 3 (HDFGroup#4771)
Browse files Browse the repository at this point in the history
This PR switches H5I_object() to H5VL_vol_object() in H5O and H5T APIs.                 H5M is the last one and left out of this PR because it needs more work
in documentation and there is no test for the API functions.

Fixes HDFGroupGH-4730
  • Loading branch information
bmribler authored Aug 27, 2024
1 parent d4b0a15 commit 1f0bd7f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/H5Gdeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,9 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment)
*
* Note: Deprecated in favor of H5Oget_comment/H5Oget_comment_by_name
*
* Return: Success: Number of characters in the comment. The value
* returned may be larger than the BUFSIZE argument.
* Return: Success: Number of characters in the comment, excluding the
* NULL terminator character. The value returned may be
* larger than the BUFSIZE argument.
*
* Failure: Negative
*
Expand Down
4 changes: 2 additions & 2 deletions src/H5O.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ H5Oopen_by_token(hid_t loc_id, H5O_token_t token)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "can't open H5O_TOKEN_UNDEF");

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier");

/* Get object type */
Expand Down Expand Up @@ -436,7 +436,7 @@ H5O__copy_api_common(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, c
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set object access arguments");

/* get the object */
if (NULL == (*vol_obj_ptr = (H5VL_object_t *)H5I_object(dst_loc_id)))
if (NULL == (*vol_obj_ptr = H5VL_vol_object(dst_loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
loc_params2.type = H5VL_OBJECT_BY_SELF;
loc_params2.obj_type = H5I_get_type(dst_loc_id);
Expand Down
2 changes: 1 addition & 1 deletion src/H5Odeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr)
FUNC_ENTER_API(H5I_INVALID_HID)

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier");

/* Get object type */
Expand Down
2 changes: 1 addition & 1 deletion src/H5Tcommit.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id)
loc_params.obj_type = H5I_get_type(loc_id);
/* Get the file object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier");
/* Commit the datatype */
Expand Down
4 changes: 2 additions & 2 deletions src/H5Tdeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id)
loc_params.obj_type = H5I_get_type(loc_id);

/* get the object from the loc_id */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier");

/* Commit the datatype */
Expand Down Expand Up @@ -167,7 +167,7 @@ H5Topen1(hid_t loc_id, const char *name)
loc_params.obj_type = H5I_get_type(loc_id);

/* Get the location object */
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier");

/* Open the datatype */
Expand Down
4 changes: 2 additions & 2 deletions src/H5VLnative.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ H5VLnative_addr_to_token(hid_t loc_id, haddr_t addr, H5O_token_t *token)
bool is_native_vol_obj;
/* Get the location object */
if (NULL == (vol_obj_container = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj_container = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
/* Make sure that the VOL object is a native connector object */
Expand Down Expand Up @@ -486,7 +486,7 @@ H5VLnative_token_to_addr(hid_t loc_id, H5O_token_t token, haddr_t *addr)
bool is_native_vol_obj;
/* Get the location object */
if (NULL == (vol_obj_container = (H5VL_object_t *)H5I_object(loc_id)))
if (NULL == (vol_obj_container = H5VL_vol_object(loc_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier");
/* Make sure that the VOL object is a native connector object */
Expand Down

0 comments on commit 1f0bd7f

Please sign in to comment.