summaryrefslogtreecommitdiffstats
path: root/src/H5Toh.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-12-09 16:30:58 (GMT)
commitc8f533cfc33ac743227cbed8eba361c715a2976f (patch)
treebcae5320f80bac774647cacbbd8493604f9384d2 /src/H5Toh.c
parentadcf8a315e82c0848d126e7e46b662930c081896 (diff)
downloadhdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.zip
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.gz
hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.bz2
Merge all of my changes from merge-back-to-feature-vfd_swmr-attempt-1,
including the merge of `hdffv/hdf5/develop`, back to the branch that Vailin and I share. Now I need to put this branch on a fork with a less confusing name than vchoi_fork!
Diffstat (limited to 'src/H5Toh.c')
-rw-r--r--src/H5Toh.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/H5Toh.c b/src/H5Toh.c
index c5ee994..ab6c09f 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() */
@@ -212,15 +212,19 @@ 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)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to get object location from object")