diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2010-11-11 21:10:30 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2010-11-11 21:10:30 (GMT) |
commit | 1b8033b5946e43613c98f40fb23282bdc4b49d0a (patch) | |
tree | 94fa65f7e96e6e2b5c982a680f729de0c75f9f30 /src/H5T.c | |
parent | a32d6d79a3f1e30401aa7077949ff4c38e967587 (diff) | |
download | hdf5-1b8033b5946e43613c98f40fb23282bdc4b49d0a.zip hdf5-1b8033b5946e43613c98f40fb23282bdc4b49d0a.tar.gz hdf5-1b8033b5946e43613c98f40fb23282bdc4b49d0a.tar.bz2 |
[svn-r19765] Purpose:
fix a few minor issues related to flush/refresh code
Description:
- Replaced the globality macros with an enum typedef, to
better encapsulate of the values that can be assigned
to the variable.
- Combined 'tag' and 'globality' properties into a single
property by creating a new structure housing both values,
since they are always accessed at the same time anyways.
- Added an extra parameter check to H5Tflush/H5Trefresh
routines to make sure the supplied datatype is a committed
datatype.
- Renamed and reworked some code to move "metadata" (H5AC)
specific things out of the generic cache (H5C) level of code.
Tested:
h5committest
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5298,6 +5298,8 @@ H5Tflush(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") /* Call private function to flush datatype object */ if (H5O_flush_metadata(&dt->oloc, H5AC_dxpl_id) < 0) @@ -5332,6 +5334,8 @@ H5Trefresh(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") /* Call private function to refresh datatype object */ if ((H5O_refresh_metadata(type_id, dt->oloc, H5AC_dxpl_id)) < 0) |