diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-07-30 02:55:33 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-07-30 02:55:33 (GMT) |
commit | 238950487f6348544b64fda3143479c6ab589fde (patch) | |
tree | e2985b88137935511547333d9a9c2c25d74c57e5 /src | |
parent | 7c22743e8eaa5e5d2ffc8b0db7518ed6c5be40ee (diff) | |
download | hdf5-238950487f6348544b64fda3143479c6ab589fde.zip hdf5-238950487f6348544b64fda3143479c6ab589fde.tar.gz hdf5-238950487f6348544b64fda3143479c6ab589fde.tar.bz2 |
[svn-r17270] Description:
Bring r17265:17269 from trunk to revise_chunks branch
Tested on
FreeBSD/32 6.3 (duty)
(h5committest not required on this branch)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B2int.c | 4 | ||||
-rw-r--r-- | src/H5Bdbg.c | 4 | ||||
-rw-r--r-- | src/H5Dcompact.c | 6 | ||||
-rw-r--r-- | src/H5Dint.c | 2 | ||||
-rw-r--r-- | src/H5Dlayout.c | 205 | ||||
-rw-r--r-- | src/H5Dpkg.h | 4 | ||||
-rw-r--r-- | src/H5Gint.c | 11 | ||||
-rw-r--r-- | src/H5HFtiny.c | 2 | ||||
-rw-r--r-- | src/H5Oattr.c | 2 | ||||
-rw-r--r-- | src/H5Ocache.c | 14 | ||||
-rw-r--r-- | src/H5Ofill.c | 4 | ||||
-rw-r--r-- | src/H5Olayout.c | 211 | ||||
-rw-r--r-- | src/H5Olink.c | 2 | ||||
-rw-r--r-- | src/H5Oprivate.h | 5 | ||||
-rw-r--r-- | src/H5SL.c | 2 | ||||
-rwxr-xr-x | src/H5SM.c | 2 | ||||
-rw-r--r-- | src/H5SMcache.c | 2 | ||||
-rw-r--r-- | src/H5T.c | 4 | ||||
-rw-r--r-- | src/H5Zscaleoffset.c | 6 |
19 files changed, 248 insertions, 244 deletions
diff --git a/src/H5B2int.c b/src/H5B2int.c index f0213ce..550a5b6 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -3211,8 +3211,6 @@ done: static herr_t H5B2_assert_leaf(H5B2_shared_t *shared, H5B2_leaf_t *leaf) { - unsigned u,v; /* Local index variables */ - /* General sanity checking on node */ HDassert(leaf->nrec<=shared->node_info->split_nrec); @@ -3236,8 +3234,6 @@ H5B2_assert_leaf(H5B2_shared_t *shared, H5B2_leaf_t *leaf) static herr_t H5B2_assert_leaf2(H5B2_shared_t *shared, H5B2_leaf_t *leaf, H5B2_leaf_t *leaf2) { - unsigned u,v; /* Local index variables */ - /* General sanity checking on node */ HDassert(leaf->nrec<=shared->node_info->split_nrec); diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index f517daf..c31b4c3 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -36,6 +36,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /*------------------------------------------------------------------------- @@ -190,7 +191,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void struct child_t *next; } *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL; - FUNC_ENTER_NOAPI(H5B_assert, FAIL) + FUNC_ENTER_NOAPI_NOFUNC(H5B_assert) if (0==ncalls++) { if (H5DEBUG(B)) { @@ -277,7 +278,6 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void head = tmp; } -done: FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5B_DEBUG */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 7639c2e..17bf531 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -172,7 +172,7 @@ static herr_t H5D_compact_construct(H5F_t *f, H5D_t *dset) { hssize_t tmp_size; /* Temporary holder for raw data size */ - hsize_t comp_data_size; /* Size of compact data */ + hsize_t max_comp_data_size; /* Max. allowed size of compact data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_compact_construct) @@ -191,8 +191,8 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset) /* Verify data size is smaller than maximum header message size * (64KB) minus other layout message fields. */ - comp_data_size = H5O_MESG_MAX_SIZE - H5O_layout_meta_size(f, &(dset->shared->layout)); - if(dset->shared->layout.store.u.compact.size > comp_data_size) + max_comp_data_size = H5O_MESG_MAX_SIZE - H5D_layout_meta_size(f, &(dset->shared->layout), FALSE); + if(dset->shared->layout.store.u.compact.size > max_comp_data_size) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "compact dataset size is bigger than header message maximum size") done: diff --git a/src/H5Dint.c b/src/H5Dint.c index dd28772..91156e6 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1018,7 +1018,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") /* Set the latest version for the layout message */ - if(H5O_layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space) < 0) + if(H5D_layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") } /* end if */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 82201d2..368bd95 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -129,6 +129,211 @@ done: /*------------------------------------------------------------------------- + * Function: H5D_layout_meta_size + * + * Purpose: Returns the size of the raw message in bytes except raw data + * part for compact dataset. This function doesn't take into + * account message alignment. + * + * Return: Success: Message data size in bytes + * Failure: 0 + * + * Programmer: Raymond Lu + * August 14, 2002 + * + *------------------------------------------------------------------------- + */ +size_t +H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data) +{ + size_t ret_value; + + FUNC_ENTER_NOAPI_NOINIT(H5D_layout_meta_size) + + /* check args */ + HDassert(f); + HDassert(layout); + + ret_value = 1 + /* Version number */ + 1; /* layout class type */ + + switch(layout->type) { + case H5D_COMPACT: + /* Size of raw data */ + ret_value += 2; + if(include_compact_data) + ret_value += layout->store.u.compact.size;/* data for compact dataset */ + break; + + case H5D_CONTIGUOUS: + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ + break; + + case H5D_CHUNKED: + if(layout->version < H5O_LAYOUT_VERSION_4) { + /* Number of dimensions (1 byte) */ + HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + ret_value++; + + /* B-tree address */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + + /* Dimension sizes */ + ret_value += layout->u.chunk.ndims * 4; + } /* end if */ + else { + /* Chunked layout feature flags */ + ret_value++; + + /* Number of dimensions (1 byte) */ + HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + ret_value++; + + /* Encoded # of bytes for each chunk dimension */ + HDassert(layout->u.chunk.enc_bytes_per_dim > 0 && layout->u.chunk.enc_bytes_per_dim <= 8); + ret_value++; + + /* Dimension sizes */ + ret_value += layout->u.chunk.ndims * layout->u.chunk.enc_bytes_per_dim; + + /* Type of chunk index */ + ret_value++; + + switch(layout->u.chunk.idx_type) { + case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */ + /* B-tree address */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + break; + + case H5D_CHUNK_IDX_FARRAY: + /* Fixed array creation parameters */ + ret_value += 1; + + /* Fixed array header address */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + break; + + case H5D_CHUNK_IDX_EARRAY: + /* Extensible array creation parameters */ + ret_value += 5; + + /* Extensible array header address */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + break; + + default: + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid chunk index type") + } /* end switch */ + } /* end else */ + break; + + default: + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid layout class") + } /* end switch */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_layout_meta_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_layout_set_latest_version + * + * Purpose: Set the encoding for a layout to the latest version. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Thursday, January 15, 2009 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space) +{ + int sndims; /* Rank of dataspace */ + unsigned ndims; /* Rank of dataspace */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5D_layout_set_latest_version, FAIL) + + /* Sanity check */ + HDassert(layout); + + /* Set encoding of layout to latest version */ + layout->version = H5O_LAYOUT_VERSION_LATEST; + + /* Query the dimensionality of the dataspace */ + if((sndims = H5S_GET_EXTENT_NDIMS(space)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "invalid dataspace rank") + ndims = (unsigned)sndims; + + /* Avoid scalar/null dataspace */ + if(ndims > 0) { + hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Maximum dimension sizes */ + hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */ + unsigned unlim_count; /* Count of unlimited max. dimensions */ + hbool_t fixed = FALSE; /* Fixed dimension or not */ + unsigned u; /* Local index variable */ + + /* Query the dataspace's dimensions */ + if(H5S_get_simple_extent_dims(space, curr_dims, max_dims) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get dataspace max. dimensions") + + /* Spin through the max. dimensions, looking for unlimited dimensions */ + unlim_count = 0; + for(u = 0; u < ndims; u++) + if(max_dims[u] == H5S_UNLIMITED) + unlim_count++; + + /* Check if it is fixed dimension */ + if(0 == unlim_count) { + fixed = TRUE; + for(u = 0; u < ndims; u++) + if(curr_dims[u] != max_dims[u]) { + fixed = FALSE; + break; + } /* end if */ + } /* end if */ + + /* If we have only 1 unlimited dimension, we can use extensible array index */ + if(1 == unlim_count) { + /* Set the chunk index type to an extensible array */ + layout->u.chunk.idx_type = H5D_CHUNK_IDX_EARRAY; + + /* Set the extensible array creation parameters */ + /* (use hard-coded defaults for now, until we give applications + * control over this with a property list - QAK) + */ + layout->u.chunk.u.earray.cparam.max_nelmts_bits = H5D_EARRAY_MAX_NELMTS_BITS; + layout->u.chunk.u.earray.cparam.idx_blk_elmts = H5D_EARRAY_IDX_BLK_ELMTS; + layout->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs = H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS; + layout->u.chunk.u.earray.cparam.data_blk_min_elmts = H5D_EARRAY_DATA_BLK_MIN_ELMTS; + layout->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits = H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS; + } /* end if */ + /* Chunked datasets with fixed dimensions */ + else if(layout->type == H5D_CHUNKED && fixed) { + /* Set the chunk index type to a fixed array */ + layout->u.chunk.idx_type = H5D_CHUNK_IDX_FARRAY; + + /* Set the fixed array creation parameters */ + /* (use hard-coded defaults for now, until we give applications + * control over this with a property list - QAK) + */ + layout->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS; + } /* end if */ + else { + /* Add setup for v2 B-tree indices here */ + } /* end else */ + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_layout_set_latest_version() */ + + +/*------------------------------------------------------------------------- * Function: H5D_layout_oh_create * * Purpose: Create layout/pline/efl information for dataset diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 4931bd8..925f6e0 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -590,6 +590,10 @@ H5_DLL herr_t H5D_scatgath_write(const H5D_io_info_t *io_info, /* Functions that operate on dataset's layout information */ H5_DLL herr_t H5D_layout_set_io_ops(const H5D_t *dataset); +H5_DLL size_t H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, + hbool_t include_compact_data); +H5_DLL herr_t H5D_layout_set_latest_version(H5O_layout_t *layout, + const H5S_t *space); H5_DLL herr_t H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hid_t dapl_id); H5_DLL herr_t H5D_layout_oh_read(H5D_t *dset, hid_t dxpl_id, hid_t dapl_id, diff --git a/src/H5Gint.c b/src/H5Gint.c index 61598c2..0dc9c03 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -94,9 +94,16 @@ DESCRIPTION static herr_t H5G_init_int_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_init_int_interface) + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_LEAVE_NOAPI(H5G_init()) + FUNC_ENTER_NOAPI(H5G_init_int_interface, FAIL) + + /* Funnel all work to H5G_init() */ + if(H5G_init() < 0) + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "interface initialization failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5G_init_int_interface() */ diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 5f5b295..ce91bd1 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -291,7 +291,7 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "application's callback failed") done: - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_tiny_op_real() */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index c474681..971c514 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -171,7 +171,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_fl * as well as some reserved bytes. */ if(attr->shared->version >= H5O_ATTR_VERSION_3) - attr->shared->encoding = *p++; + attr->shared->encoding = (H5T_cset_t)*p++; /* Decode and store the name */ if(NULL == (attr->shared->name = H5MM_strdup((const char *)p))) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 6c86681..d396896 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -187,10 +187,16 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, /* Time fields */ if(oh->flags & H5O_HDR_STORE_TIMES) { - UINT32DECODE(p, oh->atime); - UINT32DECODE(p, oh->mtime); - UINT32DECODE(p, oh->ctime); - UINT32DECODE(p, oh->btime); + uint32_t tmp; /* Temporary value */ + + UINT32DECODE(p, tmp); + oh->atime = (time_t)tmp; + UINT32DECODE(p, tmp); + oh->mtime = (time_t)tmp; + UINT32DECODE(p, tmp); + oh->ctime = (time_t)tmp; + UINT32DECODE(p, tmp); + oh->btime = (time_t)tmp; } /* end if */ else oh->atime = oh->mtime = oh->ctime = oh->btime = 0; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index d5345aa..8cf901f 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -236,10 +236,10 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "unknown flag for fill value message") /* Space allocation time */ - fill->alloc_time = (flags >> H5O_FILL_SHIFT_ALLOC_TIME) & H5O_FILL_MASK_ALLOC_TIME; + fill->alloc_time = (H5D_alloc_time_t)((flags >> H5O_FILL_SHIFT_ALLOC_TIME) & H5O_FILL_MASK_ALLOC_TIME); /* Fill value write time */ - fill->fill_time = (flags >> H5O_FILL_SHIFT_FILL_TIME) & H5O_FILL_MASK_FILL_TIME; + fill->fill_time = (H5D_fill_time_t)((flags >> H5O_FILL_SHIFT_FILL_TIME) & H5O_FILL_MASK_FILL_TIME); /* Check for undefined fill value */ if(flags & H5O_FILL_FLAG_UNDEFINED_VALUE) { diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 18fd664..be1411d 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -591,9 +591,9 @@ H5O_layout_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg HDassert(f); HDassert(mesg); - ret_value = H5O_layout_meta_size(f, mesg); - if(H5D_COMPACT == mesg->type) - ret_value += mesg->store.u.compact.size;/* data for compact dataset */ + /* Compute serialized size */ + /* (including possibly compact data) */ + ret_value = H5D_layout_meta_size(f, mesg, TRUE); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_layout_size() */ @@ -915,208 +915,3 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_layout_debug() */ - -/*------------------------------------------------------------------------- - * Function: H5O_layout_meta_size - * - * Purpose: Returns the size of the raw message in bytes except raw data - * part for compact dataset. This function doesn't take into - * account message alignment. - * - * Return: Success: Message data size in bytes(except raw data - * for compact dataset) - * Failure: 0 - * - * Programmer: Raymond Lu - * August 14, 2002 - * - *------------------------------------------------------------------------- - */ -size_t -H5O_layout_meta_size(const H5F_t *f, const void *_mesg) -{ - const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; - size_t ret_value; - - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_meta_size) - - /* check args */ - HDassert(f); - HDassert(mesg); - - ret_value = 1 + /* Version number */ - 1; /* layout class type */ - - switch(mesg->type) { - case H5D_COMPACT: - /* Size of raw data */ - ret_value += 2; - break; - - case H5D_CONTIGUOUS: - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ - break; - - case H5D_CHUNKED: - if(mesg->version < H5O_LAYOUT_VERSION_4) { - /* Number of dimensions (1 byte) */ - HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); - ret_value++; - - /* B-tree address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - - /* Dimension sizes */ - ret_value += mesg->u.chunk.ndims * 4; - } /* end if */ - else { - /* Chunked layout feature flags */ - ret_value++; - - /* Number of dimensions (1 byte) */ - HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); - ret_value++; - - /* Encoded # of bytes for each chunk dimension */ - HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8); - ret_value++; - - /* Dimension sizes */ - ret_value += mesg->u.chunk.ndims * mesg->u.chunk.enc_bytes_per_dim; - - /* Type of chunk index */ - ret_value++; - - switch(mesg->u.chunk.idx_type) { - case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */ - /* B-tree address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - break; - - case H5D_CHUNK_IDX_FARRAY: - /* Fixed array creation parameters */ - ret_value += 1; - - /* Fixed array header address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - break; - - case H5D_CHUNK_IDX_EARRAY: - /* Extensible array creation parameters */ - ret_value += 5; - - /* Extensible array header address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - break; - - default: - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid chunk index type") - } /* end switch */ - } /* end else */ - break; - - default: - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid layout class") - } /* end switch */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_layout_meta_size() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_layout_set_latest_version - * - * Purpose: Set the encoding for a layout to the latest version. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, January 15, 2009 - * - *------------------------------------------------------------------------- - */ -herr_t -H5O_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space) -{ - int sndims; /* Rank of dataspace */ - unsigned ndims; /* Rank of dataspace */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5O_layout_set_latest_version, FAIL) - - /* Sanity check */ - HDassert(layout); - - /* Set encoding of layout to latest version */ - layout->version = H5O_LAYOUT_VERSION_LATEST; - - /* Query the dimensionality of the dataspace */ - if((sndims = H5S_GET_EXTENT_NDIMS(space)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "invalid dataspace rank") - ndims = (unsigned)sndims; - - /* Avoid scalar/null dataspace */ - if(ndims > 0) { - hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Maximum dimension sizes */ - hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Current dimension sizes */ - unsigned unlim_count; /* Count of unlimited max. dimensions */ - hbool_t fixed = FALSE; /* Fixed dimension or not */ - unsigned u; /* Local index variable */ - - /* Query the dataspace's dimensions */ - if(H5S_get_simple_extent_dims(space, curr_dims, max_dims) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get dataspace max. dimensions") - - /* Spin through the max. dimensions, looking for unlimited dimensions */ - unlim_count = 0; - for(u = 0; u < ndims; u++) - if(max_dims[u] == H5S_UNLIMITED) - unlim_count++; - - /* Check if it is fixed dimension */ - if(0 == unlim_count) { - fixed = TRUE; - for(u = 0; u < ndims; u++) - if(curr_dims[u] != max_dims[u]) { - fixed = FALSE; - break; - } /* end if */ - } /* end if */ - - /* If we have only 1 unlimited dimension, we can use extensible array index */ - if(1 == unlim_count) { - /* Set the chunk index type to an extensible array */ - layout->u.chunk.idx_type = H5D_CHUNK_IDX_EARRAY; - - /* Set the extensible array creation parameters */ - /* (use hard-coded defaults for now, until we give applications - * control over this with a property list - QAK) - */ - layout->u.chunk.u.earray.cparam.max_nelmts_bits = H5D_EARRAY_MAX_NELMTS_BITS; - layout->u.chunk.u.earray.cparam.idx_blk_elmts = H5D_EARRAY_IDX_BLK_ELMTS; - layout->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs = H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS; - layout->u.chunk.u.earray.cparam.data_blk_min_elmts = H5D_EARRAY_DATA_BLK_MIN_ELMTS; - layout->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits = H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS; - } /* end if */ - /* Chunked datasets with fixed dimensions */ - else if(layout->type == H5D_CHUNKED && fixed) { - /* Set the chunk index type to a fixed array */ - layout->u.chunk.idx_type = H5D_CHUNK_IDX_FARRAY; - - /* Set the fixed array creation parameters */ - /* (use hard-coded defaults for now, until we give applications - * control over this with a property list - QAK) - */ - layout->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS; - } /* end if */ - else { - /* Add setup for v2 B-tree indices here */ - } /* end else */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_layout_set_latest_version() */ - diff --git a/src/H5Olink.c b/src/H5Olink.c index 96d4747..ffe80e7 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -146,7 +146,7 @@ H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, /* Check for non-default link type */ if(link_flags & H5O_LINK_STORE_LINK_TYPE) { /* Get the type of the link */ - lnk->type = *p++; + lnk->type = (H5L_type_t)*p++; if(lnk->type < H5L_TYPE_HARD || lnk->type > H5L_TYPE_MAX) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad link type") } /* end if */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 6a13af9..6edb415 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -722,11 +722,6 @@ H5_DLL herr_t H5O_loc_copy(H5O_loc_t *dst, const H5O_loc_t *src, H5_copy_depth_t H5_DLL herr_t H5O_loc_hold_file(H5O_loc_t *loc); H5_DLL herr_t H5O_loc_free(H5O_loc_t *loc); -/* Layout operators */ -H5_DLL size_t H5O_layout_meta_size(const H5F_t *f, const void *_mesg); -H5_DLL herr_t H5O_layout_set_latest_version(H5O_layout_t *layout, - const struct H5S_t *space); - /* EFL operators */ H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl); @@ -2167,7 +2167,7 @@ int H5SL_term_interface(void) H5SL_fac_nused_g = 0; /* Free the list of factories */ - H5SL_fac_g = (H5FL_reg_head_t **)H5MM_xfree((void *)H5SL_fac_g); + H5SL_fac_g = (H5FL_fac_head_t **)H5MM_xfree((void *)H5SL_fac_g); H5SL_fac_nalloc_g = 0; /* Mark the interface as uninitialized */ @@ -1911,7 +1911,7 @@ H5SM_message_decode(const H5F_t UNUSED *f, const uint8_t *raw, void *_nrecord) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_message_decode) - message->location = *raw++; + message->location = (H5SM_storage_loc_t)*raw++; UINT32DECODE(raw, message->hash); if(message->location == H5SM_IN_HEAP) { diff --git a/src/H5SMcache.c b/src/H5SMcache.c index d53993e..e2aa732 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -188,7 +188,7 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1 HGOTO_ERROR(H5E_FILE, H5E_VERSION, NULL, "bad shared message list version number") /* Type of the index (list or B-tree) */ - table->indexes[x].index_type= *p++; + table->indexes[x].index_type= (H5SM_index_type_t)*p++; /* Type of messages in the index */ UINT16DECODE(p, table->indexes[x].mesg_types); @@ -720,10 +720,8 @@ H5T_init_interface(void) H5T_t *std_u16be=NULL; /* Datatype structure for unsigned 16-bit big-endian integer */ H5T_t *std_u32le=NULL; /* Datatype structure for unsigned 32-bit little-endian integer */ H5T_t *std_u32be=NULL; /* Datatype structure for unsigned 32-bit big-endian integer */ - H5T_t *std_i32le=NULL; /* Datatype structure for signed 32-bit little-endian integer */ H5T_t *std_u64le=NULL; /* Datatype structure for unsigned 64-bit little-endian integer */ H5T_t *std_u64be=NULL; /* Datatype structure for unsigned 64-bit big-endian integer */ - H5T_t *ieee_f64le=NULL; /* Datatype structure for IEEE 64-bit little-endian floating-point */ H5T_t *dt = NULL; H5T_t *fixedpt=NULL; /* Datatype structure for native int */ H5T_t *floatpt=NULL; /* Datatype structure for native float */ @@ -836,7 +834,6 @@ H5T_init_interface(void) /* IEEE 8-byte little-endian float */ H5T_INIT_TYPE(DOUBLELE,H5T_IEEE_F64LE_g,COPY,native_double,SET,8) - ieee_f64le=dt; /* Keep type for later */ /* IEEE 8-byte big-endian float */ H5T_INIT_TYPE(DOUBLEBE,H5T_IEEE_F64BE_g,COPY,native_double,SET,8) @@ -871,7 +868,6 @@ H5T_init_interface(void) /* 4-byte little-endian signed integer */ H5T_INIT_TYPE(SINTLE,H5T_STD_I32LE_g,COPY,native_int,SET,4) - std_i32le=dt; /* Keep type for later */ /* 4-byte big-endian signed integer */ H5T_INIT_TYPE(SINTBE,H5T_STD_I32BE_g,COPY,native_int,SET,4) diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index d59499c..8e32ab7 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -916,7 +916,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu unsigned dtype_class; /* datatype class */ unsigned dtype_sign; /* integer datatype sign */ unsigned filavail; /* flag indicating if fill value is defined or not */ - H5Z_SO_scale_type_t scale_type = 0;/* scale type */ + H5Z_SO_scale_type_t scale_type = H5Z_SO_FLOAT_DSCALE;/* scale type */ int scale_factor = 0; /* scale factor */ double D_val = 0.0; /* decimal scale factor */ uint32_t minbits = 0; /* minimum number of bits to store values */ @@ -955,8 +955,8 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu dtype_class = cd_values[H5Z_SCALEOFFSET_PARM_CLASS]; dtype_sign = cd_values[H5Z_SCALEOFFSET_PARM_SIGN]; filavail = cd_values[H5Z_SCALEOFFSET_PARM_FILAVAIL]; - scale_factor = (int) cd_values[H5Z_SCALEOFFSET_PARM_SCALEFACTOR]; - scale_type = cd_values[H5Z_SCALEOFFSET_PARM_SCALETYPE]; + scale_factor = (int)cd_values[H5Z_SCALEOFFSET_PARM_SCALEFACTOR]; + scale_type = (H5Z_SO_scale_type_t)cd_values[H5Z_SCALEOFFSET_PARM_SCALETYPE]; /* check and assign proper values set by user to related parameters * scale type can be H5Z_SO_FLOAT_DSCALE (0), H5Z_SO_FLOAT_ESCALE (1) or H5Z_SO_INT (other) |