summaryrefslogtreecommitdiffstats
path: root/src/H5Sselect.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-07-31 19:17:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-07-31 19:17:12 (GMT)
commit5588db111c57b4a60de020e49e3411330bf8cf00 (patch)
tree326710b2fb5ab935c5a5c76b0a1fd5855d54549e /src/H5Sselect.c
parent17275779d07c094741039d0c263fdf055c32bfb6 (diff)
downloadhdf5-5588db111c57b4a60de020e49e3411330bf8cf00.zip
hdf5-5588db111c57b4a60de020e49e3411330bf8cf00.tar.gz
hdf5-5588db111c57b4a60de020e49e3411330bf8cf00.tar.bz2
[svn-r5840] Purpose:
Code cleanup Description: Created a new H5I function which combined the some of the functionality of H5I_get_type and H5I_object: H5I_object_verify. Using this new function in the library trims another ~200 lines of code off the library and makes the resulting binaries smaller and faster also. Platforms tested: FreeBSD 4.6 (sleipnir)
Diffstat (limited to 'src/H5Sselect.c')
-rw-r--r--src/H5Sselect.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index b37c2b6..18b5ca7 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -148,7 +148,7 @@ H5Sget_select_npoints(hid_t spaceid)
H5TRACE1("Hs","i",spaceid);
/* Check args */
- if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid)))
+ if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space");
ret_value = (*space->select.get_npoints)(space);
@@ -187,7 +187,7 @@ H5Sselect_valid(hid_t spaceid)
H5TRACE1("b","i",spaceid);
/* Check args */
- if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid)))
+ if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data space");
ret_value = (*space->select.is_valid)(space);
@@ -295,7 +295,7 @@ H5Sget_select_bounds(hid_t spaceid, hsize_t *start, hsize_t *end)
/* Check args */
if(start==NULL || end==NULL)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer");
- if (H5I_DATASPACE != H5I_get_type(spaceid) || NULL == (space=H5I_object(spaceid)))
+ if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
ret_value = (*space->select.bounds)(space,start,end);
@@ -381,7 +381,7 @@ H5S_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t op,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate I/O offset vector array");
/* Get the datatype size */
- if (NULL==(dt=H5I_object(type_id)))
+ if (NULL==(dt=H5I_object_verify(type_id,H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype");
if((elmt_size=H5T_get_size(dt))==0)
HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid");
@@ -496,7 +496,7 @@ H5Sget_select_type(hid_t space_id)
H5TRACE1("St","i",space_id);
/* Check args */
- if (H5I_DATASPACE != H5I_get_type(space_id) || NULL == (space = H5I_object(space_id)))
+ if (NULL == (space = H5I_object_verify(space_id, H5I_DATASPACE)))
HRETURN_ERROR(H5E_ATOM, H5E_BADATOM, H5S_SEL_ERROR, "not a data space");
FUNC_LEAVE(space->select.type);