diff options
Diffstat (limited to 'src/H5Adeprec.c')
-rw-r--r-- | src/H5Adeprec.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index b239142..92d80bc 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -185,13 +185,8 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -258,13 +253,8 @@ H5Aopen_name(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -333,13 +323,8 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open attribute") /* Get an atom for the attribute */ - if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize attribute handle") - - /* attach VOL information to the ID */ - if (H5I_register_aux(ret_value, vol_plugin, (H5I_free2_t)H5A_close_attr) < 0) - HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "can't attach vol info to ID") - + if((ret_value = H5I_register2(H5I_ATTR, attr, vol_plugin, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize dataset handle") vol_plugin->nrefs ++; done: @@ -391,8 +376,8 @@ H5Aget_num_attrs(hid_t loc_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") /* Get the group info through the VOL using the location token */ - if(H5VL_object_get(obj, loc_params, vol_plugin, H5VL_OBJECT_GET_INFO, - H5_REQUEST_NULL, &oinfo) < 0) + if(H5VL_object_get(obj, loc_params, vol_plugin, H5VL_OBJECT_GET_INFO, + H5_REQUEST_NULL, &oinfo) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get group info") ret_value = oinfo.num_attrs; |