diff options
Diffstat (limited to 'src/H5Toh.c')
-rw-r--r-- | src/H5Toh.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/H5Toh.c b/src/H5Toh.c index 7961706..99cb396 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -29,7 +29,8 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ #include "H5Tpkg.h" /* Datatypes */ - +#include "H5VLnative.h" /* Native Plugin */ +#include "H5VLprivate.h" /* VOL */ /****************/ /* Local Macros */ @@ -132,26 +133,26 @@ done: static hid_t H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) { - H5T_t *type = NULL; /* Datatype opened */ - hid_t ret_value; /* Return value */ + H5T_t *dt = NULL; /* Datatype opened */ + hid_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(obj_loc); /* Open the datatype */ - if(NULL == (type = H5T_open(obj_loc, dxpl_id))) + if(NULL == (dt = H5T_open(obj_loc, dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") /* Register an ID for the datatype */ - if((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) + if((ret_value = H5I_register(H5I_DATATYPE, dt, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: - if(ret_value < 0) - if(type && H5T_close(type) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") - + if(ret_value < 0) { + if(dt && H5T_close(dt) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_dtype_open() */ @@ -216,15 +217,18 @@ done: static H5O_loc_t * H5O_dtype_get_oloc(hid_t obj_id) { - H5T_t *type; /* Datatype opened */ + H5T_t *type=NULL, *dt=NULL; /* Datatype opened */ H5O_loc_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* 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(NULL == (type = (H5T_t *)H5T_get_named_type(dt))) + 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") |