summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5Ffake.c11
-rw-r--r--src/H5Fprivate.h2
-rw-r--r--src/H5Olayout.c22
-rw-r--r--src/H5P.c9
-rw-r--r--src/H5Shyper.c2
-rw-r--r--testpar/t_cache_image.c4
6 files changed, 32 insertions, 18 deletions
diff --git a/src/H5Ffake.c b/src/H5Ffake.c
index 6072f2e..6720dd2 100644
--- a/src/H5Ffake.c
+++ b/src/H5Ffake.c
@@ -40,9 +40,10 @@
*-------------------------------------------------------------------------
*/
H5F_t *
-H5F_fake_alloc(uint8_t sizeof_size)
+H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id)
{
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)
@@ -59,6 +60,14 @@ H5F_fake_alloc(uint8_t sizeof_size)
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")
+
+ f->shared->low_bound = H5F_LOW_BOUND(f);
+ f->shared->high_bound = H5F_HIGH_BOUND(f);
+
/* Set return value */
ret_value = f;
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 856e618..dadbbac 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);
+H5_DLL H5F_t *H5F_fake_alloc(uint8_t sizeof_size, hid_t fapl_id);
H5_DLL herr_t H5F_fake_free(H5F_t *f);
/* Superblock related routines */
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 1a21926..0994ef8 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -39,7 +39,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O__layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
- unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
+ unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg);
static void *H5O__layout_copy(const void *_mesg, void *_dest);
static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg);
@@ -99,7 +99,8 @@ H5FL_DEFINE(H5O_layout_t);
*/
static void *
H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh,
- unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p)
+ unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags,
+ size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5O_layout_t *mesg = NULL;
uint8_t *heap_block = NULL;
@@ -549,11 +550,11 @@ done:
static herr_t
H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg)
{
- const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
- uint8_t *heap_block = NULL;
+ const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
+ uint8_t *heap_block = NULL;
size_t *str_size = NULL;
- unsigned u;
- unsigned saved_latest_flags = H5F_GET_LATEST_FLAGS(f);
+ unsigned u;
+ H5F_libver_t saved_low, saved_high;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -570,6 +571,9 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
/* Layout class */
*p++ = mesg->type;
+ saved_low = H5F_LOW_BOUND(f);
+ saved_high = H5F_HIGH_BOUND(f);
+
/* Write out layout class specific information */
switch(mesg->type) {
case H5D_COMPACT:
@@ -691,7 +695,8 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
uint32_t chksum;
size_t i;
- H5F_SET_LATEST_FLAGS(f, H5F_LATEST_ALL_FLAGS);
+ if(H5F_set_libver_bounds(f, H5F_LIBVER_V110, H5F_LIBVER_V110) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "cannot set low/high bounds")
/* Allocate array for caching results of strlen */
if(NULL == (str_size = (size_t *)H5MM_malloc(2 * mesg->storage.u.virt.list_nused *sizeof(size_t))))
@@ -789,7 +794,8 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
} /* end switch */
done:
- H5F_SET_LATEST_FLAGS(f, saved_latest_flags);
+ if(H5F_set_libver_bounds(f, saved_low, saved_high) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "cannot reset low/high bounds")
heap_block = (uint8_t *)H5MM_xfree(heap_block);
str_size = (size_t *)H5MM_xfree(str_size);
diff --git a/src/H5P.c b/src/H5P.c
index 25608aa..4dcd305 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -842,7 +842,8 @@ 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;
- hbool_t latest_format = TRUE;
+ H5F_libver_t low_bound = H5F_LIBVER_V110;
+ H5F_libver_t high_bound = H5F_LIBVER_V110;
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
@@ -860,8 +861,10 @@ H5Pencode(hid_t plist_id, void *buf, size_t *nalloc)
/* Set latest format in fapl_plist */
/* This will eventually be used by VDS to encode datasets via H5P__dcrt_layout_enc() */
- if(H5P_set(fapl_plist, H5F_ACS_LATEST_FORMAT_NAME, &latest_format) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag")
+ 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")
/* Call the internal encode routine */
if((ret_value = H5P__encode(plist, TRUE, buf, nalloc, new_fapl_id)) < 0)
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 71bfa51..6f778fe 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -2039,7 +2039,7 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en
}
if(H5S_hyper_is_regular(space)) {
- if((H5F_USE_LATEST_FLAGS(f, H5F_LATEST_DATASPACE_SELECTION) && block_count > 4) ||
+ if(((H5F_LOW_BOUND(f) >= H5F_LIBVER_V110) && block_count > 4) ||
count_up_version || bound_up_version)
*version = H5S_HYPER_VERSION_2;
} else { /* Fail for irregular hyperslab if exceeds 32 bits */
diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c
index fc88c61..5b512d6 100644
--- a/testpar/t_cache_image.c
+++ b/testpar/t_cache_image.c
@@ -1915,10 +1915,6 @@ par_delete_dataset(int dset_num,
*
* None.
*
- *--------------------------------------
- return;
-
-} /* par_insert_cache_image() */
*-------------------------------------------------------------------------
*/