diff options
-rw-r--r-- | src/H5Dmpio.c | 13 | ||||
-rw-r--r-- | src/H5Dvirtual.c | 35 | ||||
-rw-r--r-- | src/H5Ffake.c | 14 | ||||
-rw-r--r-- | src/H5Fprivate.h | 2 | ||||
-rw-r--r-- | src/H5P.c | 11 | ||||
-rw-r--r-- | src/H5Pdapl.c | 8 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 39 | ||||
-rw-r--r-- | src/H5Pdxpl.c | 28 | ||||
-rw-r--r-- | src/H5Pencdec.c | 20 | ||||
-rw-r--r-- | src/H5Pfapl.c | 22 | ||||
-rw-r--r-- | src/H5Pfcpl.c | 16 | ||||
-rw-r--r-- | src/H5Pgcpl.c | 8 | ||||
-rw-r--r-- | src/H5Plapl.c | 13 | ||||
-rw-r--r-- | src/H5Pocpl.c | 4 | ||||
-rw-r--r-- | src/H5Ppkg.h | 16 | ||||
-rw-r--r-- | src/H5Pprivate.h | 7 | ||||
-rw-r--r-- | src/H5Pstrcpl.c | 4 | ||||
-rw-r--r-- | src/H5Rint.c | 7 | ||||
-rw-r--r-- | src/H5S.c | 22 | ||||
-rw-r--r-- | src/H5Sall.c | 20 | ||||
-rw-r--r-- | src/H5Shyper.c | 388 | ||||
-rw-r--r-- | src/H5Snone.c | 18 | ||||
-rw-r--r-- | src/H5Spkg.h | 12 | ||||
-rw-r--r-- | src/H5Spoint.c | 129 | ||||
-rw-r--r-- | src/H5Sprivate.h | 14 | ||||
-rw-r--r-- | src/H5Sselect.c | 9 | ||||
-rw-r--r-- | src/H5T.c | 4 | ||||
-rw-r--r-- | test/vds.c | 5 |
28 files changed, 362 insertions, 526 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 6803b60..930e9ca 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2728,7 +2728,6 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty int *send_displacements = NULL; int scatter_recvcount_int; int mpi_rank, mpi_size, mpi_code; - hid_t fapl_id = -1; /* File access property list for H5S_encode() */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -2742,9 +2741,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") - - if((fapl_id = H5F_get_access_plist(io_info->dset->oloc.file, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fapl") + + /* Set to latest format for encoding dataspace */ + H5CX_set_libver_bounds(NULL); if (*local_chunk_array_num_entries) if (NULL == (send_requests = (MPI_Request *) H5MM_malloc(*local_chunk_array_num_entries * sizeof(MPI_Request)))) @@ -2851,7 +2850,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty /* Determine size of serialized chunk file dataspace, plus the size of * the data being written */ - if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size, fapl_id) < 0) + if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") if ((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) @@ -2864,7 +2863,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty /* Serialize the chunk's file dataspace into the buffer */ mod_data_p = mod_data[num_send_requests]; - if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size, fapl_id) < 0) + if (H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to encode dataspace") /* Initialize iterator for memory selection */ @@ -2969,8 +2968,6 @@ done: H5MM_free(num_assigned_chunks_array); if (shared_chunks_info_array) H5MM_free(shared_chunks_info_array); - if (H5Pclose(fapl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "couldn't close FAPL") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_redistribute_shared_chunks() */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 2e8ca5d..e591440 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -419,11 +419,6 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) hsize_t tmp_nentries; /* Temp. variable for # of VDS entries */ uint32_t chksum; /* Checksum for heap data */ size_t i; /* Local index variable */ - H5P_genplist_t *fapl_plist; /* The file access property list */ - hid_t new_fapl_id; /* The file access property list ID */ - H5F_libver_t low_bound = H5F_LIBVER_V110; /* Set the low bound in fapl to latest */ - H5F_libver_t high_bound = H5F_LIBVER_V110; /* Set the high bound in fapl to latest */ - H5F_t *tmp_f = NULL; /* Pointer to faked file structure */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -436,22 +431,8 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) /* Create block if # of used entries > 0 */ if(layout->storage.u.virt.list_nused > 0) { - /* Make a copy of the default file access property list */ - if(NULL == (fapl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Set latest format in fapl_plist for virtual layout encoding */ - if(H5P_set(fapl_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low_bound) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions") - if(H5P_set(fapl_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high_bound) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions") - /* Copy and return the fapl id */ - if((new_fapl_id = H5P_copy_plist(fapl_plist, FALSE)) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list") - - /* Allocate "fake" file structure with the fapl setting */ - if(NULL == (tmp_f = H5F_fake_alloc((uint8_t)0, new_fapl_id))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") + /* Set the low/high bounds according to 'f' for the API context */ + H5CX_set_libver_bounds(f); /* Allocate array for caching results of strlen */ if(NULL == (str_size = (size_t *)H5MM_malloc(2 * layout->storage.u.virt.list_nused * sizeof(size_t)))) @@ -482,12 +463,12 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) block_size += str_size[(2 * i) + 1]; /* Source selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select, tmp_f)) < 0) + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") block_size += (size_t)select_serial_size; /* Virtual dataset selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, tmp_f)) < 0) + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") block_size += (size_t)select_serial_size; } /* end for */ @@ -524,11 +505,11 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) heap_block_p += str_size[(2 * i) + 1]; /* Source selection */ - if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p, tmp_f) < 0) + if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection") /* Virtual selection */ - if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p, tmp_f) < 0) + if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection") } /* end for */ @@ -542,10 +523,6 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) } /* end if */ done: - /* Release fake file structure */ - if(tmp_f && H5F_fake_free(tmp_f) < 0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release fake file struct") - heap_block = (uint8_t *)H5MM_xfree(heap_block); str_size = (size_t *)H5MM_xfree(str_size); diff --git a/src/H5Ffake.c b/src/H5Ffake.c index d199cf0..7e44cfc 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -42,10 +42,9 @@ *------------------------------------------------------------------------- */ H5F_t * -H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id) +H5F_fake_alloc(uint8_t sizeof_size) { H5F_t *f = NULL; /* Pointer to fake file struct */ - H5P_genplist_t *plist; /* Property list */ H5F_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -62,17 +61,6 @@ H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id) else f->shared->sizeof_size = sizeof_size; - /* Set low/high bounds according to the setting in fapl_id */ - /* See H5F_new() in H5Fint.c */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") - - if(H5P_get(plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &(f->shared->low_bound)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'low' bound for library format versions") - if(H5P_get(plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &(f->shared->high_bound)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'high' bound for library format versions") - - /* Set return value */ ret_value = f; done: diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 0c2f5f2..d60c08f 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -827,7 +827,7 @@ H5_DLL void H5F_addr_decode_len(size_t addr_len, const uint8_t **pp, haddr_t *ad H5_DLL void H5F_sfile_assert_num(unsigned n); /* Routines for creating & destroying "fake" file structures */ -H5_DLL H5F_t *H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id); +H5_DLL H5F_t *H5F_fake_alloc(uint8_t sizeof_size); H5_DLL herr_t H5F_fake_free(H5F_t *f); /* Superblock related routines */ @@ -840,10 +840,7 @@ herr_t H5Pencode(hid_t plist_id, void *buf, size_t *nalloc) { H5P_genplist_t *plist; /* Property list to query */ - H5P_genplist_t *fapl_plist; - hid_t new_fapl_id; - H5F_libver_t low_bound = H5F_LIBVER_V110; - H5F_libver_t high_bound = H5F_LIBVER_V110; + hid_t temp_fapl_id = H5P_DEFAULT; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -853,8 +850,12 @@ H5Pencode(hid_t plist_id, void *buf, size_t *nalloc) if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Call the internal encode routine */ - if((ret_value = H5P__encode(plist, TRUE, buf, nalloc, H5P_FILE_ACCESS_DEFAULT)) < 0) + if((ret_value = H5P__encode(plist, TRUE, buf, nalloc)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to encode property list"); done: diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index ad2ae4c..da06297 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -121,7 +121,7 @@ static herr_t H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, static herr_t H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value); /* Property list callbacks */ -static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dacc_vds_view_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dacc_vds_view_dec(const void **pp, void *value); static herr_t H5P__dapl_vds_file_pref_set(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__dapl_vds_file_pref_get(hid_t prop_id, const char* name, size_t size, void* value); @@ -135,7 +135,7 @@ static herr_t H5P__dapl_vds_file_pref_close(const char* name, size_t size, void* /* Property list callbacks */ static herr_t H5P__dapl_efile_pref_set(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__dapl_efile_pref_get(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__dapl_efile_pref_dec(const void **_pp, void *value); static herr_t H5P__dapl_efile_pref_del(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__dapl_efile_pref_copy(const char* name, size_t size, void* value); @@ -562,7 +562,7 @@ H5P__dapl_efile_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static herr_t -H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) { const char *efile_pref = *(const char * const *)value; uint8_t **pp = (uint8_t **)_pp; @@ -1157,7 +1157,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dacc_vds_view_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dacc_vds_view_enc(const void *value, void **_pp, size_t *size) { const H5D_vds_view_t *view = (const H5D_vds_view_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 6211b5b..07fa9b7 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -152,7 +152,7 @@ static herr_t H5P__dcrt_reg_prop(H5P_genclass_t *pclass); /* Property callbacks */ static herr_t H5P__dcrt_layout_set(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_layout_get(hid_t prop_id, const char *name, size_t size, void *value); -static herr_t H5P__dcrt_layout_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dcrt_layout_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dcrt_layout_dec(const void **pp, void *value); static herr_t H5P__dcrt_layout_del(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_layout_copy(const char *name, size_t size, void *value); @@ -160,14 +160,14 @@ static int H5P__dcrt_layout_cmp(const void *value1, const void *value2, size_t s static herr_t H5P__dcrt_layout_close(const char *name, size_t size, void *value); static herr_t H5P__dcrt_fill_value_set(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_fill_value_get(hid_t prop_id, const char *name, size_t size, void *value); -static herr_t H5P__dcrt_fill_value_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dcrt_fill_value_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dcrt_fill_value_dec(const void **pp, void *value); static herr_t H5P__dcrt_fill_value_del(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_fill_value_copy(const char *name, size_t size, void *value); static herr_t H5P__dcrt_fill_value_close(const char *name, size_t size, void *value); static herr_t H5P__dcrt_ext_file_list_set(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_ext_file_list_get(hid_t prop_id, const char *name, size_t size, void *value); -static herr_t H5P__dcrt_ext_file_list_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dcrt_ext_file_list_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dcrt_ext_file_list_dec(const void **pp, void *value); static herr_t H5P__dcrt_ext_file_list_del(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__dcrt_ext_file_list_copy(const char *name, size_t size, void *value); @@ -379,18 +379,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata) +H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size) { const H5O_layout_t *layout = (const H5O_layout_t *)value; /* Create local aliases for values */ - H5P_enc_cb_info_t *udata = (H5P_enc_cb_info_t *)_udata; /* User data for encode callback */ uint8_t **pp = (uint8_t **)_pp; uint8_t *tmp_p; size_t tmp_size; size_t u; /* Local index variable */ - H5P_genplist_t *fapl_plist; /* The file access property list */ - hid_t new_fapl_id; /* The file access property list ID */ - H5F_libver_t low_bound = H5F_LIBVER_V110; /* Set the low bound in fapl to latest */ - H5F_libver_t high_bound = H5F_LIBVER_V110; /* Set the high bound in fapl to latest */ herr_t ret_value = SUCCEED; /* Return value */ @@ -400,20 +395,6 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata) HDassert(layout); HDassert(size); - /* Make a copy of the default file access property list */ - if(NULL == (fapl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Set latest format in fapl_plist */ - /* This will eventually be used by VDS to encode datasets via H5S_encode() */ - if(H5P_set(fapl_plist, H5F_ACS_LIBVER_LOW_BOUND_NAME, &low_bound) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'low' bound for library format versions") - if(H5P_set(fapl_plist, H5F_ACS_LIBVER_HIGH_BOUND_NAME, &high_bound) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'high' bound for library format versions") - - if((new_fapl_id = H5P_copy_plist(fapl_plist, FALSE)) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "can't copy file access property list") - if(NULL != *pp) { /* Encode layout type */ *(*pp)++ = (uint8_t)layout->type; @@ -460,14 +441,14 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata) tmp_size = (size_t)-1; tmp_p = *pp; - if(H5S_encode(layout->storage.u.virt.list[u].source_select, pp, &tmp_size, new_fapl_id) < 0) + if(H5S_encode(layout->storage.u.virt.list[u].source_select, pp, &tmp_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize source selection") *size += (size_t)(*pp - tmp_p); /* Virtual dataset selection. Same notes as above apply. */ tmp_size = (size_t)-1; tmp_p = *pp; - if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, pp, &tmp_size, new_fapl_id) < 0) + if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, pp, &tmp_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize virtual selection") *size += (size_t)(*pp - tmp_p); } /* end for */ @@ -500,14 +481,14 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size, void *_udata) /* Source selection */ tmp_size = (size_t)0; tmp_p = NULL; - if(H5S_encode(layout->storage.u.virt.list[u].source_select, &tmp_p, &tmp_size, new_fapl_id) < 0) + if(H5S_encode(layout->storage.u.virt.list[u].source_select, &tmp_p, &tmp_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize source selection") *size += tmp_size; /* Virtual dataset selection */ tmp_size = (size_t)0; tmp_p = NULL; - if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, &tmp_p, &tmp_size, new_fapl_id) < 0) + if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, &tmp_p, &tmp_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize virtual selection") *size += tmp_size; } /* end for */ @@ -1013,7 +994,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) { const H5O_fill_t *fill = (const H5O_fill_t *)value; /* Create local aliases for values */ size_t dt_size = 0; /* Size of encoded datatype */ @@ -1416,7 +1397,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) { const H5O_efl_t *efl = (const H5O_efl_t *)value; /* Create local aliases for values */ size_t len = 0; /* String length of slot name */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 1c97589..e33bc05 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -172,21 +172,21 @@ static herr_t H5P__dxfr_reg_prop(H5P_genclass_t *pclass); /* Property list callbacks */ -static herr_t H5P__dxfr_bkgr_buf_type_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_bkgr_buf_type_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_bkgr_buf_type_dec(const void **pp, void *value); -static herr_t H5P__dxfr_btree_split_ratio_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_btree_split_ratio_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_btree_split_ratio_dec(const void **pp, void *value); -static herr_t H5P__dxfr_io_xfer_mode_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_io_xfer_mode_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_io_xfer_mode_dec(const void **pp, void *value); -static herr_t H5P__dxfr_mpio_collective_opt_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_mpio_collective_opt_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_mpio_collective_opt_dec(const void **pp, void *value); -static herr_t H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_mpio_chunk_opt_hard_dec(const void **pp, void *value); -static herr_t H5P__dxfr_edc_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_edc_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_edc_dec(const void **pp, void *value); static herr_t H5P__dxfr_xform_set(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__dxfr_xform_get(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__dxfr_xform_enc(const void *value, void **pp, size_t *size, void *udata); +static herr_t H5P__dxfr_xform_enc(const void *value, void **pp, size_t *size); static herr_t H5P__dxfr_xform_dec(const void **pp, void *value); static herr_t H5P__dxfr_xform_del(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__dxfr_xform_copy(const char* name, size_t size, void* value); @@ -421,7 +421,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_bkgr_buf_type_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_bkgr_buf_type_enc(const void *value, void **_pp, size_t *size) { const H5T_bkg_t *bkgr_buf_type = (const H5T_bkg_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -494,7 +494,7 @@ H5P__dxfr_bkgr_buf_type_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_btree_split_ratio_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_btree_split_ratio_enc(const void *value, void **_pp, size_t *size) { const double *btree_split_ratio = (const double *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -655,7 +655,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) { const H5Z_data_xform_t *data_xform_prop = *(const H5Z_data_xform_t * const *)value; /* Create local alias for values */ const char *pexp = NULL; /* Pointer to transform expression */ @@ -1743,7 +1743,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_io_xfer_mode_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_io_xfer_mode_enc(const void *value, void **_pp, size_t *size) { const H5FD_mpio_xfer_t *xfer_mode = (const H5FD_mpio_xfer_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -1816,7 +1816,7 @@ H5P__dxfr_io_xfer_mode_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_mpio_collective_opt_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_mpio_collective_opt_enc(const void *value, void **_pp, size_t *size) { const H5FD_mpio_collective_opt_t *coll_opt = (const H5FD_mpio_collective_opt_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -1889,7 +1889,7 @@ H5P__dxfr_mpio_collective_opt_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **_pp, size_t *size) { const H5FD_mpio_chunk_opt_t *chunk_opt = (const H5FD_mpio_chunk_opt_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -2073,7 +2073,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__dxfr_edc_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__dxfr_edc_enc(const void *value, void **_pp, size_t *size) { const H5Z_EDC_t *check = (const H5Z_EDC_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 3332098..16dd5a8 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -52,7 +52,6 @@ typedef struct { hbool_t encode; /* Whether the property list should be encoded */ size_t *enc_size_ptr; /* Pointer to size of encoded buffer */ void **pp; /* Pointer to encoding buffer pointer */ - hid_t fapl_id; /* File access property list */ } H5P_enc_iter_ud_t; @@ -91,7 +90,7 @@ typedef struct { *------------------------------------------------------------------------- */ herr_t -H5P__encode_size_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_size_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; @@ -133,7 +132,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNU *------------------------------------------------------------------------- */ herr_t -H5P__encode_hsize_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) { uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */ unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */ @@ -174,7 +173,7 @@ H5P__encode_hsize_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UN *------------------------------------------------------------------------- */ herr_t -H5P__encode_unsigned(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_unsigned(const void *value, void **_pp, size_t *size) { uint8_t **pp = (uint8_t **)_pp; @@ -213,7 +212,7 @@ H5P__encode_unsigned(const void *value, void **_pp, size_t *size, void H5_ATTR_U *------------------------------------------------------------------------- */ herr_t -H5P__encode_uint8_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_uint8_t(const void *value, void **_pp, size_t *size) { uint8_t **pp = (uint8_t **)_pp; @@ -249,7 +248,7 @@ H5P__encode_uint8_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UN *------------------------------------------------------------------------- */ herr_t -H5P__encode_hbool_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_hbool_t(const void *value, void **_pp, size_t *size) { uint8_t **pp = (uint8_t **)_pp; @@ -284,7 +283,7 @@ H5P__encode_hbool_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UN *------------------------------------------------------------------------- */ herr_t -H5P__encode_double(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_double(const void *value, void **_pp, size_t *size) { uint8_t **pp = (uint8_t **)_pp; @@ -333,7 +332,6 @@ static int H5P__encode_cb(H5P_genprop_t *prop, void *_udata) { H5P_enc_iter_ud_t *udata = (H5P_enc_iter_ud_t *)_udata; /* Pointer to user data */ - H5P_enc_cb_info_t cb_udata; /* User data for property iteration callback */ int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -357,8 +355,7 @@ H5P__encode_cb(H5P_genprop_t *prop, void *_udata) /* Encode (or not, if *(udata->pp) is NULL) the property value */ prop_value_len = 0; - cb_udata.fapl_id = udata->fapl_id; - if((prop->encode)(prop->value, udata->pp, &prop_value_len, &cb_udata) < 0) + if((prop->encode)(prop->value, udata->pp, &prop_value_len) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, H5_ITER_ERROR, "property encoding routine failed") *(udata->enc_size_ptr) += prop_value_len; } /* end if */ @@ -393,7 +390,7 @@ done: --------------------------------------------------------------------------*/ herr_t H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf, - size_t *nalloc, hid_t fapl_id) + size_t *nalloc) { H5P_enc_iter_ud_t udata; /* User data for property iteration callback */ uint8_t *p = (uint8_t *)buf; /* Temporary pointer to encoding buffer */ @@ -428,7 +425,6 @@ H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, void *buf, udata.encode = encode; udata.enc_size_ptr = &encode_size; udata.pp = (void **)&p; - udata.fapl_id = fapl_id; /* Iterate over all properties in property list, encoding them */ idx = 0; diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index e5a0a63..b5fe527 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -298,18 +298,18 @@ static int H5P__facc_file_image_info_cmp(const void *value1, const void *value2, static herr_t H5P__facc_file_image_info_close(const char *name, size_t size, void *value); /* encode & decode callbacks */ -static herr_t H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_cache_config_dec(const void **_pp, void *value); static int H5P__facc_cache_config_cmp(const void *value1, const void *value2, size_t size); -static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_fclose_degree_dec(const void **pp, void *value); -static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_multi_type_dec(const void **_pp, void *value); static herr_t H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_libver_type_dec(const void **_pp, void *value); /* Metadata cache log location property callbacks */ -static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size); static herr_t H5P_facc_mdc_log_location_dec(const void **_pp, void *value); static herr_t H5P_facc_mdc_log_location_del(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P_facc_mdc_log_location_copy(const char *name, size_t size, void *value); @@ -318,7 +318,7 @@ static herr_t H5P_facc_mdc_log_location_close(const char *name, size_t size, voi /* Metadata cache image property callbacks */ static int H5P__facc_cache_image_config_cmp(const void *_config1, const void *_config2, size_t H5_ATTR_UNUSED size); -static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__facc_cache_image_config_dec(const void **_pp, void *_value); @@ -3020,7 +3020,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) { const H5AC_cache_image_config_t *config = (const H5AC_cache_image_config_t *)value; /* Create local aliases for value */ uint8_t **pp = (uint8_t **)_pp; @@ -3446,7 +3446,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) { const H5AC_cache_config_t *config = (const H5AC_cache_config_t *)value; /* Create local aliases for values */ uint8_t **pp = (uint8_t **)_pp; @@ -3726,7 +3726,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) { const H5F_close_degree_t *fclose_degree = (const H5F_close_degree_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -3799,7 +3799,7 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ static herr_t -H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) { const H5FD_mem_t *type = (const H5FD_mem_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -4299,7 +4299,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P_facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) { const char *log_location = *(const char * const *)value; uint8_t **pp = (uint8_t **)_pp; @@ -4599,7 +4599,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) { const H5P_coll_md_read_flag_t *coll_md_read_flag = (const H5P_coll_md_read_flag_t *)value; uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 8751b70..f90dae5 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -132,13 +132,13 @@ static herr_t H5P_fcrt_reg_prop(H5P_genclass_t *pclass); /* property callbacks */ -static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__fcrt_btree_rank_dec(const void **_pp, void *value); -static herr_t H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__fcrt_shmsg_index_types_dec(const void **_pp, void *value); -static herr_t H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__fcrt_shmsg_index_minsize_dec(const void **_pp, void *value); -static herr_t H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__fcrt_fspace_strategy_dec(const void **_pp, void *_value); @@ -722,7 +722,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size) { const unsigned *btree_k = (const unsigned *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -1013,7 +1013,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size) { const unsigned *type_flags = (const unsigned *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -1106,7 +1106,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size) { const unsigned *minsizes = (const unsigned *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; @@ -1388,7 +1388,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size) { const H5F_fspace_strategy_t *strategy = (const H5F_fspace_strategy_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index a719616..6f1fab1 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -69,9 +69,9 @@ static herr_t H5P__gcrt_reg_prop(H5P_genclass_t *pclass); /* Property callbacks */ -static herr_t H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__gcrt_group_info_dec(const void **_pp, void *value); -static herr_t H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__gcrt_link_info_dec(const void **_pp, void *value); @@ -546,7 +546,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__gcrt_group_info_enc(const void *value, void **_pp, size_t *size) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)value; /* Create local aliases for values */ uint8_t **pp = (uint8_t **)_pp; @@ -634,7 +634,7 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ static herr_t -H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__gcrt_link_info_enc(const void *value, void **_pp, size_t *size) { const H5O_linfo_t *linfo = (const H5O_linfo_t *)value; /* Create local aliases for values */ uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 4a95991..99d98f8 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -114,7 +114,7 @@ static herr_t H5P__lacc_reg_prop(H5P_genclass_t *pclass); /* Property list callbacks */ static herr_t H5P__lacc_elink_pref_set(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__lacc_elink_pref_get(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__lacc_elink_pref_dec(const void **_pp, void *value); static herr_t H5P__lacc_elink_pref_del(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__lacc_elink_pref_copy(const char* name, size_t size, void* value); @@ -122,7 +122,7 @@ static int H5P__lacc_elink_pref_cmp(const void *value1, const void *value2, size static herr_t H5P__lacc_elink_pref_close(const char* name, size_t size, void* value); static herr_t H5P__lacc_elink_fapl_set(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__lacc_elink_fapl_get(hid_t prop_id, const char* name, size_t size, void* value); -static herr_t H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__lacc_elink_fapl_dec(const void **_pp, void *value); static herr_t H5P__lacc_elink_fapl_del(hid_t prop_id, const char* name, size_t size, void* value); static herr_t H5P__lacc_elink_fapl_copy(const char* name, size_t size, void* value); @@ -338,11 +338,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *_udata) +H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) { const hid_t *elink_fapl = (const hid_t *)value; /* Property to encode */ uint8_t **pp = (uint8_t **)_pp; - H5P_enc_cb_info_t *udata = (H5P_enc_cb_info_t *)_udata; /* User data for encode callback */ H5P_genplist_t *fapl_plist; /* Pointer to property list */ hbool_t non_default_fapl = FALSE; /* Whether the FAPL is non-default */ size_t fapl_size = 0; /* FAPL's encoded size */ @@ -365,7 +364,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *_uda /* Encode the property list, if non-default */ /* (if *pp == NULL, will only compute the size) */ if(non_default_fapl) { - if(H5P__encode(fapl_plist, TRUE, NULL, &fapl_size, udata->fapl_id) < 0) + if(H5P__encode(fapl_plist, TRUE, NULL, &fapl_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list") if(*pp) { @@ -380,7 +379,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size, void *_uda UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode the plist */ - if(H5P__encode(fapl_plist, TRUE, *pp, &fapl_size, udata->fapl_id) < 0) + if(H5P__encode(fapl_plist, TRUE, *pp, &fapl_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "can't encode property list") *pp += fapl_size; @@ -689,7 +688,7 @@ H5P__lacc_elink_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static herr_t -H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) { const char *elink_pref = *(const char * const *)value; uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b3c472e..be41e32 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -90,7 +90,7 @@ static herr_t H5P__ocrt_reg_prop(H5P_genclass_t *pclass); /* Property callbacks */ -static herr_t H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__ocrt_pipeline_dec(const void **_pp, void *value); static herr_t H5P__ocrt_pipeline_set(hid_t prop_id, const char *name, size_t size, void *value); static herr_t H5P__ocrt_pipeline_get(hid_t prop_id, const char *name, size_t size, void *value); @@ -1459,7 +1459,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) { const H5O_pline_t *pline = (const H5O_pline_t *)value; uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index c59a53a..60b2363 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -176,21 +176,21 @@ H5_DLL hid_t H5P__new_plist_of_type(H5P_plist_type_t type); /* Encode/decode routines */ H5_DLL herr_t H5P__encode(const H5P_genplist_t *plist, hbool_t enc_all_prop, - void *buf, size_t *nalloc, hid_t fapl_id); + void *buf, size_t *nalloc); H5_DLL hid_t H5P__decode(const void *buf); -H5_DLL herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size, void *udata); -H5_DLL herr_t H5P__encode_size_t(const void *value, void **_pp, size_t *size, void *udata); -H5_DLL herr_t H5P__encode_unsigned(const void *value, void **_pp, size_t *size, void *udata); -H5_DLL herr_t H5P__encode_uint8_t(const void *value, void **_pp, size_t *size, void *udata); -H5_DLL herr_t H5P__encode_hbool_t(const void *value, void **_pp, size_t *size, void *udata); -H5_DLL herr_t H5P__encode_double(const void *value, void **_pp, size_t *size, void *udat); +H5_DLL herr_t H5P__encode_hsize_t(const void *value, void **_pp, size_t *size); +H5_DLL herr_t H5P__encode_size_t(const void *value, void **_pp, size_t *size); +H5_DLL herr_t H5P__encode_unsigned(const void *value, void **_pp, size_t *size); +H5_DLL herr_t H5P__encode_uint8_t(const void *value, void **_pp, size_t *size); +H5_DLL herr_t H5P__encode_hbool_t(const void *value, void **_pp, size_t *size); +H5_DLL herr_t H5P__encode_double(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__decode_hsize_t(const void **_pp, void *value); H5_DLL herr_t H5P__decode_size_t(const void **_pp, void *value); H5_DLL herr_t H5P__decode_unsigned(const void **_pp, void *value); H5_DLL herr_t H5P__decode_uint8_t(const void **_pp, void *value); H5_DLL herr_t H5P__decode_hbool_t(const void **_pp, void *value); H5_DLL herr_t H5P__decode_double(const void **_pp, void *value); -H5_DLL herr_t H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size, void *udata); +H5_DLL herr_t H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size); H5_DLL herr_t H5P__decode_coll_md_read_flag_t(const void **_pp, void *value); /* Private OCPL routines */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index a18df06..460e16b 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -86,14 +86,9 @@ typedef herr_t (*H5P_reg_prop_func_t)(H5P_genclass_t *pclass); /* Move encode/decode callback typedefs from H5Ppublic.h: not exposed to user */ /* Add a parameter to encode callback */ -typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size, void *udata); +typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size); typedef herr_t (*H5P_prp_decode_func_t)(const void **buf, void *value); -/* User data passed to encode callback */ -typedef struct H5P_enc_cb_info_t { - hid_t fapl_id; /* File access property list */ -} H5P_enc_cb_info_t; - /* * Each library property list class has a variable of this type that contains * class variables and methods used to initialize the class. diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index b84d69b..fb91356 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -69,7 +69,7 @@ static herr_t H5P__strcrt_reg_prop(H5P_genclass_t *pclass); /* encode & decode callbacks */ -static herr_t H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size, void *udata); +static herr_t H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size); static herr_t H5P__strcrt_char_encoding_dec(const void **_pp, void *value); @@ -227,7 +227,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size, void H5_ATTR_UNUSED *udata) +H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size) { const H5T_cset_t *encoding = (const H5T_cset_t *)value; /* Create local alias for values */ uint8_t **pp = (uint8_t **)_pp; diff --git a/src/H5Rint.c b/src/H5Rint.c index 1465ee1..159bcca 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -242,6 +242,9 @@ H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, obj_loc.path = &path; H5G_loc_reset(&obj_loc); + /* Set the FAPL for the API context */ + H5CX_set_libver_bounds(loc->oloc->file); + /* Find the object */ if(H5G_loc_find(loc, name, &obj_loc) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found") @@ -290,7 +293,7 @@ H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, HDmemset(ref, 0, H5R_DSET_REG_REF_BUF_SIZE); /* Get the amount of space required to serialize the selection */ - if ((buf_size = H5S_SELECT_SERIAL_SIZE(space, loc->oloc->file)) < 0) + if ((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "Invalid amount of space for serializing selection") /* Increase buffer size to allow for the dataset OID */ @@ -306,7 +309,7 @@ H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5F_addr_encode(loc->oloc->file, &p, obj_loc.oloc->addr); /* Serialize the selection into heap buffer */ - if (H5S_SELECT_SERIALIZE(space, &p, loc->oloc->file) < 0) + if (H5S_SELECT_SERIALIZE(space, &p) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") /* Save the serialized buffer for later */ @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Fprivate.h" /* Files */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ @@ -1595,6 +1596,7 @@ herr_t H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) { H5S_t *dspace; + hid_t temp_fapl_id = H5P_DEFAULT; herr_t ret_value=SUCCEED; FUNC_ENTER_API(FAIL) @@ -1602,10 +1604,14 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) /* Check argument and retrieve object */ if (NULL == (dspace = (H5S_t *)H5I_object_verify(obj_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + + /* Verify access property list and set up collective metadata if appropriate */ + if(H5CX_set_apl(&temp_fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") - if(H5S_encode(dspace, (unsigned char **)&buf, nalloc, H5P_FILE_ACCESS_DEFAULT)<0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace") + if(H5S_encode(dspace, (unsigned char **)&buf, nalloc)<0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode dataspace") done: FUNC_LEAVE_API(ret_value) @@ -1629,7 +1635,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id) +H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc) { H5F_t *f = NULL; /* Fake file structure*/ size_t extent_size; /* Size of serialized dataspace extent */ @@ -1640,7 +1646,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id) FUNC_ENTER_NOAPI_NOINIT /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc((uint8_t)0, fapl_id))) + if(NULL == (f = H5F_fake_alloc((uint8_t)0))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") /* Find out the size of buffer needed for extent */ @@ -1648,7 +1654,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id) HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace size") /* Find out the size of buffer needed for selection */ - if((sselect_size = H5S_SELECT_SERIAL_SIZE(obj, f)) < 0) + if((sselect_size = H5S_SELECT_SERIAL_SIZE(obj)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, FAIL, "can't find dataspace selection size") H5_CHECKED_ASSIGN(select_size, size_t, sselect_size, hssize_t); @@ -1678,7 +1684,7 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id) /* Encode the selection part of dataspace. */ *p = pp; - if(H5S_SELECT_SERIALIZE(obj, p, f) < 0) + if(H5S_SELECT_SERIALIZE(obj, p) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space") } /* end else */ @@ -1772,7 +1778,7 @@ H5S_decode(const unsigned char **p) sizeof_size = *pp++; /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc(sizeof_size, H5P_FILE_ACCESS_DEFAULT))) + if(NULL == (f = H5F_fake_alloc(sizeof_size))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") /* Decode size of extent information */ diff --git a/src/H5Sall.c b/src/H5Sall.c index ea5e1ab..1738615 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -36,8 +36,8 @@ static herr_t H5S__all_get_seq_list(const H5S_t *space, unsigned flags, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); static herr_t H5S__all_release(H5S_t *space); static htri_t H5S__all_is_valid(const H5S_t *space); -static hssize_t H5S__all_serial_size(const H5S_t *space, H5F_t *f); -static herr_t H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); +static hssize_t H5S__all_serial_size(const H5S_t *space); +static herr_t H5S__all_serialize(const H5S_t *space, uint8_t **p); static herr_t H5S__all_deserialize(H5S_t **space, const uint8_t **p); static herr_t H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S__all_offset(const H5S_t *space, hsize_t *off); @@ -55,7 +55,7 @@ static herr_t H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); static herr_t H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); static hsize_t H5S__all_iter_nelmts(const H5S_sel_iter_t *iter); static htri_t H5S__all_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S__all_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem); +static herr_t H5S__all_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); static herr_t H5S__all_iter_next_block(H5S_sel_iter_t *sel_iter); static herr_t H5S__all_iter_release(H5S_sel_iter_t *sel_iter); @@ -267,7 +267,7 @@ H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) USAGE herr_t H5S__all_iter_next(iter, nelem) H5S_sel_iter_t *iter; IN: Pointer to selection iterator - hsize_t nelem; IN: Number of elements to advance by + size_t nelem; IN: Number of elements to advance by RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -278,7 +278,7 @@ H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) +H5S__all_iter_next(H5S_sel_iter_t *iter, size_t nelem) { FUNC_ENTER_STATIC_NOERR @@ -456,9 +456,8 @@ H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space) Determine the number of bytes needed to store the serialized "all" selection information. USAGE - hssize_t H5S_all_serial_size(space, f) + hssize_t H5S_all_serial_size(space) H5S_t *space; IN: Dataspace pointer to query - H5F_t *f; IN: File pointer RETURNS The number of bytes required on success, negative on an error. DESCRIPTION @@ -470,7 +469,7 @@ H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) +H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_STATIC_NOERR @@ -490,12 +489,11 @@ H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S__all_serialize(space, p, f) + herr_t H5S__all_serialize(space, p) const H5S_t *space; IN: Dataspace with selection to serialize uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of serialized selection. - H5F_t *f; IN: File pointer RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -507,7 +505,7 @@ H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f) +H5S__all_serialize(const H5S_t *space, uint8_t **p) { uint8_t *pp = (*p); /* Local pointer for decoding */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 746d9a0..55913e0 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -21,12 +21,13 @@ #include "H5Smodule.h" /* This source code file is part of the H5S module */ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* ID Functions */ -#include "H5Spkg.h" /* Dataspace functions */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5Spkg.h" /* Dataspace functions */ +#include "H5VMprivate.h" /* Vector functions */ /* Format version bounds for dataspace hyperslab selection */ const unsigned H5O_sds_hyper_ver_bounds[] = { @@ -85,8 +86,8 @@ static herr_t H5S__hyper_get_seq_list(const H5S_t *space, unsigned flags, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); static herr_t H5S__hyper_release(H5S_t *space); static htri_t H5S__hyper_is_valid(const H5S_t *space); -static hssize_t H5S__hyper_serial_size(const H5S_t *space, H5F_t *f); -static herr_t H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); +static hssize_t H5S__hyper_serial_size(const H5S_t *space); +static herr_t H5S__hyper_serialize(const H5S_t *space, uint8_t **p); static herr_t H5S__hyper_deserialize(H5S_t **space, const uint8_t **p); static herr_t H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S__hyper_offset(const H5S_t *space, hsize_t *offset); @@ -106,7 +107,7 @@ static herr_t H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords static herr_t H5S__hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); static hsize_t H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter); static htri_t H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *sel_iter); -static herr_t H5S__hyper_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem); +static herr_t H5S__hyper_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); static herr_t H5S__hyper_iter_next_block(H5S_sel_iter_t *sel_iter); static herr_t H5S__hyper_iter_release(H5S_sel_iter_t *sel_iter); /* Static function for optimizing hyperslab */ @@ -687,7 +688,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) +H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) { unsigned ndims; /* Number of dimensions of dataset */ int fast_dim; /* Rank of the fastest changing dimension for the dataspace */ @@ -737,14 +738,14 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) temp_dim=fast_dim; while(temp_dim>=0) { if(temp_dim==fast_dim) { - hsize_t actual_elem; /* Actual # of elements advanced on each iteration through loop */ + size_t actual_elem; /* Actual # of elements advanced on each iteration through loop */ hsize_t block_elem; /* Number of elements left in a block */ /* Compute the number of elements left in block */ block_elem = tdiminfo[temp_dim].block - iter_offset[temp_dim]; /* Compute the number of actual elements to advance */ - actual_elem=MIN(nelem,block_elem); + actual_elem=(size_t)MIN(nelem,block_elem); /* Move the iterator over as many elements as possible */ iter_offset[temp_dim] += actual_elem; @@ -808,7 +809,7 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem) /* Increment absolute position */ if(curr_dim==fast_dim) { - hsize_t actual_elem; /* Actual # of elements advanced on each iteration through loop */ + size_t actual_elem; /* Actual # of elements advanced on each iteration through loop */ hsize_t span_elem; /* Number of elements left in a span */ /* Compute the number of elements left in block */ @@ -1871,8 +1872,9 @@ H5S__hyper_span_nblocks(const H5S_hyper_span_info_t *spans) PURPOSE Get the number of hyperslab blocks in current hyperslab selection USAGE - hsize_t H5S__get_select_hyper_nblocks(space) + hsize_t H5S__get_select_hyper_nblocks(space, app_ref) H5S_t *space; IN: Dataspace ptr of selection to query + hbool_t app_ref; IN: Whether this is an appl. ref. call RETURNS The number of hyperslab blocks in selection on success, negative on failure DESCRIPTION @@ -1883,7 +1885,7 @@ H5S__hyper_span_nblocks(const H5S_hyper_span_info_t *spans) REVISION LOG --------------------------------------------------------------------------*/ static hsize_t -H5S__get_select_hyper_nblocks(const H5S_t *space) +H5S__get_select_hyper_nblocks(const H5S_t *space, hbool_t app_ref) { hsize_t ret_value = 0; /* Return value */ @@ -1898,7 +1900,8 @@ H5S__get_select_hyper_nblocks(const H5S_t *space) /* Check each dimension */ for(ret_value = 1, u = 0; u < space->extent.rank; u++) - ret_value *= space->select.sel_info.hslab->app_diminfo[u].count; + ret_value *= (app_ref ? space->select.sel_info.hslab->app_diminfo[u].count : + space->select.sel_info.hslab->opt_diminfo[u].count); } /* end if */ else ret_value = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst); @@ -1941,7 +1944,7 @@ H5Sget_select_hyper_nblocks(hid_t spaceid) if(space->select.sel_info.hslab->unlim_dim >= 0) HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot get number of blocks for unlimited selection") - ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space); + ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space, TRUE); done: FUNC_LEAVE_API(ret_value) @@ -1950,88 +1953,52 @@ done: /*-------------------------------------------------------------------------- NAME - H5S_hyper_set_offset_size + H5S_hyper_get_version_enc_size PURPOSE - Determine the offset size (4 or 8 bytes) to use for encoding hyperslab selection info - USAGE - hssize_t H5S_hyper_set_offset_size(space, block_count, bounds_end, version, offset_size) - const H5S_t *space: IN: The maximum size of the hyperslab selection info - hsize_t block_count: IN: The number of blocks in the selection - hsize_t bounds_end: IN: The selection high bounds - uint32_t version: IN: The version used for encoding - uint8_t *offset_size: OUT: The offset size - - RETURNS - The offset size - DESCRIPTION - Determine the offset size for encoding hyperslab selection info based on the - the input parameter "version". This is for release 1.10. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5S_hyper_set_offset_size(const H5S_t *space, hsize_t block_count, hsize_t bounds_end[], uint32_t version, uint8_t *offset_size) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - switch(version) { - case H5S_HYPER_VERSION_1: - *offset_size = H5S_INFO_SIZE_4; - break; - - case H5S_HYPER_VERSION_2: - *offset_size = H5S_INFO_SIZE_8; - break; - - default: - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper offset size") - break; - } - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_hyper_set_offset_size() */ - - -/*-------------------------------------------------------------------------- - NAME - H5S_hyper_set_version - PURPOSE - Determine the version to use for encoding hyperslab selection info + Determine the version and encoded size to use for encoding hyperslab selection info See tables 2 & 3 in the RFC: H5Sencode/H5Sdecode Format Change USAGE - hssize_t H5S_hyper_set_version(space, block_count, bounds_end, f, version) + hssize_t H5S_hyper_get_version_enc_size(space, block_count, version, enc_size) const H5S_t *space: IN: The dataspace hsize_t block_count: IN: The number of blocks in the selection - hsize_t bounds_end: IN: The selection high bounds - H5F_t *f: IN: The file pointer uint32_t *version: OUT: The version to use for encoding + uint8_t *enc_size: OUT: The encoded size to use RETURNS - The version to use + The version and the size to encode hyperslab selection info DESCRIPTION Determine the version to use for encoding hyperslab selection info based on whether the number of blocks or the selection high bounds exceeds (2^32 - 1). + Then determine the encoded size based on version. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_end[], H5F_t *f, uint32_t *version) +H5S_hyper_get_version_enc_size(const H5S_t *space, hsize_t block_count, uint32_t *version, uint8_t *enc_size) { + hsize_t bounds_start[H5S_MAX_RANK]; /* Starting coordinate of bounding box */ + hsize_t bounds_end[H5S_MAX_RANK]; /* Opposite coordinate of bounding box */ hbool_t count_up_version = FALSE; /* Whether number of blocks exceed (2^32 - 1) */ hbool_t bound_up_version = FALSE; /* Whether high bounds exceed (2^32 - 1) */ + H5F_libver_t low_bound; /* The 'low' bound of library format versions */ + H5F_libver_t high_bound; /* The 'high' bound of library format versions */ unsigned u; /* Local index veriable */ uint32_t tmp_version; /* Temporay version */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI_NOINIT + /* Get bounding box for the selection */ + HDmemset(bounds_end, 0, sizeof(bounds_end)); + + if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */ + /* Get bounding box for the selection */ + if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") + } + /* Determine whether the number of blocks or the high bounds in the selection exceed (2^32 - 1) */ if(block_count > H5S_UINT32_MAX) count_up_version = TRUE; @@ -2041,6 +2008,10 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en bound_up_version = TRUE; } + /* Get the file's low_bound and high_bound */ + if(H5CX_get_libver_bounds(&low_bound, &high_bound) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get low/high bounds from API context") + /* Use version 2 for unlimited selection */ if(space->select.sel_info.hslab->unlim_dim >= 0) tmp_version = H5S_HYPER_VERSION_2; @@ -2052,7 +2023,7 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en else /* block_count < 4: version 1 */ /* block_count >= 4: determined by low bound */ - tmp_version = (block_count < 4) ? H5S_HYPER_VERSION_1 : H5O_sds_hyper_ver_bounds[H5F_LOW_BOUND(f)]; + tmp_version = (block_count < 4) ? H5S_HYPER_VERSION_1 : H5O_sds_hyper_ver_bounds[low_bound]; } else { /* Fail for irregular hyperslab if exceeds 32 bits */ @@ -2064,14 +2035,29 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en } /* Version bounds check */ - if(tmp_version > H5O_sds_hyper_ver_bounds[H5F_HIGH_BOUND(f)]) + if(tmp_version > H5O_sds_hyper_ver_bounds[high_bound]) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "Dataspace hyperslab selection version out of bounds") *version = tmp_version; + /* Determine the encoded size based on version */ + switch(tmp_version) { + case H5S_HYPER_VERSION_1: + *enc_size = H5S_SELECT_INFO_ENC_SIZE_4; + break; + + case H5S_HYPER_VERSION_2: + *enc_size = H5S_SELECT_INFO_ENC_SIZE_8; + break; + + default: + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper encoded size") + break; + } + done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_hyper_set_version() */ +} /* H5S_hyper_get_version_enc_size() */ /*-------------------------------------------------------------------------- @@ -2081,9 +2067,8 @@ done: Determine the number of bytes needed to store the serialized hyperslab selection information. USAGE - hssize_t H5S_hyper_serial_size(space, H5F_t *f) + hssize_t H5S_hyper_serial_size(space) H5S_t *space; IN: Dataspace pointer to query - H5F_t *f; IN: File pointer RETURNS The number of bytes required on success, negative on an error. DESCRIPTION @@ -2095,44 +2080,23 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S__hyper_serial_size(const H5S_t *space, H5F_t *f) +H5S__hyper_serial_size(const H5S_t *space) { hsize_t block_count = 0; /* block counter for regular hyperslabs */ - hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds */ - hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds */ uint32_t version; /* Version number */ - uint8_t offset_size; /* Offset size */ - unsigned u; /* Local index variable */ + uint8_t enc_size; /* Encoded size of hyperslab selection info */ hssize_t ret_value = -1; /* return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(space); - /* Get bounding box for the selection */ - HDmemset(bounds_end, 0, sizeof(bounds_end)); - if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */ - /* Determine the number of blocks */ - if(H5S__hyper_is_regular(space)) { - /* Check each dimension */ - for(block_count = 1, u = 0; u < space->extent.rank; u++) - block_count *= space->select.sel_info.hslab->opt_diminfo[u].count; - } /* end if */ - else - /* Spin through hyperslab spans, adding 8 * rank bytes for each block */ - block_count = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst); - - /* Get bounding box for the selection */ - if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") - } - - /* Determine the version */ - if(H5S_hyper_set_version(space, block_count, bounds_end, f, &version) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") + /* Determine the number of blocks */ + if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ + block_count = H5S__get_select_hyper_nblocks(space, FALSE); - /* Determine the offset size */ - if(H5S_hyper_set_offset_size(space, block_count, bounds_end, version, &offset_size) < 0) + /* Determine the version and the encoded size */ + if(H5S_hyper_get_version_enc_size(space, block_count, &version, &enc_size) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") if(version == H5S_HYPER_VERSION_2) { @@ -2140,19 +2104,19 @@ H5S__hyper_serial_size(const H5S_t *space, H5F_t *f) /* Size required is always: * <type (4 bytes)> + <version (4 bytes)> + <flags (1 byte)> + * <length (4 bytes)> + <rank (4 bytes)> + - * (4 (start/stride/count/block) * <offset_size (8 bytes)> * <rank>) = + * (4 (start/stride/count/block) * <enc_size (8 bytes)> * <rank>) = * 17 + (4 * 8 * rank) bytes */ - HDassert(offset_size == 8); + HDassert(enc_size == 8); ret_value = (hssize_t)17 + ((hssize_t)4 * (hssize_t)8 * (hssize_t)space->extent.rank); } else { HDassert(version == H5S_HYPER_VERSION_1); - HDassert(offset_size == 4); + HDassert(enc_size == 4); /* Version 1 */ /* Basic number of bytes required to serialize hyperslab selection: * <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> + * <length (4 bytes)> + <rank (4 bytes)> + <# of blocks (4 bytes)> + - * (2 (starting/ending offset) * <offset_size (4 bytes)> * <rank> * <# of blocks) = + * (2 (starting/ending offset) * <enc_size (4 bytes)> * <rank> * <# of blocks) = * = 24 bytes + (2 * 4 * rank * block_count) */ ret_value = 24; @@ -2257,7 +2221,6 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans, uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of serialized selection. - H5F_t *f; IN: File pointer RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -2269,7 +2232,7 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans, REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f) +H5S__hyper_serialize(const H5S_t *space, uint8_t **p) { const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */ uint8_t *pp; /* Local pointer for encoding */ @@ -2281,14 +2244,13 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f) uint32_t len = 0; /* number of bytes used */ uint32_t version; /* Version number */ uint8_t flags = 0; /* Flags for message */ - hsize_t block_count; /* block counter for regular hyperslabs */ + hsize_t block_count = 0; /* block counter for regular hyperslabs */ unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned ndims; /* Rank of the dataspace */ - unsigned u; /* Local counting variable */ + unsigned i, u; /* Local counting variable */ int done; /* Whether we are done with the iteration */ - uint8_t offset_size; - hsize_t bounds_start[H5S_MAX_RANK]; - hsize_t bounds_end[H5S_MAX_RANK]; + hbool_t is_regular; /* Whether selection is regular */ + uint8_t enc_size; /* Encoded size */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2303,38 +2265,23 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f) ndims = space->extent.rank; diminfo = space->select.sel_info.hslab->opt_diminfo; - if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */ - /* Calculate the # of blocks */ - if(H5S__hyper_is_regular(space)) { - /* Check each dimension */ - for(block_count = 1, u = 0; u < ndims; u++) - block_count *= diminfo[u].count; - } /* end if */ - else - /* Spin through hyperslab spans, adding 8 * rank bytes for each block */ - block_count = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst); - - /* Get bounding box */ - if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") - } + /* Calculate the # of blocks */ + if(space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ + block_count = H5S__get_select_hyper_nblocks(space, FALSE); /* Determine the version to use */ - if(H5S_hyper_set_version(space, block_count, bounds_end, f, &version) < 0) + if(H5S_hyper_get_version_enc_size(space, block_count, &version, &enc_size) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") - /* Determine the size of offset info */ - if(H5S_hyper_set_offset_size(space, block_count, bounds_end, version, &offset_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") - - if(H5S__hyper_is_regular(space) && version == H5S_HYPER_VERSION_2) + is_regular = H5S__hyper_is_regular(space); + if(is_regular && version == H5S_HYPER_VERSION_2) flags |= H5S_HYPER_REGULAR; /* Store the preamble information */ UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ UINT32ENCODE(pp, version); /* Store the version number */ - if(version == 2) + if(version == H5S_HYPER_VERSION_2) *(pp)++ = flags; /* Store the flags */ else UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ @@ -2346,105 +2293,110 @@ H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f) /* Encode number of dimensions */ UINT32ENCODE(pp, (uint32_t)ndims); - /* If flags indicates a regular hyperslab or unlimited dimension, encode opt_diminfo */ - if(flags & H5S_HYPER_REGULAR) { - unsigned i; - - HDassert(H5S_UNLIMITED == HSIZE_UNDEF); - HDassert(version == H5S_HYPER_VERSION_2); - - /* Iterate over dimensions */ - /* Encode start/stride/block/count */ - for(i = 0; i < space->extent.rank; i++) { - UINT64ENCODE(pp, diminfo[i].start); - UINT64ENCODE(pp, diminfo[i].stride); - UINT64ENCODE(pp, diminfo[i].count); - UINT64ENCODE(pp, diminfo[i].block); - } /* end for */ - len += (4 * space->extent.rank * 8); - } /* end if */ /* Check for a "regular" hyperslab selection */ - else if(H5S__hyper_is_regular(space)) { - HDassert(version == H5S_HYPER_VERSION_1); + if(is_regular) { - /* Set some convienence values */ - fast_dim = ndims - 1; - /* Encode number of hyperslabs */ - H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); - UINT32ENCODE(pp, (uint32_t)block_count); - len += 4; + /* If flags indicates a regular hyperslab or unlimited dimension, encode opt_diminfo */ + if(version == H5S_HYPER_VERSION_2) { - /* Now serialize the information for the regular hyperslab */ + HDassert(H5S_UNLIMITED == HSIZE_UNDEF); + HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_8); - /* Build the tables of count sizes as well as the initial offset */ - for(u = 0; u < ndims; u++) { - tmp_count[u] = diminfo[u].count; - offset[u] = diminfo[u].start; - } /* end for */ + /* Iterate over dimensions */ + /* Encode start/stride/block/count */ + for(i = 0; i < space->extent.rank; i++) { + UINT64ENCODE(pp, diminfo[i].start); + UINT64ENCODE(pp, diminfo[i].stride); + UINT64ENCODE(pp, diminfo[i].count); + UINT64ENCODE(pp, diminfo[i].block); + } /* end for */ + len += (4 * space->extent.rank * 8); + } else { + HDassert(version == H5S_HYPER_VERSION_1); + HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4); - /* We're not done with the iteration */ - done = FALSE; + /* Set some convienence values */ + fast_dim = ndims - 1; - /* Go iterate over the hyperslabs */ - while(done == FALSE) { - /* Iterate over the blocks in the fastest dimension */ - while(tmp_count[fast_dim] > 0) { - /* Add 8 bytes times the rank for each hyperslab selected */ - len += 8 * ndims; + /* Encode number of hyperslabs */ + H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); + UINT32ENCODE(pp, (uint32_t)block_count); + len += 4; - /* Encode hyperslab starting location */ - for(u = 0; u < ndims; u++) - UINT32ENCODE(pp, (uint32_t)offset[u]); + /* Now serialize the information for the regular hyperslab */ - /* Encode hyperslab ending location */ - for(u = 0; u < ndims; u++) - UINT32ENCODE(pp, (uint32_t)(offset[u] + (diminfo[u].block - 1))); + /* Build the tables of count sizes as well as the initial offset */ + for(u = 0; u < ndims; u++) { + tmp_count[u] = diminfo[u].count; + offset[u] = diminfo[u].start; + } /* end for */ - /* Move the offset to the next sequence to start */ - offset[fast_dim]+=diminfo[fast_dim].stride; + /* We're not done with the iteration */ + done = FALSE; - /* Decrement the block count */ - tmp_count[fast_dim]--; - } /* end while */ + /* Go iterate over the hyperslabs */ + while(done == FALSE) { + /* Iterate over the blocks in the fastest dimension */ + while(tmp_count[fast_dim] > 0) { + /* Add 8 bytes times the rank for each hyperslab selected */ + len += 8 * ndims; - /* Work on other dimensions if necessary */ - if(fast_dim > 0) { - int temp_dim; /* Temporary rank holder */ + /* Encode hyperslab starting location */ + for(u = 0; u < ndims; u++) + UINT32ENCODE(pp, (uint32_t)offset[u]); - /* Reset the block counts */ - tmp_count[fast_dim] = diminfo[fast_dim].count; + /* Encode hyperslab ending location */ + for(u = 0; u < ndims; u++) + UINT32ENCODE(pp, (uint32_t)(offset[u] + (diminfo[u].block - 1))); + + /* Move the offset to the next sequence to start */ + offset[fast_dim]+=diminfo[fast_dim].stride; - /* Bubble up the decrement to the slower changing dimensions */ - temp_dim = (int)fast_dim - 1; - while(temp_dim >= 0 && done == FALSE) { /* Decrement the block count */ - tmp_count[temp_dim]--; + tmp_count[fast_dim]--; + } /* end while */ - /* Check if we have more blocks left */ - if(tmp_count[temp_dim] > 0) - break; + /* Work on other dimensions if necessary */ + if(fast_dim > 0) { + int temp_dim; /* Temporary rank holder */ - /* Check for getting out of iterator */ - if(temp_dim == 0) - done = TRUE; + /* Reset the block counts */ + tmp_count[fast_dim] = diminfo[fast_dim].count; - /* Reset the block count in this dimension */ - tmp_count[temp_dim] = diminfo[temp_dim].count; + /* Bubble up the decrement to the slower changing dimensions */ + temp_dim = (int)fast_dim - 1; + while(temp_dim >= 0 && done == FALSE) { + /* Decrement the block count */ + tmp_count[temp_dim]--; - /* Wrapped a dimension, go up to next dimension */ - temp_dim--; - } /* end while */ - } /* end if */ - else - break; /* Break out now, for 1-D selections */ + /* Check if we have more blocks left */ + if(tmp_count[temp_dim] > 0) + break; - /* Re-compute offset array */ - for(u = 0; u < ndims; u++) - offset[u] = diminfo[u].start + diminfo[u].stride * (diminfo[u].count - tmp_count[u]); - } /* end while */ - } /* end if */ - else { + /* Check for getting out of iterator */ + if(temp_dim == 0) + done = TRUE; + + /* Reset the block count in this dimension */ + tmp_count[temp_dim] = diminfo[temp_dim].count; + + /* Wrapped a dimension, go up to next dimension */ + temp_dim--; + } /* end while */ + } /* end if */ + else + break; /* Break out now, for 1-D selections */ + + /* Re-compute offset array */ + for(u = 0; u < ndims; u++) + offset[u] = diminfo[u].start + diminfo[u].stride * (diminfo[u].count - tmp_count[u]); + } /* end while */ + } /* end if */ + + } else { /* irregular */ HDassert(version == H5S_HYPER_VERSION_1); + HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4); + /* Encode number of hyperslabs */ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); UINT32ENCODE(pp, (uint32_t)block_count); @@ -2500,7 +2452,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) hsize_t dims[H5S_MAX_RANK]; /* Dimenion sizes */ hsize_t start[H5S_MAX_RANK]; /* Hyperslab start information */ hsize_t block[H5S_MAX_RANK]; /* Hyperslab block information */ - uint32_t version; /* Version number */ + uint32_t version; /* Version number */ /* Encoded size */ uint8_t flags = 0; /* Flags */ unsigned rank; /* Rank of points */ const uint8_t *pp; /* Local pointer for decoding */ @@ -2529,7 +2481,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) /* Decode version */ UINT32DECODE(pp, version); - if(version >= (uint32_t)2) { + if(version >= (uint32_t)H5S_HYPER_VERSION_2) { /* Decode flags */ flags = *(pp)++; @@ -2559,7 +2511,7 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p) /* Sanity checks */ HDassert(H5S_UNLIMITED == HSIZE_UNDEF); - HDassert(version >= 2); + HDassert(version >= H5S_HYPER_VERSION_2); /* Iterate over dimensions */ for(u = 0; u < rank; u++) { diff --git a/src/H5Snone.c b/src/H5Snone.c index 0005b99..aa98035 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -37,8 +37,8 @@ static herr_t H5S_none_get_seq_list(const H5S_t *space, unsigned flags, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); static herr_t H5S_none_release(H5S_t *space); static htri_t H5S_none_is_valid(const H5S_t *space); -static hssize_t H5S_none_serial_size(const H5S_t *space, H5F_t *f); -static herr_t H5S_none_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); +static hssize_t H5S_none_serial_size(const H5S_t *space); +static herr_t H5S_none_serialize(const H5S_t *space, uint8_t **p); static herr_t H5S_none_deserialize(H5S_t **space, const uint8_t **p); static herr_t H5S_none_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S_none_offset(const H5S_t *space, hsize_t *off); @@ -56,7 +56,7 @@ static herr_t H5S_none_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); static herr_t H5S_none_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); static hsize_t H5S_none_iter_nelmts(const H5S_sel_iter_t *iter); static htri_t H5S_none_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S_none_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem); +static herr_t H5S_none_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem); static herr_t H5S_none_iter_next_block(H5S_sel_iter_t *sel_iter); static herr_t H5S_none_iter_release(H5S_sel_iter_t *sel_iter); @@ -250,7 +250,7 @@ H5S_none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) USAGE herr_t H5S_none_iter_next(iter, nelem) H5S_sel_iter_t *iter; IN: Pointer to selection iterator - hsize_t nelem; IN: Number of elements to advance by + size_t nelem; IN: Number of elements to advance by RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -261,7 +261,7 @@ H5S_none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_UNUSED nelem) +H5S_none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED nelem) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -434,7 +434,6 @@ H5S_none_is_valid(const H5S_t H5_ATTR_UNUSED *space) USAGE hssize_t H5S_none_serial_size(space, f) H5S_t *space; IN: Dataspace pointer to query - H5F_t *f; IN: File pointer RETURNS The number of bytes required on success, negative on an error. DESCRIPTION @@ -446,7 +445,7 @@ H5S_none_is_valid(const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) +H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -466,12 +465,11 @@ H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_none_serialize(space, p, f) + herr_t H5S_none_serialize(space, p) const H5S_t *space; IN: Dataspace with selection to serialize uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of serialized selection. - H5F_t *f; IN: File pointer RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -483,7 +481,7 @@ H5S_none_serial_size(const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_none_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f) +H5S_none_serialize(const H5S_t *space, uint8_t **p) { uint8_t *pp = (*p); /* Local pointer for decoding */ diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 9219998..3edf4c3 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -50,9 +50,9 @@ #define H5S_ALL_VERSION_1 1 /* Size of point/offset info for H5S_SEL_POINTS/H5S_SEL_HYPER */ -#define H5S_INFO_SIZE_4 0x04 /* 4 bytes: 32 bits */ -#define H5S_INFO_SIZE_8 0x08 /* 8 bytes: 64 bits */ -#define H5S_SELECT_INFO_SIZE_BITS (H5S_INFO_SIZE_4|H5S_INFO_SIZE_8) +#define H5S_SELECT_INFO_ENC_SIZE_4 0x04 /* 4 bytes: 32 bits */ +#define H5S_SELECT_INFO_ENC_SIZE_8 0x08 /* 8 bytes: 64 bits */ +#define H5S_SELECT_INFO_ENC_SIZE_BITS (H5S_SELECT_INFO_ENC_SIZE_4|H5S_SELECT_INFO_ENC_SIZE_8) #define H5S_UINT32_MAX 4294967295 /* 2^32 - 1 */ @@ -159,9 +159,9 @@ typedef herr_t (*H5S_sel_release_func_t)(H5S_t *space); /* Method to determine if current selection is valid for dataspace */ typedef htri_t (*H5S_sel_is_valid_func_t)(const H5S_t *space); /* Method to determine number of bytes required to store current selection */ -typedef hssize_t (*H5S_sel_serial_size_func_t)(const H5S_t *space, H5F_t *f); +typedef hssize_t (*H5S_sel_serial_size_func_t)(const H5S_t *space); /* Method to store current selection in "serialized" form (a byte sequence suitable for storing on disk) */ -typedef herr_t (*H5S_sel_serialize_func_t)(const H5S_t *space, uint8_t **p, H5F_t *f); +typedef herr_t (*H5S_sel_serialize_func_t)(const H5S_t *space, uint8_t **p); /* Method to create selection from "serialized" form (a byte sequence suitable for storing on disk) */ typedef herr_t (*H5S_sel_deserialize_func_t)(H5S_t **space, const uint8_t **p); /* Method to determine smallest n-D bounding box containing the current selection */ @@ -244,7 +244,7 @@ typedef hsize_t (*H5S_sel_iter_nelmts_func_t)(const H5S_sel_iter_t *iter); /* Method to determine if there are more blocks left in the current selection */ typedef htri_t (*H5S_sel_iter_has_next_block_func_t)(const H5S_sel_iter_t *iter); /* Method to move selection iterator to the next element in the selection */ -typedef herr_t (*H5S_sel_iter_next_func_t)(H5S_sel_iter_t *iter, hsize_t nelem); +typedef herr_t (*H5S_sel_iter_next_func_t)(H5S_sel_iter_t *iter, size_t nelem); /* Method to move selection iterator to the next block in the selection */ typedef herr_t (*H5S_sel_iter_next_block_func_t)(H5S_sel_iter_t *iter); /* Method to release iterator for current selection */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 4165ffd..604b58b 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -38,8 +38,8 @@ static herr_t H5S_point_get_seq_list(const H5S_t *space, unsigned flags, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); static herr_t H5S_point_release(H5S_t *space); static htri_t H5S_point_is_valid(const H5S_t *space); -static hssize_t H5S_point_serial_size(const H5S_t *space, H5F_t *f); -static herr_t H5S_point_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); +static hssize_t H5S_point_serial_size(const H5S_t *space); +static herr_t H5S_point_serialize(const H5S_t *space, uint8_t **p); static herr_t H5S_point_deserialize(H5S_t **space, const uint8_t **p); static herr_t H5S_point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S_point_offset(const H5S_t *space, hsize_t *off); @@ -51,6 +51,8 @@ static void H5S_point_adjust_u(H5S_t *space, const hsize_t *offset); static herr_t H5S_point_project_scalar(const H5S_t *space, hsize_t *offset); static herr_t H5S_point_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); static herr_t H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space); +static herr_t + H5S_point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size); /* Selection iteration callbacks */ static herr_t H5S_point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords); @@ -753,20 +755,19 @@ done: /*-------------------------------------------------------------------------- NAME - H5S_point_set_version + H5S_point_get_version_enc_size PURPOSE - Determine the version to use for encoding points selection info + Determine the version and the size (4 bytes) to encode point selection info USAGE - hssize_t H5S_point_set_version(space, bounds_end, f, version) + hssize_t H5S_point_get_version_enc_size(space, uint32_t *version, uint8_t *enc_size const H5S_t *space; IN: The dataspace - hsize_t bounds_end: IN: The selection high bounds - H5F_t *f: IN: The file pointer uint32_t *version: OUT: The version to use for encoding + uint8_t *enc_size: OUT: The size to use for encoding RETURNS - The version to use + The version and the encoded size to use DESCRIPTION - Determine the version to use for encoding points selection info: - For 1.10, return 1 + Determine the version and the encoded size to use for encoding points selection info. + Detect whether the number of points or the high bound exceeds 2^32 -1. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -774,15 +775,20 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_point_set_version(const H5S_t *space, hsize_t bounds_end[], H5F_t *f, uint32_t *version) +H5S_point_get_version_enc_size(const H5S_t *space, uint32_t *version, uint8_t *enc_size) { hbool_t exceed = FALSE; + hsize_t bounds_start[H5S_MAX_RANK]; + hsize_t bounds_end[H5S_MAX_RANK]; unsigned u; herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI_NOINIT - *version = H5S_POINT_VERSION_1; + /* Get bounding box for the selection */ + HDmemset(bounds_end, 0, sizeof(bounds_end)); + if(H5S_point_bounds(space, bounds_start, bounds_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") /* Determine whether the number of points or the high bounds in the selection exceed (2^32 - 1) */ for(u = 0; u < space->extent.rank; u++) @@ -796,47 +802,12 @@ H5S_point_set_version(const H5S_t *space, hsize_t bounds_end[], H5F_t *f, uint32 else if(exceed) HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "The end of bounding box in point selection exceeds 2^32") + *version = H5S_POINT_VERSION_1; + *enc_size = H5S_SELECT_INFO_ENC_SIZE_4; + done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5S_point_set_version() */ - - -/*-------------------------------------------------------------------------- - NAME - H5S_point_set_info_size - PURPOSE - Determine the size of point info to use for encoding selection info - USAGE - hssize_t H5S_point_set_info_size(space, bounds_end, version, point_size) - const H5S_t *space: IN: Dataspace ID of selection to query - hsize_t bounds_end[]: IN: The selection high bounds - uint32_t version: IN: The version used for encoding - uint8_t *point_size: OUT: The size of point info - RETURNS - The size of the points selection info - DESCRIPTION - Determine the size for encoding points selection info: - For 1.10, return 4 - - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5S_point_set_info_size(const H5S_t *space, hsize_t H5_ATTR_UNUSED bounds_end[], uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED *point_size) -{ - hsize_t max_size = 0; - unsigned u; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(version == H5S_POINT_VERSION_1); - - *point_size = H5S_INFO_SIZE_4; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5S_point_set_info_size() */ +} /* H5S_point_get_version_enc_size() */ /*-------------------------------------------------------------------------- @@ -846,9 +817,8 @@ H5S_point_set_info_size(const H5S_t *space, hsize_t H5_ATTR_UNUSED bounds_end[], Determine the number of bytes needed to store the serialized point selection information. USAGE - hssize_t H5S_point_serial_size(space, f) + hssize_t H5S_point_serial_size(space) H5S_t *space; IN: Dataspace pointer to query - H5F_t *f; IN: File pointer RETURNS The number of bytes required on success, negative on an error. DESCRIPTION @@ -860,34 +830,23 @@ H5S_point_set_info_size(const H5S_t *space, hsize_t H5_ATTR_UNUSED bounds_end[], REVISION LOG --------------------------------------------------------------------------*/ static hssize_t -H5S_point_serial_size (const H5S_t *space, H5F_t *f) +H5S_point_serial_size (const H5S_t *space) { H5S_pnt_node_t *curr; /* Point information nodes */ - hsize_t bounds_start[H5S_MAX_RANK]; - hsize_t bounds_end[H5S_MAX_RANK]; uint32_t version; /* Version number */ - uint8_t point_size; /* Size of point info */ + uint8_t enc_size; /* Size of point info */ hssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(space); - /* Get bounding box for the selection */ - HDmemset(bounds_end, 0, sizeof(bounds_end)); - if(H5S_point_bounds(space, bounds_start, bounds_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") - /* Determine the version */ - if(H5S_point_set_version(space, bounds_end, f, &version) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") - - /* Determine the size of point info */ - if(H5S_point_set_info_size(space, bounds_end, version, &point_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") + if(H5S_point_get_version_enc_size(space, &version, &enc_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine version and enc_size") HDassert(version == H5S_POINT_VERSION_1); - HDassert(point_size == H5S_INFO_SIZE_4); + HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4); /* Basic number of bytes required to serialize point selection: */ /* @@ -896,14 +855,14 @@ H5S_point_serial_size (const H5S_t *space, H5F_t *f) */ ret_value=20; - /* <num points (depend on point_size)> */ - ret_value += point_size; + /* <num points (depend on enc_size)> */ + ret_value += enc_size; /* Count points in selection */ curr=space->select.sel_info.pnt_lst->head; while(curr!=NULL) { - /* Add <point_size> bytes times the rank for each element selected */ - ret_value += point_size * space->extent.rank; + /* Add <enc_size> bytes times the rank for each element selected */ + ret_value += enc_size * space->extent.rank; curr = curr->next; } /* end while */ @@ -918,12 +877,11 @@ done: PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_point_serialize(space, p, f) + herr_t H5S_point_serialize(space, p) const H5S_t *space; IN: Dataspace with selection to serialize uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of serialized selection. - H5F_t *f; IN: File pointer RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -935,7 +893,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_point_serialize (const H5S_t *space, uint8_t **p, H5F_t *f) +H5S_point_serialize (const H5S_t *space, uint8_t **p) { H5S_pnt_node_t *curr; /* Point information nodes */ uint8_t *pp; /* Local pointer for encoding */ @@ -943,9 +901,7 @@ H5S_point_serialize (const H5S_t *space, uint8_t **p, H5F_t *f) uint32_t len=0; /* number of bytes used */ unsigned u; /* local counting variable */ uint32_t version; /* Version number */ - uint8_t point_size; /* Size of point info */ - hsize_t bounds_start[H5S_MAX_RANK]; - hsize_t bounds_end[H5S_MAX_RANK]; + uint8_t enc_size; /* Size of point info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -956,20 +912,11 @@ H5S_point_serialize (const H5S_t *space, uint8_t **p, H5F_t *f) pp = (*p); HDassert(pp); - /* Get bounding box for the selection */ - HDmemset(bounds_end, 0, sizeof(bounds_end)); - if(H5S_point_bounds(space, bounds_start, bounds_end) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") - /* Determine the version */ - if(H5S_point_set_version(space, bounds_end, f, &version) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") - - /* Determine the size of point info */ - if(H5S_point_set_info_size(space, bounds_end, version, &point_size) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version") + if(H5S_point_get_version_enc_size(space, &version, &enc_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine version and enc_size") - HDassert(point_size == H5S_INFO_SIZE_4); + HDassert(enc_size == H5S_SELECT_INFO_ENC_SIZE_4); HDassert(version == H5S_POINT_VERSION_1); /* Store the preamble information */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index e46c43b..cbdd208 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -149,8 +149,8 @@ typedef struct H5S_sel_iter_op_t { #define H5S_SELECT_GET_SEQ_LIST(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) ((*(S)->select.type->get_seq_list)(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN)) #define H5S_SELECT_VALID(S) ((*(S)->select.type->is_valid)(S)) #define H5S_SELECT_RELEASE(S) ((*(S)->select.type->release)(S)) -#define H5S_SELECT_SERIAL_SIZE(S,F) ((*(S)->select.type->serial_size)(S,F)) -#define H5S_SELECT_SERIALIZE(S,BUF,F) ((*(S)->select.type->serialize)(S,BUF,F)) +#define H5S_SELECT_SERIAL_SIZE(S) ((*(S)->select.type->serial_size)(S)) +#define H5S_SELECT_SERIALIZE(S,BUF) ((*(S)->select.type->serialize)(S,BUF)) #define H5S_SELECT_BOUNDS(S,START,END) ((*(S)->select.type->bounds)(S,START,END)) #define H5S_SELECT_OFFSET(S, OFFSET) ((*(S)->select.type->offset)(S, OFFSET)) #define H5S_SELECT_IS_CONTIGUOUS(S) ((*(S)->select.type->is_contiguous)(S)) @@ -175,8 +175,8 @@ typedef struct H5S_sel_iter_op_t { #define H5S_SELECT_GET_SEQ_LIST(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN) (H5S_select_get_seq_list(S,FLAGS,ITER,MAXSEQ,MAXBYTES,NSEQ,NBYTES,OFF,LEN)) #define H5S_SELECT_VALID(S) (H5S_select_valid(S)) #define H5S_SELECT_RELEASE(S) (H5S_select_release(S)) -#define H5S_SELECT_SERIAL_SIZE(S,F) (H5S_select_serial_size(S,F)) -#define H5S_SELECT_SERIALIZE(S,BUF,F) (H5S_select_serialize(S,BUF,F)) +#define H5S_SELECT_SERIAL_SIZE(S) (H5S_select_serial_size(S)) +#define H5S_SELECT_SERIALIZE(S,BUF) (H5S_select_serialize(S,BUF)) #define H5S_SELECT_BOUNDS(S,START,END) (H5S_get_select_bounds(S,START,END)) #define H5S_SELECT_OFFSET(S, OFFSET) (H5S_get_select_offset(S, OFFSET)) #define H5S_SELECT_IS_CONTIGUOUS(S) (H5S_select_is_contiguous(S)) @@ -220,7 +220,7 @@ H5_DLL herr_t H5S_get_validated_dataspace(hid_t space_id, const H5S_t **space/*o H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t maxdims[/*rank*/]); H5_DLL herr_t H5S_set_version(H5F_t *f, H5S_t *ds); -H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id); +H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc); H5_DLL H5S_t *H5S_decode(const unsigned char **p); H5_DLL herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth); @@ -255,8 +255,8 @@ H5_DLL herr_t H5S_select_release(H5S_t *ds); H5_DLL herr_t H5S_select_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); -H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space, H5F_t *f); -H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f); +H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space); +H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t **p); H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space); H5_DLL htri_t H5S_select_is_single(const H5S_t *space); H5_DLL htri_t H5S_select_is_regular(const H5S_t *space); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index d52d5ff..6b10811 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -223,7 +223,7 @@ done: *------------------------------------------------------------------------- */ hssize_t -H5S_select_serial_size(const H5S_t *space, H5F_t *f) +H5S_select_serial_size(const H5S_t *space) { hssize_t ret_value = -1; /* Return value */ @@ -232,7 +232,7 @@ H5S_select_serial_size(const H5S_t *space, H5F_t *f) HDassert(space); /* Call the selection type's serial_size function */ - ret_value=(*space->select.type->serial_size)(space, f); + ret_value=(*space->select.type->serial_size)(space); FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_serial_size() */ @@ -249,7 +249,6 @@ H5S_select_serial_size(const H5S_t *space, H5F_t *f) uint8_t **p; OUT: Pointer to buffer to put serialized selection. Will be advanced to end of serialized selection. - H5F_t *f; IN: File pointer RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -264,7 +263,7 @@ H5S_select_serial_size(const H5S_t *space, H5F_t *f) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f) +H5S_select_serialize(const H5S_t *space, uint8_t **p) { herr_t ret_value=SUCCEED; /* Return value */ @@ -274,7 +273,7 @@ H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f) HDassert(p); /* Call the selection type's serialize function */ - ret_value=(*space->select.type->serialize)(space,p,f); + ret_value=(*space->select.type->serialize)(space,p); FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_serialize() */ @@ -2961,7 +2961,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) FUNC_ENTER_NOAPI_NOINIT /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc((uint8_t)0, H5P_FILE_ACCESS_DEFAULT))) + if(NULL == (f = H5F_fake_alloc((uint8_t)0))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "can't allocate fake file struct") /* Find out the size of buffer needed */ @@ -3016,7 +3016,7 @@ H5T_decode(size_t buf_size, const unsigned char *buf) FUNC_ENTER_NOAPI_NOINIT /* Allocate "fake" file structure */ - if(NULL == (f = H5F_fake_alloc((uint8_t)0, H5P_FILE_ACCESS_DEFAULT))) + if(NULL == (f = H5F_fake_alloc((uint8_t)0))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") /* Decode the type of the information */ @@ -619,9 +619,8 @@ test_api(test_api_config_t config, hid_t fapl) /* Get examination DCPL */ - - /* Should be a value of 174, not 213. HDFFV-10469 */ - if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)174) < 0) + /* Correct previous fix for HDFFV-10469 */ + if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)213) < 0) TEST_ERROR /* Test H5Pget_virtual_count */ |