summaryrefslogtreecommitdiffstats
path: root/src/H5EAhdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5EAhdr.c')
-rw-r--r--src/H5EAhdr.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 5fcf2be..3dc5d50 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -131,7 +131,7 @@ H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls))
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
/* Set the class of the array */
- hdr->cls = cls;
+ hdr->cparam.cls = cls;
/* Set the return value */
ret_value = hdr;
@@ -191,12 +191,12 @@ H5EA__hdr_init(H5EA_hdr_t *hdr))
/* Sanity check */
HDassert(hdr);
- HDassert(hdr->max_nelmts_bits);
- HDassert(hdr->data_blk_min_elmts);
- HDassert(hdr->sup_blk_min_data_ptrs);
+ HDassert(hdr->cparam.max_nelmts_bits);
+ HDassert(hdr->cparam.data_blk_min_elmts);
+ HDassert(hdr->cparam.sup_blk_min_data_ptrs);
/* Compute general information */
- hdr->nsblks = 1 + (hdr->max_nelmts_bits - H5V_log2_of2(hdr->data_blk_min_elmts));
+ hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5V_log2_of2(hdr->cparam.data_blk_min_elmts));
#ifdef QAK
HDfprintf(stderr, "%s: hdr->nsblks = %Zu\n", FUNC, hdr->nsblks);
#endif /* QAK */
@@ -210,7 +210,7 @@ HDfprintf(stderr, "%s: hdr->nsblks = %Zu\n", FUNC, hdr->nsblks);
start_dblk = 0;
for(u = 0; u < hdr->nsblks; u++) {
hdr->sblk_info[u].ndblks = (hsize_t)H5_EXP2(u / 2);
- hdr->sblk_info[u].dblk_nelmts = (size_t)H5_EXP2((u + 1) / 2) * hdr->data_blk_min_elmts;
+ hdr->sblk_info[u].dblk_nelmts = (size_t)H5_EXP2((u + 1) / 2) * hdr->cparam.data_blk_min_elmts;
hdr->sblk_info[u].start_idx = start_idx;
hdr->sblk_info[u].start_dblk = start_dblk;
#ifdef QAK
@@ -257,7 +257,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->data_blk_min_elmts);
+ idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
#ifdef QAK
HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
#endif /* QAK */
@@ -281,7 +281,7 @@ HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n",
/* Check for un-initialized factory at index */
if(NULL == hdr->elmt_fac.fac[idx]) {
- if(NULL == (hdr->elmt_fac.fac[idx] = H5FL_fac_init(nelmts * (size_t)hdr->cls->nat_elmt_size)))
+ if(NULL == (hdr->elmt_fac.fac[idx] = H5FL_fac_init(nelmts * (size_t)hdr->cparam.cls->nat_elmt_size)))
H5E_THROW(H5E_CANTINIT, "can't create data block data element buffer factory")
} /* end if */
@@ -327,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->data_blk_min_elmts);
+ idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
#ifdef QAK
HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
#endif /* QAK */
@@ -392,18 +392,14 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
hdr->idx_blk_addr = HADDR_UNDEF;
/* Set the creation parameters for the array */
- hdr->raw_elmt_size = cparam->raw_elmt_size;
- hdr->max_nelmts_bits = cparam->max_nelmts_bits;
- hdr->idx_blk_elmts = cparam->idx_blk_elmts;
- hdr->sup_blk_min_data_ptrs = cparam->sup_blk_min_data_ptrs;
- hdr->data_blk_min_elmts = cparam->data_blk_min_elmts;
+ HDmemcpy(&hdr->cparam, cparam, sizeof(hdr->cparam));
/* Finish initializing extensible array header */
if(H5EA__hdr_init(hdr) < 0)
H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
/* Allocate space for the header on disk */
- if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, hdr->size)))
+ if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, (hsize_t)hdr->size)))
H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header")
/* Cache the new extensible array header */