diff options
Diffstat (limited to 'src/H5S.c')
-rw-r--r-- | src/H5S.c | 40 |
1 files changed, 13 insertions, 27 deletions
@@ -1055,27 +1055,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_write(H5O_loc_t *loc, const H5S_t *ds, hbool_t update_time, hid_t dxpl_id) +H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5S_write, FAIL) - HDassert(loc); + HDassert(f); + HDassert(oh); HDassert(ds); + HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); - switch(H5S_GET_EXTENT_TYPE(ds)) { - case H5S_NULL: - case H5S_SCALAR: - case H5S_SIMPLE: - if(H5O_msg_write(loc, H5O_SDSPACE_ID, 0, update_time, &(ds->extent), dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message") - break; - - default: - HDassert("unknown dataspace class" && 0); - break; - } /* end switch */ + /* Write the current dataspace extent to the dataspace message */ + if(H5O_msg_write_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1103,7 +1096,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds) +H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1112,19 +1105,11 @@ H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds) HDassert(f); HDassert(oh); HDassert(ds); + HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); - switch (H5S_GET_EXTENT_TYPE(ds)) { - case H5S_NULL: - case H5S_SCALAR: - case H5S_SIMPLE: - if(H5O_msg_append(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple data space message") - break; - - default: - assert("unknown data space class" && 0); - break; - } + /* Add the dataspace message to the object header */ + if(H5O_msg_append_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't add simple dataspace message") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1388,6 +1373,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, /* Set offset to zeros */ for(u = 0; u < space->extent.rank; u++) space->select.offset[u] = 0; + space->select.offset_changed = FALSE; /* If the selection is 'all', update the number of elements selected */ if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL) |