summaryrefslogtreecommitdiffstats
path: root/hl/src/H5DS.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-15 21:45:25 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-15 21:45:25 (GMT)
commitceb75f0efdcca01cb415e9ab8c2d4752709064d1 (patch)
treea3abfe549a5e95f717f7b041bd2f840522d30156 /hl/src/H5DS.c
parentcc20659e7f8122a515fbf3ae14b90249a23ca452 (diff)
downloadhdf5-ceb75f0efdcca01cb415e9ab8c2d4752709064d1.zip
hdf5-ceb75f0efdcca01cb415e9ab8c2d4752709064d1.tar.gz
hdf5-ceb75f0efdcca01cb415e9ab8c2d4752709064d1.tar.bz2
[svn-r10012] Purpose:
new tests Description: added more tests to DS (check if parameters IDs are valid) Solution: Platforms tested: linux solaris Misc. update:
Diffstat (limited to 'hl/src/H5DS.c')
-rw-r--r--hl/src/H5DS.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 8b5c7c3..3d147d2 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -111,6 +111,7 @@ herr_t H5DSattach_scale(hid_t did,
hobj_ref_t ref; /* reference to the DS */
hvl_t *buf; /* VL buffer to store in the attribute */
H5G_stat_t sb1, sb2;
+ H5I_type_t it1, it2;
int i, len;
/*-------------------------------------------------------------------------
@@ -133,6 +134,15 @@ herr_t H5DSattach_scale(hid_t did,
if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno)
return FAIL;
+ /* get ID type */
+ if ((it1 = H5Iget_type(did))<0)
+ return FAIL;
+ if ((it2 = H5Iget_type(dsid))<0)
+ return FAIL;
+
+ if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
+ return FAIL;
+
/*-------------------------------------------------------------------------
* The dataset may or may not have the associated DS attribute
* First we try to open to see if it is already there; if not, it is created.
@@ -1376,7 +1386,7 @@ herr_t H5DSget_nscales(hid_t did,
if (H5Aread(aid,tid,buf)<0)
goto out;
- for(i=0,n=0; i<buf[dim].len; i++)
+ for(i=0,n=0; i<(int)buf[dim].len; i++)
{
ref = ((hobj_ref_t *)buf[dim].p)[i];
if (ref) n++;
@@ -1837,4 +1847,6 @@ out:
return FAIL;
}
-#endif \ No newline at end of file
+#endif
+
+