diff options
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") |