summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/H5I.c b/src/H5I.c
index 76faab1..b233d23 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -215,7 +215,8 @@ H5I_term_package(void)
*-------------------------------------------------------------------------
*/
H5I_type_t
-H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func)
+H5Iregister_type(size_t H5_ATTR_DEBUG_API_USED hash_size, unsigned reserved,
+ H5I_free_t free_func)
{
H5I_class_t *cls = NULL; /* New ID class */
H5I_type_t new_type; /* New ID type value */
@@ -1235,8 +1236,7 @@ H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id)
if(NULL == (curr_id = (H5I_id_info_t *)H5SL_remove(type_ptr->ids, &id)))
HGOTO_ERROR(H5E_ATOM, H5E_CANTDELETE, NULL, "can't remove ID node from skip list")
- /* (Casting away const OK -QAK) */
- ret_value = (void *)curr_id->obj_ptr;
+ ret_value = (void *)curr_id->obj_ptr; /* (Casting away const OK -QAK) */
curr_id = H5FL_FREE(H5I_id_info_t, curr_id);
/* Decrement the number of IDs in the type */
@@ -2220,7 +2220,7 @@ done:
ssize_t
H5Iget_name(hid_t id, char *name/*out*/, size_t size)
{
- H5VL_object_t *vol_obj; /* Object token of loc_id */
+ H5VL_object_t *vol_obj; /* Object of loc_id */
H5VL_loc_params_t loc_params;
ssize_t ret_value; /* Return value */
@@ -2259,8 +2259,8 @@ done:
hid_t
H5Iget_file_id(hid_t obj_id)
{
- H5I_type_t type; /* ID type */
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ H5I_type_t type; /* ID type */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", obj_id);
@@ -2269,8 +2269,15 @@ H5Iget_file_id(hid_t obj_id)
type = H5I_TYPE(obj_id);
/* Call internal function */
- if (H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) {
- if ((ret_value = H5F_get_file_id(obj_id, type, TRUE)) < 0)
+ if(H5I_FILE == type || H5I_DATATYPE == type || H5I_GROUP == type || H5I_DATASET == type || H5I_ATTR == type) {
+ H5VL_object_t *vol_obj; /* Object of obj_id */
+
+ /* Get the VOL object */
+ if(NULL == (vol_obj = H5VL_vol_object(obj_id)))
+ HGOTO_ERROR(H5E_ATOM, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
+
+ /* Get the file ID */
+ if((ret_value = H5F_get_file_id(vol_obj, type, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID")
} /* end if */
else