diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2015-04-16 20:57:26 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2015-04-16 20:57:26 (GMT) |
commit | f53cfbe9d66c87b414bb759b91d7c32eb28fa88f (patch) | |
tree | 7dc8c3b5a717b8cf03304614efaf1944cd9ffb00 /src/H5S.c | |
parent | 11efaf4ff7d49c9242f832db4394376ba2541ab0 (diff) | |
download | hdf5-f53cfbe9d66c87b414bb759b91d7c32eb28fa88f.zip hdf5-f53cfbe9d66c87b414bb759b91d7c32eb28fa88f.tar.gz hdf5-f53cfbe9d66c87b414bb759b91d7c32eb28fa88f.tar.bz2 |
[svn-r26828] Implement support for unlimited selections (not supported by VDS code yet).
Add tests for unlimited selections.
Various other minor changes.
Tested: ummon
Diffstat (limited to 'src/H5S.c')
-rw-r--r-- | src/H5S.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -521,6 +521,12 @@ H5S_extent_copy(H5S_t *dst, const H5S_t *src) if(H5S_select_all(dst, FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") + /* If the selection is 'hyper', update the selection due to changed extent + */ + if(H5S_GET_SELECT_TYPE(dst) == H5S_SEL_HYPERSLABS) + if(H5S__hyper_update_extent_offset(dst) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't update hyperslab") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_extent_copy() */ @@ -1356,6 +1362,12 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, if(H5S_select_all(space, FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") + /* If the selection is 'hyper', update the selection due to changed + * extent */ + if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS) + if(H5S__hyper_update_extent_offset(space) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't update hyperslab") + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S_set_extent_simple() */ @@ -1579,7 +1591,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) buf += extent_size; /* Encode the selection part of dataspace. */ - if(H5S_SELECT_SERIALIZE(obj, &buf) < 0) + if(H5S_SELECT_SERIALIZE(f, obj, &buf) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space") } /* end else */ @@ -1698,7 +1710,7 @@ H5S_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection") /* Decode the select part of dataspace. I believe this part always exists. */ - if(H5S_SELECT_DESERIALIZE(&ds, &buf) < 0) + if(H5S_SELECT_DESERIALIZE(f, &ds, &buf) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode space selection") /* Set return value */ @@ -1989,6 +2001,12 @@ H5S_set_extent_real(H5S_t *space, const hsize_t *size) if(H5S_select_all(space, FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") + /* If the selection is 'hyper', update the selection due to changed + * extent */ + if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS) + if(H5S__hyper_update_extent_offset(space) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't update hyperslab") + /* Mark the dataspace as no longer shared if it was before */ if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace") |