summaryrefslogtreecommitdiffstats
path: root/hl/src/H5DS.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2009-10-01 16:17:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2009-10-01 16:17:17 (GMT)
commit98f6b609ad017d9bb8c018227060b7113a53b590 (patch)
tree39db4180c5fb04460b5c57dae8d7101fc5cf98b2 /hl/src/H5DS.c
parentcf212aebf8eca7b58dcb5057bd6d9cdf842afb70 (diff)
downloadhdf5-98f6b609ad017d9bb8c018227060b7113a53b590.zip
hdf5-98f6b609ad017d9bb8c018227060b7113a53b590.tar.gz
hdf5-98f6b609ad017d9bb8c018227060b7113a53b590.tar.bz2
[svn-r17566] Fix for Bug 1562. H5DSis_attached needed to account for platform dependent types. Added test and test files for LE and BE dimension scales. Reworked part of test_ds file as part of debug.
Added missing H5Tclose in region reference routines. H5DS.c checked for other locations which need to account for platform dependent types in dealing with ds_list_t. Added generator program for test files of LE and BE dimension scales. Tested: local linux, h5committest
Diffstat (limited to 'hl/src/H5DS.c')
-rw-r--r--hl/src/H5DS.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 8e697f1..e15c132 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -129,6 +129,7 @@ herr_t H5DSattach_scale(hid_t did,
hssize_t nelmts;
hid_t sid; /* space ID */
hid_t tid = -1; /* attribute type ID */
+ hid_t ntid = -1; /* attribute native type ID */
hid_t aid = -1; /* attribute ID */
int rank; /* rank of dataset */
hsize_t *dims=NULL; /* dimension of the "REFERENCE_LIST" array */
@@ -472,6 +473,9 @@ herr_t H5DSattach_scale(hid_t did,
if((tid = H5Aget_type(aid)) < 0)
goto out;
+
+ if((ntid = H5Tget_native_type(tid, H5T_DIR_DEFAULT)) < 0)
+ goto out;
/* get and save the old reference(s) */
if((sid = H5Aget_space(aid)) < 0)
@@ -487,7 +491,7 @@ herr_t H5DSattach_scale(hid_t did,
if (dsbuf == NULL)
goto out;
- if (H5Aread(aid,tid,dsbuf) < 0)
+ if (H5Aread(aid,ntid,dsbuf) < 0)
goto out;
/* close */
@@ -495,6 +499,8 @@ herr_t H5DSattach_scale(hid_t did,
goto out;
if (H5Aclose(aid) < 0)
goto out;
+ if (H5Tclose(ntid) < 0)
+ goto out;
/*-------------------------------------------------------------------------
* create a new attribute
@@ -586,6 +592,7 @@ out:
H5E_BEGIN_TRY {
H5Sclose(sid);
H5Aclose(aid);
+ H5Tclose(ntid);
H5Tclose(tid);
} H5E_END_TRY;
return FAIL;
@@ -631,6 +638,7 @@ herr_t H5DSdetach_scale(hid_t did,
hid_t did_i; /* dataset ID in REFERENCE_LIST */
hid_t sid; /* space ID */
hid_t tid = -1; /* attribute type ID */
+ hid_t ntid = -1; /* attribute native type ID */
hid_t aid = -1; /* attribute ID */
int rank; /* rank of dataset */
ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
@@ -823,6 +831,9 @@ herr_t H5DSdetach_scale(hid_t did,
if((tid = H5Aget_type(aid)) < 0)
goto out;
+
+ if((ntid = H5Tget_native_type(tid, H5T_DIR_DEFAULT)) < 0)
+ goto out;
/* get and save the old reference(s) */
if((sid = H5Aget_space(aid)) < 0)
@@ -835,7 +846,7 @@ herr_t H5DSdetach_scale(hid_t did,
if(dsbuf == NULL)
goto out;
- if (H5Aread(aid,tid,dsbuf) < 0)
+ if (H5Aread(aid,ntid,dsbuf) < 0)
goto out;
for(i=0; i<nelmts; i++)
@@ -879,6 +890,8 @@ herr_t H5DSdetach_scale(hid_t did,
goto out;
if (H5Aclose(aid) < 0)
goto out;
+ if (H5Tclose(ntid) < 0)
+ goto out;
/*-------------------------------------------------------------------------
* check if we found the pointed dataset
@@ -961,6 +974,7 @@ out:
H5E_BEGIN_TRY {
H5Sclose(sid);
H5Aclose(aid);
+ H5Tclose(ntid);
H5Tclose(tid);
if (dsbuf)
@@ -1024,6 +1038,7 @@ htri_t H5DSis_attached(hid_t did,
hssize_t nelmts;
hid_t sid; /* space ID */
hid_t tid = -1; /* attribute type ID */
+ hid_t ntid = -1; /* attribute native type ID */
hid_t aid = -1; /* attribute ID */
int rank; /* rank of dataset */
ds_list_t *dsbuf; /* array of attribute data in the DS pointing to the dataset */
@@ -1187,7 +1202,10 @@ htri_t H5DSis_attached(hid_t did,
if((tid = H5Aget_type(aid)) < 0)
goto out;
-
+
+ if((ntid = H5Tget_native_type(tid, H5T_DIR_DEFAULT)) < 0)
+ goto out;
+
/* get and save the old reference(s) */
if((sid = H5Aget_space(aid)) < 0)
goto out;
@@ -1200,7 +1218,7 @@ htri_t H5DSis_attached(hid_t did,
if (dsbuf == NULL)
goto out;
- if (H5Aread(aid,tid,dsbuf) < 0)
+ if (H5Aread(aid,ntid,dsbuf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1242,6 +1260,8 @@ htri_t H5DSis_attached(hid_t did,
/* close */
if (H5Sclose(sid) < 0)
goto out;
+ if (H5Tclose(ntid) < 0)
+ goto out;
if (H5Tclose(tid) < 0)
goto out;
if (H5Aclose(aid) < 0)