diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2011-04-14 19:16:53 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2011-04-14 19:16:53 (GMT) |
commit | 9062c8583fa0ecb1609f9f3847fb6ac2bd16497c (patch) | |
tree | 7dd042710657204dc4e2866ac136a7721e2e232e /src/H5S.c | |
parent | 92897336ee3076160af74097b30308871c775366 (diff) | |
download | hdf5-9062c8583fa0ecb1609f9f3847fb6ac2bd16497c.zip hdf5-9062c8583fa0ecb1609f9f3847fb6ac2bd16497c.tar.gz hdf5-9062c8583fa0ecb1609f9f3847fb6ac2bd16497c.tar.bz2 |
[svn-r20498] Bug 1386 - allow dimension size to be zero even though it isn't unlimited. I made a change in H5Sset_extent_simple to
forbid setting the dimension size bigger than existing maximal size. In this checkin, I restored it to the previous
behavior that any change will wipe out previous record of dimensionality. I brought the changes from the trunk.
Tested on jam - a simple change.
Diffstat (limited to 'src/H5S.c')
-rw-r--r-- | src/H5S.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -1161,13 +1161,8 @@ H5Sis_simple(hid_t space_id) Verifies that each element of DIMS is not equal to H5S_UNLIMITED. Raymond Lu 03/30/2011 - We allow 0-dimension for non-unlimited dimension starting from 1.8.7 + We allow 0 dimension size for non-unlimited dimension starting from 1.8.7 release. - - Raymond Lu 04/11/2011 - I added a condition check to make sure the new size won't exceed the - current maximal size when this function is called to change the - dimension size of an existent dataspace. --------------------------------------------------------------------------*/ herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], @@ -1202,14 +1197,6 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], } } - /* Check through all the dimensions to see if the new dimension size exceeds the current - * size or if the new maximal size exceeds the current maximal size */ - for(u = 0; u < space->extent.rank; u++) { - if(space->extent.max && H5S_UNLIMITED!=space->extent.max[u] && - (space->extent.max[u]<dims[u] || (max && space->extent.max[u]<max[u]))) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new size exceeds current maximal size") - } /* end for */ - /* Do it */ if (H5S_set_extent_simple(space, (unsigned)rank, dims, max)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set simple extent") @@ -1840,7 +1827,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) /* Check for invalid dimension size modification */ if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] && space->extent.max[u] < size[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot be modified") + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size") /* Indicate that dimension size can be modified */ ret_value = TRUE; |