diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2009-10-01 13:55:43 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2009-10-01 13:55:43 (GMT) |
commit | fbf7f470e2f8c29994829ada8b4c01590d4cacc7 (patch) | |
tree | f0339640b34f150a16ecc23b6b3f6c350b6272f7 /hl/src | |
parent | d495a52fdd306391bd01f2a22abda26666c6c705 (diff) | |
download | hdf5-fbf7f470e2f8c29994829ada8b4c01590d4cacc7.zip hdf5-fbf7f470e2f8c29994829ada8b4c01590d4cacc7.tar.gz hdf5-fbf7f470e2f8c29994829ada8b4c01590d4cacc7.tar.bz2 |
[svn-r17565] Fix for Bug 1562. 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')
-rw-r--r-- | hl/src/H5DS.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index f75e926..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) |