diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-12 19:39:14 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-12 23:26:08 (GMT) |
commit | ea7332525010ef75e27ce5800cf65dd91ba43576 (patch) | |
tree | 19f440d677555c016dacc4a2cd28aaa80961e350 /src/H5Toh.c | |
parent | 496de6922fb13aa11a5c5efe56a3f8de157a77ad (diff) | |
parent | 6f52793adcd5a14aa63731e3c33c9737b5a04d16 (diff) | |
download | hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.zip hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.gz hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.bz2 |
Merge branch 'develop' into dset_ohdr_minimize
Diffstat (limited to 'src/H5Toh.c')
-rw-r--r-- | src/H5Toh.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/H5Toh.c b/src/H5Toh.c index c0139fe..b21ce72 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -44,7 +44,7 @@ /********************/ static htri_t H5O__dtype_isa(const H5O_t *loc); -static hid_t H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__dtype_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type); static void *H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); static H5O_loc_t *H5O__dtype_get_oloc(hid_t obj_id); @@ -125,28 +125,28 @@ done: * *------------------------------------------------------------------------- */ -static hid_t -H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref) +static void * +H5O__dtype_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type) { - H5T_t *type = NULL; /* Datatype opened */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5T_t *type = NULL; /* Datatype opened */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC HDassert(obj_loc); + *opened_type = H5I_DATATYPE; + /* Open the datatype */ if(NULL == (type = H5T_open(obj_loc))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open datatype") - /* Register an ID for the datatype */ - if((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") + ret_value = (void *)type; done: - if(ret_value < 0) + if(NULL == ret_value) if(type && H5T_close(type) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") + HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, NULL, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dtype_open() */ @@ -180,7 +180,7 @@ H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) /* Commit the type to the file */ if(H5T__commit(f, crt_info->dt, crt_info->tcpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") /* Set up the new named datatype's location */ if(NULL == (obj_loc->oloc = H5T_oloc(crt_info->dt))) @@ -212,14 +212,17 @@ done: static H5O_loc_t * H5O__dtype_get_oloc(hid_t obj_id) { - H5T_t *type; /* Datatype opened */ + H5T_t *type = NULL; /* Datatype opened */ + H5T_t *dt = NULL; H5O_loc_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC /* Get the datatype */ - if(NULL == (type = (H5T_t *)H5I_object(obj_id))) + if(NULL == (dt = (H5T_t *)H5I_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") + /* If this is a named datatype, get the VOL driver pointer to the datatype */ + type = (H5T_t *)H5T_get_actual_type(dt); /* Get the datatype's object header location */ if(NULL == (ret_value = H5T_oloc(type))) |