diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-06-17 11:48:34 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-06-17 11:48:34 (GMT) |
commit | fb27787c2abb889a2184bb39eead626a144117d0 (patch) | |
tree | 7ad16361ac8b2382f0ccf72ce47aae020fed688c /src/H5B2hdr.c | |
parent | 984ecb72c2fa62d233383b24047e04061754ae34 (diff) | |
parent | 6e9e9e0dd200979642de8d2a2bce2f66f9728237 (diff) | |
download | hdf5-fb27787c2abb889a2184bb39eead626a144117d0.zip hdf5-fb27787c2abb889a2184bb39eead626a144117d0.tar.gz hdf5-fb27787c2abb889a2184bb39eead626a144117d0.tar.bz2 |
[svn-r27222] Merge of r27035-27221 from the trunk.
Tested on 64-bit linux VM:
Serial: C++ and Fortran 2003
Parallel: Fortran
Diffstat (limited to 'src/H5B2hdr.c')
-rw-r--r-- | src/H5B2hdr.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 452a35d..d873cf6 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -94,7 +94,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); /*------------------------------------------------------------------------- - * Function: H5B2_hdr_init + * Function: H5B2__hdr_init * * Purpose: Allocate & initialize B-tree header info * @@ -107,7 +107,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t); *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, +H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, uint16_t depth) { size_t sz_max_nrec; /* Temporary variable for range checking */ @@ -115,7 +115,7 @@ H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -160,7 +160,7 @@ HDmemset(hdr->page, 0, hdr->node_size); /* Initialize leaf node info */ sz_max_nrec = H5B2_NUM_LEAF_REC(hdr->node_size, hdr->rrec_size); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[0].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned) + H5_CHECKED_ASSIGN(hdr->node_info[0].max_nrec, unsigned, sz_max_nrec, size_t) hdr->node_info[0].split_nrec = (hdr->node_info[0].max_nrec * hdr->split_percent) / 100; hdr->node_info[0].merge_nrec = (hdr->node_info[0].max_nrec * hdr->merge_percent) / 100; hdr->node_info[0].cum_max_nrec = hdr->node_info[0].max_nrec; @@ -182,14 +182,14 @@ HDmemset(hdr->page, 0, hdr->node_size); /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) + H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned) HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); /* Initialize internal node info */ if(depth > 0) { for(u = 1; u < (unsigned)(depth + 1); u++) { sz_max_nrec = H5B2_NUM_INT_REC(hdr, u); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned) + H5_CHECKED_ASSIGN(hdr->node_info[u].max_nrec, unsigned, sz_max_nrec, size_t) HDassert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec); hdr->node_info[u].split_nrec = (hdr->node_info[u].max_nrec * hdr->split_percent) / 100; @@ -198,7 +198,7 @@ HDmemset(hdr->page, 0, hdr->node_size); hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) * hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec; u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) + H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned) if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec))) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't create node native key block factory") @@ -215,15 +215,15 @@ HDmemset(hdr->page, 0, hdr->node_size); done: if(ret_value < 0) - if(H5B2_hdr_free(hdr) < 0) + if(H5B2__hdr_free(hdr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free shared v2 B-tree info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_init() */ +} /* end H5B2__hdr_init() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_alloc + * Function: H5B2__hdr_alloc * * Purpose: Allocate B-tree header * @@ -236,12 +236,12 @@ done: *------------------------------------------------------------------------- */ H5B2_hdr_t * -H5B2_hdr_alloc(H5F_t *f) +H5B2__hdr_alloc(H5F_t *f) { H5B2_hdr_t *hdr = NULL; /* v2 B-tree header */ H5B2_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -256,7 +256,7 @@ H5B2_hdr_alloc(H5F_t *f) hdr->f = f; hdr->sizeof_addr = H5F_SIZEOF_ADDR(f); hdr->sizeof_size = H5F_SIZEOF_SIZE(f); - hdr->hdr_size = H5B2_HEADER_SIZE(hdr); + hdr->hdr_size = H5B2_HEADER_SIZE_HDR(hdr); hdr->root.addr = HADDR_UNDEF; /* Set return value */ @@ -265,11 +265,11 @@ H5B2_hdr_alloc(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_alloc() */ +} /* end H5B2__hdr_alloc() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_create + * Function: H5B2__hdr_create * * Purpose: Create new fractal heap header * @@ -282,13 +282,13 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, +H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -297,11 +297,11 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HDassert(cparam); /* Allocate v2 B-tree header */ - if(NULL == (hdr = H5B2_hdr_alloc(f))) + if(NULL == (hdr = H5B2__hdr_alloc(f))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header") /* Initialize shared B-tree info */ - if(H5B2_hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0) + if(H5B2__hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info") /* Allocate space for the header on disk */ @@ -317,15 +317,15 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, done: if(!H5F_addr_defined(ret_value) && hdr) - if(H5B2_hdr_free(hdr) < 0) + if(H5B2__hdr_free(hdr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_create() */ +} /* end H5B2__hdr_create() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_incr + * Function: H5B2__hdr_incr * * Purpose: Increment reference count on B-tree header * @@ -338,11 +338,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_incr(H5B2_hdr_t *hdr) +H5B2__hdr_incr(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(hdr); @@ -357,11 +357,11 @@ H5B2_hdr_incr(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_incr_hdr() */ +} /* end H5B2__hdr_incr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_decr + * Function: H5B2__hdr_decr * * Purpose: Decrement reference count on B-tree header * @@ -374,11 +374,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_decr(H5B2_hdr_t *hdr) +H5B2__hdr_decr(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -394,11 +394,11 @@ H5B2_hdr_decr(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_decr() */ +} /* end H5B2__hdr_decr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_fuse_incr + * Function: H5B2__hdr_fuse_incr * * Purpose: Increment file reference count on shared v2 B-tree header * @@ -411,7 +411,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) +H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -422,11 +422,11 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) hdr->file_rc++; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5B2_hdr_fuse_incr() */ +} /* end H5B2__hdr_fuse_incr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_fuse_decr + * Function: H5B2__hdr_fuse_decr * * Purpose: Decrement file reference count on shared v2 B-tree header * @@ -439,7 +439,7 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) *------------------------------------------------------------------------- */ size_t -H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) +H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -451,11 +451,11 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) hdr->file_rc--; FUNC_LEAVE_NOAPI(hdr->file_rc) -} /* end H5B2_hdr_fuse_decr() */ +} /* end H5B2__hdr_fuse_decr() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_dirty + * Function: H5B2__hdr_dirty * * Purpose: Mark B-tree header as dirty * @@ -468,11 +468,11 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_dirty(H5B2_hdr_t *hdr) +H5B2__hdr_dirty(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -483,11 +483,11 @@ H5B2_hdr_dirty(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_dirty() */ +} /* end H5B2__hdr_dirty() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_free + * Function: H5B2__hdr_free * * Purpose: Free B-tree header info * @@ -500,11 +500,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_free(H5B2_hdr_t *hdr) +H5B2__hdr_free(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -557,11 +557,11 @@ H5B2_hdr_free(H5B2_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_free() */ +} /* end H5B2__hdr_free() */ /*------------------------------------------------------------------------- - * Function: H5B2_hdr_delete + * Function: H5B2__hdr_delete * * Purpose: Delete a v2 B-tree, starting with the header * @@ -574,12 +574,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting v2 B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -600,7 +600,7 @@ H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Delete all nodes in B-tree */ if(H5F_addr_defined(hdr->root.addr)) - if(H5B2_delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr->remove_op, hdr->remove_op_data) < 0) + if(H5B2__delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr->remove_op, hdr->remove_op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete B-tree nodes") /* Indicate that the heap header should be deleted & file space freed */ @@ -612,5 +612,5 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_hdr_delete() */ +} /* end H5B2__hdr_delete() */ |