From 6cd723d115e845d8ba3e7a2f8e91a9963c00f1a2 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 5 Jan 2024 13:09:09 -0600 Subject: [PATCH] Replace internal API calls --- src/H5F.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index a4721681d40..48fd31bb03a 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -200,12 +200,13 @@ H5F__get_all_count_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void *key) { H5F_trav_obj_cnt_t *udata = (H5F_trav_obj_cnt_t *)key; H5I_type_t obj_type = H5I_UNINIT; + H5T_t *type = NULL; htri_t is_committed = FAIL; int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_PACKAGE - if ((obj_type = H5Iget_type(obj_id)) < 0) + if ((obj_type = H5I_get_type(obj_id)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5_ITER_ERROR, "object has invalid id type"); if ((obj_type != H5I_DATATYPE)) { @@ -213,7 +214,10 @@ H5F__get_all_count_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void *key) } else { /* Only open committed datatypes should be counted as open datatype objects on the file */ - if ((is_committed = H5Tcommitted(obj_id)) < 0) + if (NULL == (type = (H5T_t *)H5I_object_verify(obj_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "not a datatype"); + + if ((is_committed = H5T_is_named(type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5_ITER_ERROR, "bad datatype"); if (is_committed) @@ -323,6 +327,7 @@ H5F__get_all_ids_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void *key) { H5F_trav_obj_ids_t *udata = (H5F_trav_obj_ids_t *)key; H5I_type_t obj_type = H5I_UNINIT; + H5T_t *type = NULL; htri_t is_committed = FAIL; int ret_value = H5_ITER_CONT; /* Return value */ @@ -331,7 +336,7 @@ H5F__get_all_ids_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void *key) if (udata->obj_count >= udata->max_objs) HGOTO_DONE(H5_ITER_STOP); - if ((obj_type = H5Iget_type(obj_id)) < 0) + if ((obj_type = H5I_get_type(obj_id)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5_ITER_ERROR, "object has invalid id type"); if ((obj_type != H5I_DATATYPE)) { @@ -341,7 +346,10 @@ H5F__get_all_ids_cb(void H5_ATTR_UNUSED *obj_ptr, hid_t obj_id, void *key) } else { /* Only open committed datatypes should be counted as open datatype objects on the file */ - if ((is_committed = H5Tcommitted(obj_id)) < 0) + if (NULL == (type = (H5T_t *)H5I_object_verify(obj_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "not a datatype"); + + if ((is_committed = H5T_is_named(type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5_ITER_ERROR, "bad datatype"); if (is_committed) {