summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5B2int.c98
-rw-r--r--src/H5B2test.c2
-rw-r--r--src/H5Dbtree.c37
-rw-r--r--src/H5Dbtree2.c536
-rw-r--r--src/H5Dchunk.c11
-rw-r--r--src/H5Dearray.c83
-rw-r--r--src/H5Dfarray.c78
-rw-r--r--src/H5Dlayout.c7
-rw-r--r--src/H5Dnone.c26
-rw-r--r--src/H5Dpkg.h2
-rw-r--r--src/H5Dsingle.c57
-rw-r--r--src/H5Gdense.c8
-rw-r--r--src/H5HFbtree2.c18
-rw-r--r--src/H5HFcache.c1
-rw-r--r--src/H5HFdblock.c4
-rw-r--r--src/H5HFhdr.c4
-rw-r--r--src/H5HFiblock.c6
-rw-r--r--src/H5HFtiny.c8
-rw-r--r--src/H5Pdcpl.c2
-rw-r--r--src/H5SMbtree2.c12
-rw-r--r--src/H5VMprivate.h4
-rw-r--r--src/H5Zscaleoffset.c2
-rw-r--r--src/H5private.h20
-rw-r--r--src/H5system.c9
24 files changed, 530 insertions, 505 deletions
diff --git a/src/H5B2int.c b/src/H5B2int.c
index 6c6317b..e1a268b 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -78,9 +78,9 @@ static herr_t H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
static herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx,
void *swap_loc);
-static herr_t H5B2_shadow_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
- unsigned depth, H5B2_node_ptr_t *curr_node_ptr, H5B2_internal_t **internal);
-static herr_t H5B2_shadow_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
+static herr_t H5B2__shadow_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
+ uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, H5B2_internal_t **internal);
+static herr_t H5B2__shadow_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, H5B2_leaf_t **leaf);
static herr_t H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent,
H5B2_node_ptr_t *node_ptr, uint16_t depth);
@@ -231,7 +231,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow the left node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx]), &left_int) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx]), &left_int) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
left_addr = internal->node_ptrs[idx].addr;
} /* end if */
@@ -267,7 +267,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow the left node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &left_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &left_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
left_addr = internal->node_ptrs[idx].addr;
} /* end if */
@@ -357,7 +357,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, right_child, right_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, right_child, right_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -570,9 +570,9 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow both nodes if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx]), &left_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx]), &left_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx + 1]), &right_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx + 1]), &right_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx + 1].addr;
@@ -605,9 +605,9 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow both nodes if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &left_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &left_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx + 1]), &right_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx + 1]), &right_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
left_addr = internal->node_ptrs[idx].addr;
right_addr = internal->node_ptrs[idx + 1].addr;
@@ -685,7 +685,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -792,7 +792,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, right_child, right_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, right_child, right_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -962,11 +962,11 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow all nodes if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx - 1]), &left_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx - 1]), &left_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx]), &middle_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx]), &middle_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx + 1]), &right_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx + 1]), &right_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
left_addr = internal->node_ptrs[idx - 1].addr;
middle_addr = internal->node_ptrs[idx].addr;
@@ -1008,11 +1008,11 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow all nodes if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx - 1]), &left_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx - 1]), &left_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &middle_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &middle_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx + 1]), &right_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx + 1]), &right_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
left_addr = internal->node_ptrs[idx - 1].addr;
middle_addr = internal->node_ptrs[idx].addr;
@@ -1097,7 +1097,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -1198,7 +1198,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, right_child, right_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, right_child, right_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -1299,7 +1299,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, middle_child, middle_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, middle_child, middle_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -1399,7 +1399,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, middle_child, middle_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, middle_child, middle_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -1609,7 +1609,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow the left node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx]), &left_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx]), &left_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
left_addr = internal->node_ptrs[idx].addr;
} /* end if */
@@ -1641,7 +1641,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow the left node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &left_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &left_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
left_addr = internal->node_ptrs[idx].addr;
} /* end if */
@@ -1681,7 +1681,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -1859,9 +1859,9 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow left and middle nodes if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx - 1]), &left_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx - 1]), &left_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
- if(H5B2_shadow_internal(hdr, dxpl_id, (depth - 1), &(internal->node_ptrs[idx]), &middle_internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[idx]), &middle_internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
left_addr = internal->node_ptrs[idx - 1].addr;
middle_addr = internal->node_ptrs[idx].addr;
@@ -1902,9 +1902,9 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow left and middle nodes if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx - 1]), &left_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx - 1]), &left_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
- if(H5B2_shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &middle_leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, &(internal->node_ptrs[idx]), &middle_leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
left_addr = internal->node_ptrs[idx - 1].addr;
middle_addr = internal->node_ptrs[idx].addr;
@@ -1970,7 +1970,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, left_child, left_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -2051,7 +2051,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_internal_t *grandchild_int = NULL;
/* Protect grandchild */
- if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, middle_child, middle_node_ptrs[u].node_nrec, (depth - 2), H5AC__NO_FLAGS_SET)))
+ if(NULL == (grandchild_int = H5B2__protect_internal(hdr, dxpl_id, grandchild_addr, middle_child, middle_node_ptrs[u].node_nrec, (uint16_t)(depth - 2), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
grandchild_class = H5AC_BT2_INT;
grandchild = grandchild_int;
@@ -2293,7 +2293,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr
/* Shadow the node if doing SWMR writes */
if(hdr->swmr_write)
- if(H5B2_shadow_leaf(hdr, dxpl_id, curr_node_ptr, &leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, curr_node_ptr, &leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
/* Must have a leaf node with enough space to insert a record now */
@@ -2397,7 +2397,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
/* Shadow the node if doing SWMR writes */
if(hdr->swmr_write)
- if(H5B2_shadow_internal(hdr, dxpl_id, depth, curr_node_ptr, &internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, depth, curr_node_ptr, &internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
/* Split or redistribute child node pointers, if necessary */
@@ -2959,7 +2959,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr
if(leaf->nrec > 0) {
/* Shadow the node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, curr_node_ptr, &leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, curr_node_ptr, &leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
leaf_addr = curr_node_ptr->addr;
} /* end if */
@@ -3070,7 +3070,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased,
H5B2_internal_t *new_root_int = NULL;
/* Protect new root */
- if(NULL == (new_root_int = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, hdr, curr_node_ptr->node_nrec, (depth - 1), H5AC__NO_FLAGS_SET)))
+ if(NULL == (new_root_int = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, hdr, curr_node_ptr->node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
new_root_class = H5AC_BT2_INT;
new_root = new_root_int;
@@ -3135,7 +3135,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased,
/* Shadow the node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_internal(hdr, dxpl_id, depth, curr_node_ptr, &internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, depth, curr_node_ptr, &internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
internal_addr = curr_node_ptr->addr;
} /* end if */
@@ -3249,7 +3249,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased,
/* Attempt to remove record from child node */
if(depth > 1) {
- if(H5B2__remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)depth - 1,
+ if(H5B2__remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1),
new_cache_info, new_cache_info_flags_ptr, next_pos, new_node_ptr, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node")
} /* end if */
@@ -3359,7 +3359,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
if(leaf->nrec > 0) {
/* Shadow the node if doing SWMR writes */
if(hdr->swmr_write) {
- if(H5B2_shadow_leaf(hdr, dxpl_id, curr_node_ptr, &leaf) < 0)
+ if(H5B2__shadow_leaf(hdr, dxpl_id, curr_node_ptr, &leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node")
leaf_addr = curr_node_ptr->addr;
} /* end if */
@@ -3475,7 +3475,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_internal_t *new_root_int = NULL;
/* Protect new root */
- if(NULL == (new_root_int = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, hdr, curr_node_ptr->node_nrec, (depth - 1), H5AC__NO_FLAGS_SET)))
+ if(NULL == (new_root_int = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr->addr, hdr, curr_node_ptr->node_nrec, (uint16_t)(depth - 1), H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node")
new_root_class = H5AC_BT2_INT;
new_root = new_root_int;
@@ -3541,7 +3541,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
/* Shadow the node if doing SWMR writes */
if(hdr->swmr_write && !collapsed_root) {
- if(H5B2_shadow_internal(hdr, dxpl_id, depth, curr_node_ptr, &internal) < 0)
+ if(H5B2__shadow_internal(hdr, dxpl_id, depth, curr_node_ptr, &internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node")
internal_addr = curr_node_ptr->addr;
} /* end if */
@@ -3706,7 +3706,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
/* Attempt to remove record from child node */
if(depth > 1) {
- if(H5B2__remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)depth - 1,
+ if(H5B2__remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1),
new_cache_info, new_cache_info_flags_ptr, new_node_ptr, next_pos, n, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node")
} /* end if */
@@ -4138,7 +4138,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5B2_shadow_internal
+ * Function: H5B2__shadow_internal
*
* Purpose: "Shadow: an internal node - copy it to a new location,
* leaving the data in the old location intact (for now).
@@ -4154,7 +4154,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2_shadow_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
+H5B2__shadow_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
H5B2_node_ptr_t *curr_node_ptr, H5B2_internal_t **internal)
{
hbool_t node_pinned = FALSE;
@@ -4162,7 +4162,7 @@ H5B2_shadow_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
haddr_t new_node_addr; /* Address to move node to */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -4235,11 +4235,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5B2_shadow_internal() */
+} /* end H5B2__shadow_internal() */
/*-------------------------------------------------------------------------
- * Function: H5B2_shadow_leaf
+ * Function: H5B2__shadow_leaf
*
* Purpose: "Shadow: a leaf node - copy it to a new location, leaving
* the data in the old location intact (for now). This is
@@ -4255,7 +4255,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2_shadow_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
+H5B2__shadow_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, H5B2_leaf_t **leaf)
{
hbool_t node_pinned = FALSE;
@@ -4263,7 +4263,7 @@ H5B2_shadow_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
haddr_t new_node_addr; /* Address to move node to */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -4335,7 +4335,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5B2_shadow_leaf() */
+} /* end H5B2__shadow_leaf() */
#ifdef H5B2_DEBUG
diff --git a/src/H5B2test.c b/src/H5B2test.c
index 1e6f4a0..3fe7b52 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -327,7 +327,7 @@ static void *
H5B2__test_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr)
{
H5B2_test_ctx_t *ctx; /* Callback context structure */
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index 20d1682..b80f9a6 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -127,7 +127,7 @@ static herr_t H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info,
static herr_t H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D__btree_idx_insert_addr(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, H5D_t *dset);
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
static int H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info,
@@ -153,22 +153,22 @@ static herr_t H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info);
/* v1 B-tree indexed chunk I/O ops */
const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{
- FALSE, /* v1 B-tree indices does not support SWMR access */
- H5D__btree_idx_init,
- H5D__btree_idx_create,
- H5D__btree_idx_is_space_alloc,
- H5D__btree_idx_insert_addr,
- H5D__btree_idx_get_addr,
- NULL,
- H5D__btree_idx_iterate,
- H5D__btree_idx_remove,
- H5D__btree_idx_delete,
- H5D__btree_idx_copy_setup,
- H5D__btree_idx_copy_shutdown,
- H5D__btree_idx_size,
- H5D__btree_idx_reset,
- H5D__btree_idx_dump,
- H5D__btree_idx_dest
+ FALSE, /* v1 B-tree indices does not support SWMR access */
+ H5D__btree_idx_init, /* insert */
+ H5D__btree_idx_create, /* create */
+ H5D__btree_idx_is_space_alloc, /* is_space_alloc */
+ H5D__btree_idx_insert_addr, /* insert */
+ H5D__btree_idx_get_addr, /* get_addr */
+ NULL, /* resize */
+ H5D__btree_idx_iterate, /* iterate */
+ H5D__btree_idx_remove, /* remove */
+ H5D__btree_idx_delete, /* delete */
+ H5D__btree_idx_copy_setup, /* copy_setup */
+ H5D__btree_idx_copy_shutdown, /* copy_shutdown */
+ H5D__btree_idx_size, /* size */
+ H5D__btree_idx_reset, /* reset */
+ H5D__btree_idx_dump, /* dump */
+ H5D__btree_idx_dest /* destroy */
}};
@@ -998,7 +998,8 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__btree_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, H5D_t H5_ATTR_UNUSED *dset)
+H5D__btree_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t H5_ATTR_UNUSED *dset)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c
index 2f06e54..9bc555e 100644
--- a/src/H5Dbtree2.c
+++ b/src/H5Dbtree2.c
@@ -108,70 +108,70 @@ typedef struct H5D_bt2_find_ud_t {
/********************/
/* Shared v2 B-tree methods for indexing filtered and non-filtered chunked datasets */
-static void *H5D_bt2_crt_context(void *udata);
-static herr_t H5D_bt2_dst_context(void *ctx);
-static void *H5D_bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr);
-static herr_t H5D_bt2_dst_dbg_context(void *_u_ctx);
+static void *H5D__bt2_crt_context(void *udata);
+static herr_t H5D__bt2_dst_context(void *ctx);
+static void *H5D__bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr);
+static herr_t H5D__bt2_dst_dbg_context(void *_u_ctx);
/* v2 B-tree class for indexing non-filtered chunked datasets */
-static herr_t H5D_bt2_store(void *native, const void *udata);
-static herr_t H5D_bt2_compare(const void *rec1, const void *rec2);
-static herr_t H5D_bt2_encode(uint8_t *raw, const void *native, void *ctx);
-static herr_t H5D_bt2_decode(const uint8_t *raw, void *native, void *ctx);
-static herr_t H5D_bt2_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
+static herr_t H5D__bt2_store(void *native, const void *udata);
+static herr_t H5D__bt2_compare(const void *rec1, const void *rec2);
+static herr_t H5D__bt2_encode(uint8_t *raw, const void *native, void *ctx);
+static herr_t H5D__bt2_decode(const uint8_t *raw, void *native, void *ctx);
+static herr_t H5D__bt2_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *record, const void *u_ctx);
/* v2 B-tree class for indexing filtered chunked datasets */
-static herr_t H5D_bt2_filt_store(void *native, const void *udata);
-static herr_t H5D_bt2_filt_compare(const void *rec1, const void *rec2);
-static herr_t H5D_bt2_filt_encode(uint8_t *raw, const void *native, void *ctx);
-static herr_t H5D_bt2_filt_decode(const uint8_t *raw, void *native, void *ctx);
-static herr_t H5D_bt2_filt_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
+static herr_t H5D__bt2_filt_store(void *native, const void *udata);
+static herr_t H5D__bt2_filt_compare(const void *rec1, const void *rec2);
+static herr_t H5D__bt2_filt_encode(uint8_t *raw, const void *native, void *ctx);
+static herr_t H5D__bt2_filt_decode(const uint8_t *raw, void *native, void *ctx);
+static herr_t H5D__bt2_filt_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *record, const void *u_ctx);
/* Helper routine */
-static herr_t H5D_bt2_idx_open(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info);
-/* Callback for H5B2_iterate() which is called in H5D_bt2_idx_iterate() */
-static int H5D_bt2_idx_iterate_cb(const void *_record, void *_udata);
+/* Callback for H5B2_iterate() which is called in H5D__bt2_idx_iterate() */
+static int H5D__bt2_idx_iterate_cb(const void *_record, void *_udata);
-/* Callbacks for H5B2_find() which are called in H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert() */
-static herr_t H5D_bt2_found_cb(const void *nrecord, void *op_data);
-static herr_t H5D_bt2_filt_found_cb(const void *nrecord, void *op_data);
+/* Callbacks for H5B2_find() which are called in H5D__bt2_idx_get_addr() and H5D_bt2_idx_insert() */
+static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data);
+static herr_t H5D__bt2_filt_found_cb(const void *nrecord, void *op_data);
/*
* Callbacks for H5B2_remove() and H5B2_delete() which are called
- * in H5D_bt2_idx_remove() and H5D_bt2_idx_delete().
+ * in H5D__bt2_idx_remove() and H5D__bt2_idx_delete().
*/
-static herr_t H5D_bt2_remove_cb(const void *nrecord, void *_udata);
-static herr_t H5D_bt2_filt_remove_cb(const void *nrecord, void *_udata);
+static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata);
+static herr_t H5D__bt2_filt_remove_cb(const void *nrecord, void *_udata);
/* Callback for H5B2_modify() which is called in H5D_bt2_idx_insert() */
-static herr_t H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed);
+static herr_t H5D__bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed);
/* Chunked layout indexing callbacks for v2 B-tree indexing */
-static herr_t H5D_bt2_idx_init(const H5D_chk_idx_info_t *idx_info,
+static herr_t H5D__bt2_idx_init(const H5D_chk_idx_info_t *idx_info,
const H5S_t *space, haddr_t dset_ohdr_addr);
-static herr_t H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info);
-static hbool_t H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
-static herr_t H5D_bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, H5D_t *dset);
-static herr_t H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
+static herr_t H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info);
+static hbool_t H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
+static herr_t H5D__bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info,
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
+static herr_t H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
-static int H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
+static int H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_cb_func_t chunk_cb, void *chunk_udata);
-static herr_t H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info,
+static herr_t H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_common_ud_t *udata);
-static herr_t H5D_bt2_idx_delete(const H5D_chk_idx_info_t *idx_info);
-static herr_t H5D_bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
const H5D_chk_idx_info_t *idx_info_dst);
-static herr_t H5D_bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src,
+static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src,
H5O_storage_chunk_t *storage_dst, hid_t dxpl_id);
-static herr_t H5D_bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size);
-static herr_t H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr);
-static herr_t H5D_bt2_idx_dump(const H5O_storage_chunk_t *storage,
+static herr_t H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size);
+static herr_t H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr);
+static herr_t H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage,
FILE *stream);
-static herr_t H5D_bt2_idx_dest(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info);
/*********************/
@@ -180,22 +180,22 @@ static herr_t H5D_bt2_idx_dest(const H5D_chk_idx_info_t *idx_info);
/* Chunked dataset I/O ops for v2 B-tree indexing */
const H5D_chunk_ops_t H5D_COPS_BT2[1] = {{
- TRUE,
- H5D_bt2_idx_init,
- H5D_bt2_idx_create,
- H5D_bt2_idx_is_space_alloc,
- H5D_bt2_idx_insert_addr,
- H5D_bt2_idx_get_addr,
- NULL,
- H5D_bt2_idx_iterate,
- H5D_bt2_idx_remove,
- H5D_bt2_idx_delete,
- H5D_bt2_idx_copy_setup,
- H5D_bt2_idx_copy_shutdown,
- H5D_bt2_idx_size,
- H5D_bt2_idx_reset,
- H5D_bt2_idx_dump,
- H5D_bt2_idx_dest
+ TRUE, /* Fixed array indices support SWMR access */
+ H5D__bt2_idx_init, /* init */
+ H5D__bt2_idx_create, /* create */
+ H5D__bt2_idx_is_space_alloc, /* is_space_alloc */
+ H5D__bt2_idx_insert_addr, /* insert */
+ H5D__bt2_idx_get_addr, /* get_addr */
+ NULL, /* resize */
+ H5D__bt2_idx_iterate, /* iterate */
+ H5D__bt2_idx_remove, /* remove */
+ H5D__bt2_idx_delete, /* delete */
+ H5D__bt2_idx_copy_setup, /* copy_setup */
+ H5D__bt2_idx_copy_shutdown, /* copy_shutdown */
+ H5D__bt2_idx_size, /* size */
+ H5D__bt2_idx_reset, /* reset */
+ H5D__bt2_idx_dump, /* dump */
+ H5D__bt2_idx_dest /* destroy */
}};
@@ -208,15 +208,15 @@ const H5B2_class_t H5D_BT2[1] = {{ /* B-tree class information */
H5B2_CDSET_ID, /* Type of B-tree */
"H5B2_CDSET_ID", /* Name of B-tree class */
sizeof(H5D_bt2_rec_t), /* Size of native record */
- H5D_bt2_crt_context, /* Create client callback context */
- H5D_bt2_dst_context, /* Destroy client callback context */
- H5D_bt2_store, /* Record storage callback */
- H5D_bt2_compare, /* Record comparison callback */
- H5D_bt2_encode, /* Record encoding callback */
- H5D_bt2_decode, /* Record decoding callback */
- H5D_bt2_debug, /* Record debugging callback */
- H5D_bt2_crt_dbg_context, /* Create debugging context */
- H5D_bt2_dst_dbg_context /* Destroy debugging context */
+ H5D__bt2_crt_context, /* Create client callback context */
+ H5D__bt2_dst_context, /* Destroy client callback context */
+ H5D__bt2_store, /* Record storage callback */
+ H5D__bt2_compare, /* Record comparison callback */
+ H5D__bt2_encode, /* Record encoding callback */
+ H5D__bt2_decode, /* Record decoding callback */
+ H5D__bt2_debug, /* Record debugging callback */
+ H5D__bt2_crt_dbg_context, /* Create debugging context */
+ H5D__bt2_dst_dbg_context /* Destroy debugging context */
}};
/* v2 B-tree class for indexing filtered chunked datasets */
@@ -224,15 +224,15 @@ const H5B2_class_t H5D_BT2_FILT[1] = {{ /* B-tree class information */
H5B2_CDSET_FILT_ID, /* Type of B-tree */
"H5B2_CDSET_FILT_ID", /* Name of B-tree class */
sizeof(H5D_bt2_filt_rec_t), /* Size of native record */
- H5D_bt2_crt_context, /* Create client callback context */
- H5D_bt2_dst_context, /* Destroy client callback context */
- H5D_bt2_filt_store, /* Record storage callback */
- H5D_bt2_filt_compare, /* Record comparison callback */
- H5D_bt2_filt_encode, /* Record encoding callback */
- H5D_bt2_filt_decode, /* Record decoding callback */
- H5D_bt2_filt_debug, /* Record debugging callback */
- H5D_bt2_crt_dbg_context, /* Create debugging context */
- H5D_bt2_dst_dbg_context /* Destroy debugging context */
+ H5D__bt2_crt_context, /* Create client callback context */
+ H5D__bt2_dst_context, /* Destroy client callback context */
+ H5D__bt2_filt_store, /* Record storage callback */
+ H5D__bt2_filt_compare, /* Record comparison callback */
+ H5D__bt2_filt_encode, /* Record encoding callback */
+ H5D__bt2_filt_decode, /* Record decoding callback */
+ H5D__bt2_filt_debug, /* Record debugging callback */
+ H5D__bt2_crt_dbg_context, /* Create debugging context */
+ H5D__bt2_dst_dbg_context /* Destroy debugging context */
}};
@@ -251,7 +251,7 @@ H5FL_BLK_DEFINE(chunk_dim);
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_crt_context
+ * Function: H5D__bt2_crt_context
*
* Purpose: Create client callback context
*
@@ -263,14 +263,14 @@ H5FL_BLK_DEFINE(chunk_dim);
*-------------------------------------------------------------------------
*/
static void *
-H5D_bt2_crt_context(void *_udata)
+H5D__bt2_crt_context(void *_udata)
{
H5D_bt2_ctx_ud_t *udata = (H5D_bt2_ctx_ud_t *)_udata; /* User data for building callback context */
H5D_bt2_ctx_t *ctx; /* Callback context structure */
uint32_t *my_dim = NULL; /* Pointer to copy of chunk dimension size */
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -304,11 +304,11 @@ H5D_bt2_crt_context(void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_crt_context() */
+} /* H5D__bt2_crt_context() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_dst_context
+ * Function: H5D__bt2_dst_context
*
* Purpose: Destroy client callback context
*
@@ -320,11 +320,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_dst_context(void *_ctx)
+H5D__bt2_dst_context(void *_ctx)
{
H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
@@ -337,11 +337,11 @@ H5D_bt2_dst_context(void *_ctx)
ctx = H5FL_FREE(H5D_bt2_ctx_t, ctx);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_dst_context() */
+} /* H5D__bt2_dst_context() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_store
+ * Function: H5D__bt2_store
*
* Purpose: Store native information into record for v2 B-tree
* (non-filtered)
@@ -354,20 +354,20 @@ H5D_bt2_dst_context(void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_store(void *record, const void *_udata)
+H5D__bt2_store(void *record, const void *_udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
*(H5D_bt2_rec_t *)record = *(const H5D_bt2_rec_t *)udata->rec;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_store() */
+} /* H5D__bt2_store() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_compare
+ * Function: H5D__bt2_compare
*
* Purpose: Compare two native information records, according to some key
* (non-filtered)
@@ -381,15 +381,15 @@ H5D_bt2_store(void *record, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_compare(const void *_udata, const void *_rec2)
+H5D__bt2_compare(const void *_udata, const void *_rec2)
{
const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
const H5D_bt2_rec_t *rec1 = (const H5D_bt2_rec_t *)udata->rec; /* The native record */
const H5D_bt2_rec_t *rec2 = (const H5D_bt2_rec_t *)_rec2; /* The native record */
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(rec1);
HDassert(rec2);
@@ -398,11 +398,11 @@ H5D_bt2_compare(const void *_udata, const void *_rec2)
ret_value = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_compare() */
+} /* H5D__bt2_compare() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_encode
+ * Function: H5D__bt2_encode
*
* Purpose: Encode native information into raw form for storing on disk
* (non-filtered)
@@ -415,32 +415,32 @@ H5D_bt2_compare(const void *_udata, const void *_rec2)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_encode(uint8_t *raw, const void *_record, void *_ctx)
+H5D__bt2_encode(uint8_t *raw, const void *_record, void *_ctx)
{
H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
const H5D_bt2_rec_t *record = (const H5D_bt2_rec_t *)_record; /* The native record */
hsize_t tmp_offset; /* Temporary coordinate offset, from file */
- unsigned i; /* Local index varible */
+ unsigned u; /* Local index varible */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
/* Encode the record's fields */
H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->addr);
- for(i = 0; i < ctx->ndims; i++) {
+ for(u = 0; u < ctx->ndims; u++) {
/* Compute coordinate offset from scaled offset */
- tmp_offset = record->scaled[i] * ctx->dim[i];
+ tmp_offset = record->scaled[u] * ctx->dim[u];
UINT64ENCODE(raw, tmp_offset);
- }
+ } /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_encode() */
+} /* H5D__bt2_encode() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_decode
+ * Function: H5D__bt2_decode
*
* Purpose: Decode raw disk form of record into native form
* (non-filtered)
@@ -453,36 +453,35 @@ H5D_bt2_encode(uint8_t *raw, const void *_record, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_decode(const uint8_t *raw, void *_record, void *_ctx)
+H5D__bt2_decode(const uint8_t *raw, void *_record, void *_ctx)
{
H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
H5D_bt2_rec_t *record = (H5D_bt2_rec_t *)_record; /* The native record */
hsize_t tmp_offset; /* Temporary coordinate offset, from file */
- unsigned i; /* Local index variable */
+ unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
/* Decode the record's fields */
H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->addr);
- for(i = 0; i < ctx->ndims; i++) {
-
+ for(u = 0; u < ctx->ndims; u++) {
/* Retrieve coordinate offset */
UINT64DECODE(raw, tmp_offset);
- HDassert(0 == (tmp_offset % ctx->dim[i]));
+ HDassert(0 == (tmp_offset % ctx->dim[u]));
/* Convert to a scaled offset */
- record->scaled[i] = tmp_offset / ctx->dim[i];
- }
+ record->scaled[u] = tmp_offset / ctx->dim[u];
+ } /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_decode() */
+} /* H5D__bt2_decode() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_debug
+ * Function: H5D__bt2_debug
*
* Purpose: Debug native form of record (non-filtered)
*
@@ -494,14 +493,14 @@ H5D_bt2_decode(const uint8_t *raw, void *_record, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
+H5D__bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
int indent, int fwidth, const void *_record, const void *_u_ctx)
{
const H5D_bt2_rec_t *record = (const H5D_bt2_rec_t *)_record; /* The native record */
const H5D_bt2_ctx_ud_t *u_ctx = (const H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(record);
@@ -512,11 +511,11 @@ H5D_bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED
HDfputs("}\n", stream);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_debug() */
+} /* H5D__bt2_debug() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_store
+ * Function: H5D__bt2_filt_store
*
* Purpose: Store native information into record for v2 B-tree
* (filtered)
@@ -529,20 +528,20 @@ H5D_bt2_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_store(void *record, const void *_udata)
+H5D__bt2_filt_store(void *record, const void *_udata)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
*(H5D_bt2_filt_rec_t *)record = *(const H5D_bt2_filt_rec_t *)udata->rec;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_store() */
+} /* H5D__bt2_filt_store() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_compare
+ * Function: H5D__bt2_filt_compare
*
* Purpose: Compare two native information records, according to some key
* (filtered)
@@ -556,15 +555,15 @@ H5D_bt2_filt_store(void *record, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
+H5D__bt2_filt_compare(const void *_udata, const void *_rec2)
{
const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */
const H5D_bt2_filt_rec_t *rec1 = (const H5D_bt2_filt_rec_t *)udata->rec; /* The native record */
const H5D_bt2_filt_rec_t *rec2 = (const H5D_bt2_filt_rec_t *)_rec2; /* The native record */
- herr_t ret_value; /* Return value */
+ herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(rec1);
HDassert(rec2);
@@ -573,11 +572,11 @@ H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
ret_value = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_filt_compare() */
+} /* H5D__bt2_filt_compare() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_encode
+ * Function: H5D__bt2_filt_encode
*
* Purpose: Encode native information into raw form for storing on disk
* (filtered)
@@ -590,13 +589,13 @@ H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
+H5D__bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
{
H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */
- unsigned i; /* Local index variable */
+ unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
@@ -605,15 +604,15 @@ H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->addr);
UINT64ENCODE_VAR(raw, record->nbytes, ctx->chunk_size_len);
UINT32ENCODE(raw, record->filter_mask);
- for(i = 0; i < ctx->ndims; i++)
- UINT64ENCODE(raw, record->scaled[i]);
+ for(u = 0; u < ctx->ndims; u++)
+ UINT64ENCODE(raw, record->scaled[u]);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_encode() */
+} /* H5D__bt2_filt_encode() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_decode
+ * Function: H5D__bt2_filt_decode
*
* Purpose: Decode raw disk form of record into native form
* (filtered)
@@ -626,13 +625,13 @@ H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
+H5D__bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
{
H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */
H5D_bt2_filt_rec_t *record = (H5D_bt2_filt_rec_t *)_record; /* The native record */
- unsigned i; /* Local index variable */
+ unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
@@ -641,15 +640,15 @@ H5D_bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->addr);
UINT64DECODE_VAR(raw, record->nbytes, ctx->chunk_size_len);
UINT32DECODE(raw, record->filter_mask);
- for(i = 0; i < ctx->ndims; i++)
- UINT64DECODE(raw, record->scaled[i]);
+ for(u = 0; u < ctx->ndims; u++)
+ UINT64DECODE(raw, record->scaled[u]);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_decode() */
+} /* H5D__bt2_filt_decode() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_debug
+ * Function: H5D__bt2_filt_debug
*
* Purpose: Debug native form of record (filterd)
*
@@ -661,14 +660,14 @@ H5D_bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
+H5D__bt2_filt_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
int indent, int fwidth, const void *_record, const void *_u_ctx)
{
const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */
const H5D_bt2_ctx_ud_t *u_ctx = (const H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(record);
@@ -682,11 +681,11 @@ H5D_bt2_filt_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UN
HDfputs("}\n", stream);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_debug() */
+} /* H5D__bt2_filt_debug() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_crt_dbg_context
+ * Function: H5D__bt2_crt_dbg_context
*
* Purpose: Create user data for debugged callback context
*
@@ -698,15 +697,15 @@ H5D_bt2_filt_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UN
*-------------------------------------------------------------------------
*/
static void *
-H5D_bt2_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t obj_addr)
+H5D__bt2_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t obj_addr)
{
- H5D_bt2_ctx_ud_t *u_ctx; /* User data for creating callback context */
+ H5D_bt2_ctx_ud_t *u_ctx = NULL; /* User data for creating callback context */
H5O_loc_t obj_loc; /* Pointer to an object's location */
hbool_t obj_opened = FALSE; /* Flag to indicate that the object header was opened */
H5O_layout_t layout; /* Layout message */
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -757,11 +756,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_crt_dbg_context() */
+} /* H5D__bt2_crt_dbg_context() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_dst_dbg_context
+ * Function: H5D__bt2_dst_dbg_context
*
* Purpose: Destroy client callback context
*
@@ -773,11 +772,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_dst_dbg_context(void *_u_ctx)
+H5D__bt2_dst_dbg_context(void *_u_ctx)
{
H5D_bt2_ctx_ud_t *u_ctx = (H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(u_ctx);
@@ -786,26 +785,26 @@ H5D_bt2_dst_dbg_context(void *_u_ctx)
u_ctx = H5FL_FREE(H5D_bt2_ctx_ud_t, u_ctx);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_dst_dbg_context() */
+} /* H5D__bt2_dst_dbg_context() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_init
+ * Function: H5D__bt2_idx_init
*
* Purpose: Initialize the indexing information for a dataset.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * Wednensday, May 23, 2012
+ * Wednesday, May 23, 2012
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_init(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info,
+H5D__bt2_idx_init(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info,
const H5S_t H5_ATTR_UNUSED *space, haddr_t dset_ohdr_addr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(H5F_addr_defined(dset_ohdr_addr));
@@ -813,11 +812,11 @@ H5D_bt2_idx_init(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info,
idx_info->storage->u.btree2.dset_ohdr_addr = dset_ohdr_addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_bt2_idx_init() */
+} /* end H5D__bt2_idx_init() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_open()
+ * Function: H5D__bt2_idx_open()
*
* Purpose: Opens an existing v2 B-tree.
*
@@ -834,14 +833,14 @@ H5D_bt2_idx_init(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info,
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_open(const H5D_chk_idx_info_t *idx_info)
+H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info)
{
H5D_bt2_ctx_ud_t u_ctx; /* user data for creating context */
H5O_loc_t oloc; /* Temporary object header location for dataset */
H5O_proxy_t *oh_proxy = NULL; /* Dataset's object header proxy */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(idx_info);
@@ -880,11 +879,11 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header proxy")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_open() */
+} /* end H5D__bt2_idx_open() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_create
+ * Function: H5D__bt2_idx_create
*
* Purpose: Create the v2 B-tree for tracking dataset chunks
*
@@ -895,7 +894,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
+H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
{
H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */
H5D_bt2_ctx_ud_t u_ctx; /* data for context call */
@@ -903,7 +902,7 @@ H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
H5O_proxy_t *oh_proxy = NULL; /* Dataset's object header proxy */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(idx_info);
@@ -968,11 +967,11 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header proxy")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_create() */
+} /* end H5D__bt2_idx_create() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_is_space_alloc
+ * Function: H5D__bt2_idx_is_space_alloc
*
* Purpose: Query if space is allocated for index method
*
@@ -983,11 +982,11 @@ done:
*-------------------------------------------------------------------------
*/
static hbool_t
-H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
+H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
{
- hbool_t ret_value; /* Return value */
+ hbool_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(storage);
@@ -996,11 +995,11 @@ H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
ret_value = (hbool_t)H5F_addr_defined(storage->idx_addr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_is_space_alloc() */
+} /* end H5D__bt2_idx_is_space_alloc() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_mod_filt_cb
+ * Function: H5D__bt2_mod_filt_cb
*
* Purpose: Modify record (filtered) for dataset chunk when it is found
* in the v2 B-tree.
@@ -1015,9 +1014,9 @@ H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed)
+H5D__bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
*(H5D_bt2_filt_rec_t *)_record = *(H5D_bt2_filt_rec_t *)_op_data;
@@ -1025,11 +1024,11 @@ H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed)
*changed = TRUE;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_bt2_mod_filt_cb() */
+} /* end H5D__bt2_mod_filt_cb() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_insert_addr
+ * Function: H5D__bt2_idx_insert_addr
*
* Purpose: Insert chunk address into the indexing structure.
* A non-filtered chunk:
@@ -1047,16 +1046,17 @@ H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, H5D_t H5_ATTR_UNUSED *dset)
+H5D__bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t H5_ATTR_UNUSED *dset)
{
H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
H5D_bt2_find_ud_t bt2_udata; /* User data for v2 B-tree calls */
unsigned u; /* Local index variable */
- H5D_bt2_rec_t rec;
- H5D_bt2_filt_rec_t filt_rec;
+ H5D_bt2_rec_t rec; /* Record for non-filtered chunk */
+ H5D_bt2_filt_rec_t filt_rec; /* Record for filtered chunk */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(idx_info);
HDassert(idx_info->f);
@@ -1070,7 +1070,7 @@ H5D_bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat
/* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
- if(H5D_bt2_idx_open(idx_info) < 0)
+ if(H5D__bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
@@ -1084,43 +1084,44 @@ H5D_bt2_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat
if(idx_info->pline->nused > 0) { /* filtered chunk */
bt2_udata.rec = &filt_rec;
filt_rec.addr = udata->chunk_block.offset;
- filt_rec.nbytes = udata->chunk_block.length;
+ H5_CHECKED_ASSIGN(filt_rec.nbytes, uint32_t, udata->chunk_block.length, hsize_t);
filt_rec.filter_mask = udata->filter_mask;
for(u = 0; u < (idx_info->layout->ndims - 1); u++)
filt_rec.scaled[u] = udata->common.scaled[u];
- } else { /* non-filtered chunk */
+ } /* end if */
+ else { /* non-filtered chunk */
bt2_udata.rec = &rec;
rec.addr = udata->chunk_block.offset;
for(u = 0; u < (idx_info->layout->ndims - 1); u++)
rec.scaled[u] = udata->common.scaled[u];
- }
+ } /* end else */
if(udata->need_modify) {
HDassert(idx_info->pline->nused > 0);
/* Modify record for filtered object in v2 B-tree */
- if(H5B2_modify(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_mod_filt_cb, &filt_rec) < 0)
+ if(H5B2_modify(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_mod_filt_cb, &filt_rec) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree")
- } else {
-
+ } /* end if */
+ else {
/* Insert record for object in v2 B-tree */
if(H5B2_insert(bt2, idx_info->dxpl_id, &bt2_udata) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "couldn't insert record in v2 B-tree")
- }
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "couldn't insert record in v2 B-tree")
+ } /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_idx_insert_addr() */
+} /* H5D__bt2_idx_insert_addr() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_found_cb
+ * Function: H5D__bt2_found_cb
*
* Purpose: Retrieve record (non-filtered) for dataset chunk when it is found
* in the v2 B-tree.
* This is the callback for H5B2_find() which is called in
- * H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert().
+ * H5D__bt2_idx_get_addr() and H5D_bt2_idx_insert().
*
* Return: Success: non-negative
* Failure: negative
@@ -1130,23 +1131,23 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_found_cb(const void *nrecord, void *op_data)
+H5D__bt2_found_cb(const void *nrecord, void *op_data)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
*(H5D_bt2_rec_t *)op_data = *(const H5D_bt2_rec_t *)nrecord;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_found_cb() */
+} /* H5D__bt2_found_cb() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_found_cb
+ * Function: H5D__bt2_filt_found_cb
*
* Purpose: Retrieve record (filtered) for dataset chunk when it is found
* in the v2 B-tree.
* This is the callback for H5B2_find() which is called in
- * H5D_bt2_idx_get_addr() and H5D_bt2_idx_insert().
+ * H5D__bt2_idx_get_addr() and H5D_bt2_idx_insert().
*
* Return: Success: non-negative
* Failure: negative
@@ -1156,18 +1157,18 @@ H5D_bt2_found_cb(const void *nrecord, void *op_data)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_found_cb(const void *nrecord, void *op_data)
+H5D__bt2_filt_found_cb(const void *nrecord, void *op_data)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
*(H5D_bt2_filt_rec_t *)op_data = *(const H5D_bt2_filt_rec_t *)nrecord;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5D_bt2_filt_found_cb() */
+} /* H5D__bt2_filt_found_cb() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_get_addr
+ * Function: H5D__bt2_idx_get_addr
*
* Purpose: Get the file address of a chunk if file space has been
* assigned. Save the retrieved information in the udata
@@ -1180,15 +1181,16 @@ H5D_bt2_filt_found_cb(const void *nrecord, void *op_data)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
+H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
{
H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
H5D_bt2_find_ud_t bt2_udata; /* User data for v2 B-tree calls */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
HDassert(idx_info);
HDassert(idx_info->f);
HDassert(idx_info->pline);
@@ -1201,7 +1203,7 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
- if(H5D_bt2_idx_open(idx_info) < 0)
+ if(H5D__bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
@@ -1228,7 +1230,7 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
bt2_udata.rdcc = udata->common.rdcc;
/* Go get chunk information from v2 B-tree */
- if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_filt_found_cb, &found_rec) < 0)
+ if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_filt_found_cb, &found_rec) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree")
/* Set info for the chunk */
@@ -1254,7 +1256,7 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
bt2_udata.rdcc = udata->common.rdcc;
/* Go get chunk information from v2 B-tree */
- if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D_bt2_found_cb, &found_rec) < 0)
+ if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_found_cb, &found_rec) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree")
udata->chunk_block.offset = found_rec.addr;
@@ -1269,17 +1271,17 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_idx_get_addr() */
+} /* H5D__bt2_idx_get_addr() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_iterate_cb
+ * Function: H5D__bt2_idx_iterate_cb
*
* Purpose: Translate the B-tree specific chunk record into a generic
* form and make the callback to the generic chunk callback
* routine.
* This is the callback for H5B2_iterate() which is called in
- * H5D_bt2_idx_iterate().
+ * H5D__bt2_idx_iterate().
*
* Return: Success: Non-negative
* Failure: Negative
@@ -1289,13 +1291,13 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5D_bt2_idx_iterate_cb(const void *_record, void *_udata)
+H5D__bt2_idx_iterate_cb(const void *_record, void *_udata)
{
H5D_bt2_it_ud_t *udata = (H5D_bt2_it_ud_t *)_udata; /* User data */
unsigned u; /* Local index variable */
int ret_value =-1; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Compose generic chunk record for callback */
if(udata->filtered) { /* filtered record */
@@ -1323,11 +1325,11 @@ H5D_bt2_idx_iterate_cb(const void *_record, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_idx_iterate_cb() */
+} /* H5D__bt2_idx_iterate_cb() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_iterate
+ * Function: H5D__bt2_idx_iterate
*
* Purpose: Iterate over the chunks in an index, making a callback
* for each one.
@@ -1339,15 +1341,16 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
+H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_cb_func_t chunk_cb, void *chunk_udata)
{
H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
H5D_bt2_it_ud_t udata; /* User data for B-tree iterator callback */
- int ret_value; /* Return value */
+ int ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
HDassert(idx_info);
HDassert(idx_info->f);
HDassert(idx_info->pline);
@@ -1368,7 +1371,7 @@ H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
/* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
- if(H5D_bt2_idx_open(idx_info) < 0)
+ if(H5D__bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
@@ -1380,21 +1383,21 @@ H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info,
udata.udata = chunk_udata;
/* Iterate over the records in the v2 B-tree */
- if((ret_value = H5B2_iterate(bt2, idx_info->dxpl_id, H5D_bt2_idx_iterate_cb, &udata)) < 0)
+ if((ret_value = H5B2_iterate(bt2, idx_info->dxpl_id, H5D__bt2_idx_iterate_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over v2 B-tree for dataset chunks");
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_iterate() */
+} /* end H5D__bt2_idx_iterate() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_remove_cb()
+ * Function: H5D__bt2_remove_cb()
*
* Purpose: Free space for 'dataset chunk' object as v2 B-tree
* is being deleted or v2 B-tree node is removed.
* This is the callback for H5B2_remove() and H5B2_delete() which
- * which are called in H5D_bt2_idx_remove() and H5D_bt2_idx_delete().
+ * which are called in H5D__bt2_idx_remove() and H5D__bt2_idx_delete().
*
* Return: Success: non-negative
* Failure: negative
@@ -1404,12 +1407,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_remove_cb(const void *record, void *_udata)
+H5D__bt2_remove_cb(const void *record, void *_udata)
{
H5D_bt2_remove_ud_t *udata = (H5D_bt2_remove_ud_t *)_udata; /* User data for removal callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Free the space in the file for the object being removed */
H5_CHECK_OVERFLOW(udata->unfilt_size, uint32_t, hsize_t);
@@ -1418,16 +1421,16 @@ H5D_bt2_remove_cb(const void *record, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_remove_cb() */
+} /* H5D__bt2_remove_cb() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_filt_remove_cb
+ * Function: H5D__bt2_filt_remove_cb
*
* Purpose: Free space for 'filtered dataset chunk' object as v2 B-tree
* is being deleted or v2 B-tree node is removed
* This is the callback for H5B2_remove() and H5B2_delete() which
- * which are called in H5D_bt2_idx_remove() and H5D_bt2_idx_delete().
+ * which are called in H5D__bt2_idx_remove() and H5D__bt2_idx_delete().
*
* Return: Success: non-negative
* Failure: negative
@@ -1437,13 +1440,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_filt_remove_cb(const void *_record, void *_udata)
+H5D__bt2_filt_remove_cb(const void *_record, void *_udata)
{
H5D_bt2_remove_ud_t *udata = (H5D_bt2_remove_ud_t *)_udata; /* User data for removal callback */
const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Free the space in the file for the object being removed */
H5_CHECK_OVERFLOW(record->nbytes, uint32_t, hsize_t);
@@ -1452,11 +1455,11 @@ H5D_bt2_filt_remove_cb(const void *_record, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_filt_remove_cb() */
+} /* H5D__bt2_filt_remove_cb() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_remove
+ * Function: H5D__bt2_idx_remove
*
* Purpose: Remove chunk from index.
*
@@ -1467,7 +1470,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata)
+H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata)
{
H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */
H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */
@@ -1475,8 +1478,9 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
HDassert(idx_info);
HDassert(idx_info->f);
HDassert(idx_info->pline);
@@ -1488,7 +1492,7 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
/* Check if the v2 B-tree is open yet */
if(NULL == idx_info->storage->u.btree2.bt2) {
/* Open existing v2 B-tree */
- if(H5D_bt2_idx_open(idx_info) < 0)
+ if(H5D__bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
@@ -1513,7 +1517,7 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
bt2_udata.layout = idx_info->layout;
bt2_udata.rdcc = udata->rdcc;
- if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D_bt2_filt_remove_cb, &remove_udata) < 0)
+ if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D__bt2_filt_remove_cb, &remove_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree")
} /* end if */
else { /* non-filtered chunk */
@@ -1530,17 +1534,17 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud
bt2_udata.layout = idx_info->layout;
bt2_udata.rdcc = udata->rdcc;
- if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D_bt2_remove_cb, &remove_udata) < 0)
+ if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D__bt2_remove_cb, &remove_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree")
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_bt2_idx_remove() */
+} /* H5D__bt2_idx_remove() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_delete
+ * Function: H5D__bt2_idx_delete
*
* Purpose: Delete index and raw data storage for entire dataset
* (i.e. all chunks)
@@ -1560,7 +1564,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_delete(const H5D_chk_idx_info_t *idx_info)
+H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info)
{
H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */
H5B2_remove_t remove_op; /* The removal callback */
@@ -1569,7 +1573,7 @@ H5D_bt2_idx_delete(const H5D_chk_idx_info_t *idx_info)
H5O_proxy_t *oh_proxy = NULL; /* Dataset's object header proxy */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(idx_info);
@@ -1595,9 +1599,9 @@ H5D_bt2_idx_delete(const H5D_chk_idx_info_t *idx_info)
remove_op = NULL;
else {
if(idx_info->pline->nused > 0) /* filtered */
- remove_op = H5D_bt2_filt_remove_cb;
+ remove_op = H5D__bt2_filt_remove_cb;
else { /* non-filtered */
- remove_op = H5D_bt2_remove_cb;
+ remove_op = H5D__bt2_remove_cb;
remove_udata.unfilt_size = idx_info->layout->size;
} /* end else */
} /* end else */
@@ -1627,11 +1631,11 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header proxy")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_delete() */
+} /* end H5D__bt2_idx_delete() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_copy_setup
+ * Function: H5D__bt2_idx_copy_setup
*
* Purpose: Set up any necessary information for copying chunks
*
@@ -1642,12 +1646,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
const H5D_chk_idx_info_t *idx_info_dst)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Source file */
HDassert(idx_info_src);
@@ -1666,7 +1670,7 @@ H5D_bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
/* Check if the source v2 B-tree is open yet */
if(NULL == idx_info_src->storage->u.btree2.bt2) {
- if(H5D_bt2_idx_open(idx_info_src) < 0)
+ if(H5D__bt2_idx_open(idx_info_src) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
} /* end if */
@@ -1674,7 +1678,7 @@ H5D_bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL);
/* Create v2 B-tree that describes the chunked dataset in the destination file */
- if(H5D_bt2_idx_create(idx_info_dst) < 0)
+ if(H5D__bt2_idx_create(idx_info_dst) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage")
HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr));
@@ -1683,11 +1687,11 @@ H5D_bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_copy_setup() */
+} /* end H5D__bt2_idx_copy_setup() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_copy_shutdown
+ * Function: H5D__bt2_idx_copy_shutdown
*
* Purpose: Shutdown any information from copying chunks
*
@@ -1698,12 +1702,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src,
+H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src,
H5O_storage_chunk_t *storage_dst, hid_t H5_ATTR_UNUSED dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(storage_src);
@@ -1723,11 +1727,11 @@ H5D_bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_copy_shutdown() */
+} /* end H5D__bt2_idx_copy_shutdown() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_size
+ * Function: H5D__bt2_idx_size
*
* Purpose: Retrieve the amount of index storage for chunked dataset
*
@@ -1739,12 +1743,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
+H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
{
H5B2_t *bt2_cdset = NULL; /* Pointer to v2 B-tree structure */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(idx_info);
@@ -1756,7 +1760,7 @@ H5D_bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
HDassert(index_size);
/* Open v2 B-tree */
- if(H5D_bt2_idx_open(idx_info) < 0)
+ if(H5D__bt2_idx_open(idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree")
/* Set convenience pointer to v2 B-tree structure */
@@ -1772,11 +1776,11 @@ done:
idx_info->storage->u.btree2.bt2 = NULL;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_size() */
+} /* end H5D__bt2_idx_size() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_reset
+ * Function: H5D__bt2_idx_reset
*
* Purpose: Reset indexing information.
*
@@ -1787,9 +1791,9 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
+H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(storage);
@@ -1799,11 +1803,11 @@ H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
storage->u.btree2.bt2 = NULL;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_bt2_idx_reset() */
+} /* end H5D__bt2_idx_reset() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_dump
+ * Function: H5D__bt2_idx_dump
*
* Purpose: Dump indexing information to a stream.
*
@@ -1814,9 +1818,9 @@ H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
+H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(storage);
HDassert(stream);
@@ -1824,11 +1828,11 @@ H5D_bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
HDfprintf(stream, " Address: %a\n", storage->idx_addr);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_bt2_idx_dump() */
+} /* end H5D__bt2_idx_dump() */
/*-------------------------------------------------------------------------
- * Function: H5D_bt2_idx_dest
+ * Function: H5D__bt2_idx_dest
*
* Purpose: Release indexing information in memory.
*
@@ -1839,11 +1843,11 @@ H5D_bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_bt2_idx_dest(const H5D_chk_idx_info_t *idx_info)
+H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(idx_info);
@@ -1860,5 +1864,5 @@ H5D_bt2_idx_dest(const H5D_chk_idx_info_t *idx_info)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_bt2_idx_dest() */
+} /* end H5D__bt2_idx_dest() */
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index caea0b9..7090727 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -3901,11 +3901,12 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
/* Make sure the chunk is really in the dataset and outside the
* original dimensions */
{
- unsigned u; /* Local index variable */
+ unsigned v; /* Local index variable */
hbool_t outside_orig = FALSE;
- for(u = 0; u < space_ndims; u++) {
- HDassert((scaled[u] * chunk_dim[u]) < space_dim[u]);
- if((scaled[u] * chunk_dim[u]) >= old_dim[u])
+
+ for(v = 0; v < space_ndims; v++) {
+ HDassert((scaled[v] * chunk_dim[v]) < space_dim[v]);
+ if((scaled[v] * chunk_dim[v]) >= old_dim[v])
outside_orig = TRUE;
} /* end for */
HDassert(outside_orig);
@@ -4656,7 +4657,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
hbool_t fill_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension needs to be filled */
hsize_t min_partial_chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of first partial (or empty) chunk in each dimension */
hbool_t new_unfilt_dim[H5O_LAYOUT_NDIMS]; /* Whether the plane of edge chunks in this dimension are newly unfiltered */
- hbool_t has_fill = FALSE; /* Whether there are chunks that must be filled */
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5D_io_info_t chk_io_info; /* Chunked I/O info object */
H5D_storage_t chk_store; /* Chunk storage information */
@@ -4794,7 +4794,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
/* Determine if we need to fill chunks in this dimension */
if((hssize_t)min_mod_chunk_sc[op_dim] == max_fill_chunk_sc[op_dim]) {
fill_dim[op_dim] = TRUE;
- has_fill = TRUE;
/* If necessary, check if chunks in this dimension that need to
* be filled are new partial edge chunks */
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index b42177e..9b852a5 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -94,14 +94,11 @@ typedef struct H5D_earray_filt_elmt_t {
/* Local Prototypes */
/********************/
/* Extensible array iterator callbacks */
-static int H5D_earray_idx_iterate_cb(hsize_t idx, const void *_elmt, void *_udata);
-static int H5D_earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
-
-/* Extensible Array iterator callbacks */
-static int H5D_earray_idx_iterate_cb(hsize_t idx, const void *_elmt, void *_udata);
+static int H5D__earray_idx_iterate_cb(hsize_t idx, const void *_elmt, void *_udata);
+static int H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
/* Extensible array class callbacks for chunks w/o filters */
-static void *H5D_earray_crt_context(void *udata);
+static void *H5D__earray_crt_context(void *udata);
static herr_t H5D_earray_dst_context(void *ctx);
static herr_t H5D_earray_fill(void *nat_blk, size_t nelmts);
static herr_t H5D_earray_encode(void *raw, const void *elmt, size_t nelmts, void *ctx);
@@ -126,7 +123,7 @@ static herr_t H5D_earray_idx_init(const H5D_chk_idx_info_t *idx_info,
static herr_t H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D_earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D_earray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, H5D_t *dset);
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
static herr_t H5D_earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
static herr_t H5D_earray_idx_resize(H5O_layout_chunk_t *layout);
@@ -154,21 +151,21 @@ static herr_t H5D_earray_idx_dest(const H5D_chk_idx_info_t *idx_info);
/* Extensible array indexed chunk I/O ops */
const H5D_chunk_ops_t H5D_COPS_EARRAY[1] = {{
TRUE, /* Extensible array indices support SWMR access */
- H5D_earray_idx_init,
- H5D_earray_idx_create,
- H5D_earray_idx_is_space_alloc,
- H5D_earray_idx_insert_addr,
- H5D_earray_idx_get_addr,
- H5D_earray_idx_resize,
- H5D_earray_idx_iterate,
- H5D_earray_idx_remove,
- H5D_earray_idx_delete,
- H5D_earray_idx_copy_setup,
- H5D_earray_idx_copy_shutdown,
- H5D_earray_idx_size,
- H5D_earray_idx_reset,
- H5D_earray_idx_dump,
- H5D_earray_idx_dest
+ H5D_earray_idx_init, /* init */
+ H5D_earray_idx_create, /* create */
+ H5D_earray_idx_is_space_alloc, /* is_space_alloc */
+ H5D_earray_idx_insert_addr, /* insert */
+ H5D_earray_idx_get_addr, /* get_addr */
+ H5D_earray_idx_resize, /* resize */
+ H5D_earray_idx_iterate, /* iterate */
+ H5D_earray_idx_remove, /* remove */
+ H5D_earray_idx_delete, /* delete */
+ H5D_earray_idx_copy_setup, /* copy_setup */
+ H5D_earray_idx_copy_shutdown, /* copy_shutdown */
+ H5D_earray_idx_size, /* size */
+ H5D_earray_idx_reset, /* reset */
+ H5D_earray_idx_dump, /* dump */
+ H5D_earray_idx_dest /* destroy */
}};
@@ -181,7 +178,7 @@ const H5EA_class_t H5EA_CLS_CHUNK[1]={{
H5EA_CLS_CHUNK_ID, /* Type of extensible array */
"Chunk w/o filters", /* Name of extensible array class */
sizeof(haddr_t), /* Size of native element */
- H5D_earray_crt_context, /* Create context */
+ H5D__earray_crt_context, /* Create context */
H5D_earray_dst_context, /* Destroy context */
H5D_earray_fill, /* Fill block of missing elements callback */
H5D_earray_encode, /* Element encoding callback */
@@ -196,7 +193,7 @@ const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]={{
H5EA_CLS_FILT_CHUNK_ID, /* Type of extensible array */
"Chunk w/filters", /* Name of extensible array class */
sizeof(H5D_earray_filt_elmt_t), /* Size of native element */
- H5D_earray_crt_context, /* Create context */
+ H5D__earray_crt_context, /* Create context */
H5D_earray_dst_context, /* Destroy context */
H5D_earray_filt_fill, /* Fill block of missing elements callback */
H5D_earray_filt_encode, /* Element encoding callback */
@@ -219,7 +216,7 @@ H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t);
/*-------------------------------------------------------------------------
- * Function: H5D_earray_crt_context
+ * Function: H5D__earray_crt_context
*
* Purpose: Create context for callbacks
*
@@ -232,13 +229,13 @@ H5FL_DEFINE_STATIC(H5D_earray_ctx_ud_t);
*-------------------------------------------------------------------------
*/
static void *
-H5D_earray_crt_context(void *_udata)
+H5D__earray_crt_context(void *_udata)
{
H5D_earray_ctx_t *ctx; /* Extensible array callback context */
H5D_earray_ctx_ud_t *udata = (H5D_earray_ctx_ud_t *)_udata; /* User data for extensible array context */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(udata);
@@ -264,7 +261,7 @@ H5D_earray_crt_context(void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_earray_crt_context() */
+} /* end H5D__earray_crt_context() */
/*-------------------------------------------------------------------------
@@ -1078,7 +1075,8 @@ H5D_earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_earray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, H5D_t H5_ATTR_UNUSED *dset)
+H5D_earray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t H5_ATTR_UNUSED *dset)
{
H5EA_t *ea; /* Pointer to extensible array structure */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1269,7 +1267,7 @@ done:
} /* end H5D_earray_idx_resize() */
/*-------------------------------------------------------------------------
- * Function: H5D_earray_idx_iterate_cb
+ * Function: H5D__earray_idx_iterate_cb
*
* Purpose: Callback routine for extensible array element iteration.
*
@@ -1280,14 +1278,14 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5D_earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_udata)
+H5D__earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_udata)
{
H5D_earray_it_ud_t *udata = (H5D_earray_it_ud_t *)_udata; /* User data */
unsigned ndims; /* Rank of chunk */
int curr_dim; /* Current dimension */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Compose generic chunk record for callback */
if(udata->filtered) {
@@ -1301,10 +1299,9 @@ H5D_earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_
udata->chunk_rec.chunk_addr = *(const haddr_t *)_elmt;
/* Make "generic chunk" callback */
- if(H5F_addr_defined(udata->chunk_rec.chunk_addr)) {
+ if(H5F_addr_defined(udata->chunk_rec.chunk_addr))
if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
- }
/* Update coordinates of chunk in dataset */
ndims = udata->common.layout->ndims - 1;
@@ -1313,6 +1310,7 @@ H5D_earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_
while(curr_dim >= 0) {
/* Increment coordinate in current dimension */
udata->chunk_rec.scaled[curr_dim]++;
+
/* Check if we went off the end of the current dimension */
if(udata->chunk_rec.scaled[curr_dim] >= udata->common.layout->chunks[curr_dim]) {
/* Reset coordinate & move to next faster dimension */
@@ -1324,7 +1322,7 @@ H5D_earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_
} /* end while */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_earray_idx_iterate_cb() */
+} /* H5D__earray_idx_iterate_cb() */
/*-------------------------------------------------------------------------
@@ -1378,7 +1376,6 @@ H5D_earray_idx_iterate(const H5D_chk_idx_info_t *idx_info,
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query extensible array statistics")
if(ea_stat.stored.max_idx_set > 0) {
-
H5D_earray_it_ud_t udata; /* User data for iteration callback */
/* Initialize userdata */
@@ -1396,9 +1393,9 @@ H5D_earray_idx_iterate(const H5D_chk_idx_info_t *idx_info,
udata.udata = chunk_udata;
/* Iterate over the extensible array elements */
- if((ret_value = H5EA_iterate(ea, idx_info->dxpl_id, H5D_earray_idx_iterate_cb, &udata)) < 0)
+ if((ret_value = H5EA_iterate(ea, idx_info->dxpl_id, H5D__earray_idx_iterate_cb, &udata)) < 0)
HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index");
- }
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1514,7 +1511,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D_earray_idx_delete_cb
+ * Function: H5D__earray_idx_delete_cb
*
* Purpose: Delete space for chunk in file
*
@@ -1527,12 +1524,12 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5D_earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
+H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
{
H5D_earray_ud_t *udata = (H5D_earray_ud_t *)_udata; /* User data for callback */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(chunk_rec);
@@ -1548,7 +1545,7 @@ H5D_earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_earray_idx_delete_cb() */
+} /* end H5D__earray_idx_delete_cb() */
/*-------------------------------------------------------------------------
@@ -1593,7 +1590,7 @@ H5D_earray_idx_delete(const H5D_chk_idx_info_t *idx_info)
udata.dxpl_id = idx_info->dxpl_id;
/* Iterate over the chunk addresses in the extensible array, deleting each chunk */
- if(H5D_earray_idx_iterate(idx_info, H5D_earray_idx_delete_cb, &udata) < 0)
+ if(H5D_earray_idx_iterate(idx_info, H5D__earray_idx_delete_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses")
/* Close extensible array */
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index b3893c6..70e3513 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -96,11 +96,11 @@ typedef struct H5D_farray_filt_elmt_t {
/********************/
/* Fixed Array iterator callbacks */
-static int H5D_farray_idx_iterate_cb(hsize_t idx, const void *_elmt, void *_udata);
-static int H5D_farray_idx_delete_cb(hsize_t idx, const void *_elmt, void *_udata);
+static int H5D__farray_idx_iterate_cb(hsize_t idx, const void *_elmt, void *_udata);
+static int H5D__farray_idx_delete_cb(hsize_t idx, const void *_elmt, void *_udata);
/* Fixed array class callbacks for chunks w/o filters */
-static void *H5D_farray_crt_context(void *udata);
+static void *H5D__farray_crt_context(void *udata);
static herr_t H5D_farray_dst_context(void *ctx);
static herr_t H5D_farray_fill(void *nat_blk, size_t nelmts);
static herr_t H5D_farray_encode(void *raw, const void *elmt, size_t nelmts,
@@ -129,7 +129,7 @@ static herr_t H5D_farray_idx_init(const H5D_chk_idx_info_t *idx_info,
static herr_t H5D_farray_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D_farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D_farray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, H5D_t *dset);
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
static herr_t H5D_farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
static int H5D_farray_idx_iterate(const H5D_chk_idx_info_t *idx_info,
@@ -154,22 +154,22 @@ static herr_t H5D_farray_idx_dest(const H5D_chk_idx_info_t *idx_info);
/* Fixed array indexed chunk I/O ops */
const H5D_chunk_ops_t H5D_COPS_FARRAY[1] = {{
- TRUE, /* Fixed array indices support SWMR access */
- H5D_farray_idx_init,
- H5D_farray_idx_create,
- H5D_farray_idx_is_space_alloc,
- H5D_farray_idx_insert_addr,
- H5D_farray_idx_get_addr,
- NULL,
- H5D_farray_idx_iterate,
- H5D_farray_idx_remove,
- H5D_farray_idx_delete,
- H5D_farray_idx_copy_setup,
- H5D_farray_idx_copy_shutdown,
- H5D_farray_idx_size,
- H5D_farray_idx_reset,
- H5D_farray_idx_dump,
- H5D_farray_idx_dest
+ TRUE, /* Fixed array indices support SWMR access */
+ H5D_farray_idx_init, /* init */
+ H5D_farray_idx_create, /* create */
+ H5D_farray_idx_is_space_alloc, /* is_space_alloc */
+ H5D_farray_idx_insert_addr, /* insert */
+ H5D_farray_idx_get_addr, /* get_addr */
+ NULL, /* resize */
+ H5D_farray_idx_iterate, /* iterate */
+ H5D_farray_idx_remove, /* remove */
+ H5D_farray_idx_delete, /* delete */
+ H5D_farray_idx_copy_setup, /* copy_setup */
+ H5D_farray_idx_copy_shutdown, /* copy_shutdown */
+ H5D_farray_idx_size, /* size */
+ H5D_farray_idx_reset, /* reset */
+ H5D_farray_idx_dump, /* dump */
+ H5D_farray_idx_dest /* destroy */
}};
@@ -187,7 +187,7 @@ const H5FA_class_t H5FA_CLS_CHUNK[1]={{
H5FA_CLS_CHUNK_ID, /* Type of fixed array */
"Chunk w/o filters", /* Name of fixed array class */
sizeof(haddr_t), /* Size of native element */
- H5D_farray_crt_context, /* Create context */
+ H5D__farray_crt_context, /* Create context */
H5D_farray_dst_context, /* Destroy context */
H5D_farray_fill, /* Fill block of missing elements callback */
H5D_farray_encode, /* Element encoding callback */
@@ -202,7 +202,7 @@ const H5FA_class_t H5FA_CLS_FILT_CHUNK[1]={{
H5FA_CLS_FILT_CHUNK_ID, /* Type of fixed array */
"Chunk w/filters", /* Name of fixed array class */
sizeof(H5D_farray_filt_elmt_t), /* Size of native element */
- H5D_farray_crt_context, /* Create context */
+ H5D__farray_crt_context, /* Create context */
H5D_farray_dst_context, /* Destroy context */
H5D_farray_filt_fill, /* Fill block of missing elements callback */
H5D_farray_filt_encode, /* Element encoding callback */
@@ -220,7 +220,7 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t);
/*-------------------------------------------------------------------------
- * Function: H5D_farray_crt_context
+ * Function: H5D__farray_crt_context
*
* Purpose: Create context for callbacks
*
@@ -233,13 +233,13 @@ H5FL_DEFINE_STATIC(H5D_farray_ctx_ud_t);
*-------------------------------------------------------------------------
*/
static void *
-H5D_farray_crt_context(void *_udata)
+H5D__farray_crt_context(void *_udata)
{
H5D_farray_ctx_t *ctx; /* Fixed array callback context */
H5D_farray_ctx_ud_t *udata = (H5D_farray_ctx_ud_t *)_udata; /* User data for fixed array context */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(udata);
@@ -265,7 +265,7 @@ H5D_farray_crt_context(void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_farray_crt_context() */
+} /* end H5D__farray_crt_context() */
/*-------------------------------------------------------------------------
@@ -1033,7 +1033,8 @@ H5D_farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_farray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, H5D_t H5_ATTR_UNUSED *dset)
+H5D_farray_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t H5_ATTR_UNUSED *dset)
{
H5FA_t *fa; /* Pointer to fixed array structure */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1169,7 +1170,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D_farray_idx_iterate_cb
+ * Function: H5D__farray_idx_iterate_cb
*
* Purpose: Callback routine for fixed array element iteration.
*
@@ -1186,14 +1187,14 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5D_farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_udata)
+H5D__farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_udata)
{
H5D_farray_it_ud_t *udata = (H5D_farray_it_ud_t *)_udata; /* User data */
unsigned ndims; /* Rank of chunk */
int curr_dim; /* Current dimension */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Compose generic chunk record for callback */
if(udata->filtered) {
@@ -1207,10 +1208,9 @@ H5D_farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_
udata->chunk_rec.chunk_addr = *(const haddr_t *)_elmt;
/* Make "generic chunk" callback */
- if(H5F_addr_defined(udata->chunk_rec.chunk_addr)) {
+ if(H5F_addr_defined(udata->chunk_rec.chunk_addr))
if((ret_value = (udata->cb)(&udata->chunk_rec, udata->udata)) < 0)
HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
- }
/* Update coordinates of chunk in dataset */
ndims = udata->common.layout->ndims - 1;
@@ -1231,7 +1231,7 @@ H5D_farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_
} /* end while */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_farray_idx_iterate_cb() */
+} /* H5D__farray_idx_iterate_cb() */
/*-------------------------------------------------------------------------
@@ -1299,7 +1299,7 @@ H5D_farray_idx_iterate(const H5D_chk_idx_info_t *idx_info,
udata.udata = chunk_udata;
/* Iterate over the fixed array elements */
- if((ret_value = H5FA_iterate(fa, idx_info->dxpl_id, H5D_farray_idx_iterate_cb, &udata)) < 0)
+ if((ret_value = H5FA_iterate(fa, idx_info->dxpl_id, H5D__farray_idx_iterate_cb, &udata)) < 0)
HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index");
} /* end if */
@@ -1401,7 +1401,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D_farray_idx_delete_cb
+ * Function: H5D__farray_idx_delete_cb
*
* Purpose: Delete space for chunk in file
*
@@ -1414,14 +1414,14 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5D_farray_idx_delete_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_udata)
+H5D__farray_idx_delete_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_udata)
{
H5D_farray_del_ud_t *udata = (H5D_farray_del_ud_t *)_udata; /* User data for callback */
haddr_t chunk_addr; /* Address of chunk */
uint32_t nbytes; /* Size of chunk */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(_elmt);
@@ -1447,7 +1447,7 @@ H5D_farray_idx_delete_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void *_u
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_farray_idx_delete_cb() */
+} /* end H5D__farray_idx_delete_cb() */
/*-------------------------------------------------------------------------
@@ -1509,7 +1509,7 @@ H5D_farray_idx_delete(const H5D_chk_idx_info_t *idx_info)
udata.unfilt_size = idx_info->layout->size;
/* Iterate over the chunk addresses in the fixed array, deleting each chunk */
- if(H5FA_iterate(fa, idx_info->dxpl_id, H5D_farray_idx_delete_cb, &udata) < 0)
+ if(H5FA_iterate(fa, idx_info->dxpl_id, H5D__farray_idx_delete_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses")
} /* end if */
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index f4e5b15..5a0e26b 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -121,6 +121,7 @@ H5D__layout_set_io_ops(const H5D_t *dataset)
dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_BT2;
break;
+ case H5D_CHUNK_IDX_NTYPES:
default:
HDassert(0 && "Unknown chunk index method!");
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown chunk index method")
@@ -221,6 +222,9 @@ H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t includ
ret_value++;
switch(layout->u.chunk.idx_type) {
+ case H5D_CHUNK_IDX_BTREE:
+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, 0, "v1 B-tree index type found for layout message >v3")
+
case H5D_CHUNK_IDX_NONE:
/* nothing */
break;
@@ -230,7 +234,7 @@ H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t includ
if(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) {
ret_value += H5F_SIZEOF_SIZE(f); /* Size of chunk (in file) */
ret_value += 4; /* Filter mask for chunk */
- }
+ } /* end if */
break;
case H5D_CHUNK_IDX_FARRAY:
@@ -248,6 +252,7 @@ H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t includ
ret_value += H5D_BT2_CREATE_PARAM_SIZE;
break;
+ case H5D_CHUNK_IDX_NTYPES:
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid chunk index type")
} /* end switch */
diff --git a/src/H5Dnone.c b/src/H5Dnone.c
index d5e12ef..f30b5c0 100644
--- a/src/H5Dnone.c
+++ b/src/H5Dnone.c
@@ -57,8 +57,8 @@
/********************/
/* Non Index chunking I/O ops */
-static herr_t H5D_none_idx_create(const H5D_chk_idx_info_t *idx_info);
-static hbool_t H5D_none_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
+static herr_t H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info);
+static hbool_t H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D_none_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
static int H5D_none_idx_iterate(const H5D_chk_idx_info_t *idx_info,
@@ -81,8 +81,8 @@ static herr_t H5D_none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream
const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{
FALSE, /* Non-indexed chunking don't current support SWMR access */
NULL, /* init */
- H5D_none_idx_create, /* create */
- H5D_none_idx_is_space_alloc, /* is_space_alloc */
+ H5D__none_idx_create, /* create */
+ H5D__none_idx_is_space_alloc, /* is_space_alloc */
NULL, /* insert */
H5D_none_idx_get_addr, /* get_addr */
NULL, /* resize */
@@ -108,7 +108,7 @@ const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{
/*-------------------------------------------------------------------------
- * Function: H5D_none_idx_create
+ * Function: H5D__none_idx_create
*
* Purpose: Allocate memory for the maximum # of chunks in the dataset.
*
@@ -120,13 +120,13 @@ const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_none_idx_create(const H5D_chk_idx_info_t *idx_info)
+H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info)
{
hsize_t nbytes; /* Total size of dataset chunks */
haddr_t addr; /* The address of dataset chunks */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(idx_info);
@@ -151,11 +151,11 @@ H5D_none_idx_create(const H5D_chk_idx_info_t *idx_info)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D_none_idx_create() */
+} /* end H5D__none_idx_create() */
/*-------------------------------------------------------------------------
- * Function: H5D_none_idx_is_space_alloc
+ * Function: H5D__none_idx_is_space_alloc
*
* Purpose: Query if space for the dataset chunks is allocated
*
@@ -166,15 +166,15 @@ done:
*-------------------------------------------------------------------------
*/
static hbool_t
-H5D_none_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
+H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(storage);
FUNC_LEAVE_NOAPI((hbool_t)H5F_addr_defined(storage->idx_addr))
-} /* end H5D_none_idx_is_space_alloc() */
+} /* end H5D__none_idx_is_space_alloc() */
/*-------------------------------------------------------------------------
@@ -398,7 +398,7 @@ H5D_none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL);
/* Allocate dataset chunks in the dest. file */
- if(H5D_none_idx_create(idx_info_dst) < 0)
+ if(H5D__none_idx_create(idx_info_dst) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage")
/* Reset metadata tag */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index bd669f2..e743f00 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -304,7 +304,7 @@ typedef herr_t (*H5D_chunk_init_func_t)(const H5D_chk_idx_info_t *idx_info,
typedef herr_t (*H5D_chunk_create_func_t)(const H5D_chk_idx_info_t *idx_info);
typedef hbool_t (*H5D_chunk_is_space_alloc_func_t)(const H5O_storage_chunk_t *storage);
typedef herr_t (*H5D_chunk_insert_func_t)(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, H5D_t *dset);
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
typedef herr_t (*H5D_chunk_get_addr_func_t)(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
typedef herr_t (*H5D_chunk_resize_func_t)(H5O_layout_chunk_t *layout);
diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c
index a7c348e..b44c752 100644
--- a/src/H5Dsingle.c
+++ b/src/H5Dsingle.c
@@ -55,11 +55,12 @@
/********************/
/* Single Chunk Index chunking I/O ops */
-static herr_t H5D_single_idx_init(const H5D_chk_idx_info_t *idx_info);
-static herr_t H5D_single_idx_create(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info,
+ const H5S_t *space, haddr_t dset_ohdr_addr);
+static herr_t H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info);
static hbool_t H5D_single_idx_is_space_alloc(const H5O_storage_chunk_t *storage);
static herr_t H5D_single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info,
- H5D_chunk_ud_t *udata, H5D_t *dset);
+ H5D_chunk_ud_t *udata, const H5D_t *dset);
static herr_t H5D_single_idx_get_addr(const H5D_chk_idx_info_t *idx_info,
H5D_chunk_ud_t *udata);
static int H5D_single_idx_iterate(const H5D_chk_idx_info_t *idx_info,
@@ -80,9 +81,9 @@ static herr_t H5D_single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stre
/* Non Index chunk I/O ops */
const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{
- FALSE, /* Single Chunk indexing don't current support SWMR access */
- H5D_single_idx_init, /* init */
- H5D_single_idx_create, /* create */
+ FALSE, /* Single Chunk indexing doesn't current support SWMR access */
+ H5D__single_idx_init, /* init */
+ H5D__single_idx_create, /* create */
H5D_single_idx_is_space_alloc, /* is_space_alloc */
H5D_single_idx_insert_addr, /* insert */
H5D_single_idx_get_addr, /* get_addr */
@@ -95,7 +96,7 @@ const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{
H5D_single_idx_size, /* size */
H5D_single_idx_reset, /* reset */
H5D_single_idx_dump, /* dump */
- NULL /* dest */
+ NULL /* destroy */
}};
/*****************************/
@@ -107,10 +108,25 @@ const H5D_chunk_ops_t H5D_COPS_SINGLE[1] = {{
/* Local Variables */
/*******************/
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D__single_idx_init
+ *
+ * Purpose: Initialize the indexing information for a dataset.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi
+ * July, 2011
+ *
+ *-------------------------------------------------------------------------
+ */
static herr_t
-H5D_single_idx_init(const H5D_chk_idx_info_t *idx_info)
+H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info,
+ const H5S_t H5_ATTR_UNUSED *space, haddr_t H5_ATTR_UNUSED dset_ohdr_addr)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(idx_info);
@@ -125,11 +141,11 @@ H5D_single_idx_init(const H5D_chk_idx_info_t *idx_info)
idx_info->layout->flags = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_single_idx_init() */
+} /* end H5D__single_idx_init() */
/*-------------------------------------------------------------------------
- * Function: H5D_single_idx_create
+ * Function: H5D__single_idx_create
*
* Purpose: Set up Single Chunk Index: filtered or non-filtered
*
@@ -141,9 +157,9 @@ H5D_single_idx_init(const H5D_chk_idx_info_t *idx_info)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_single_idx_create(const H5D_chk_idx_info_t *idx_info)
+H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(idx_info);
@@ -161,7 +177,7 @@ H5D_single_idx_create(const H5D_chk_idx_info_t *idx_info)
HDassert(!(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5D_single_idx_create() */
+} /* end H5D__single_idx_create() */
/*-------------------------------------------------------------------------
@@ -204,7 +220,8 @@ H5D_single_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, H5D_t *dset)
+H5D_single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata,
+ const H5D_t *dset)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -226,17 +243,15 @@ H5D_single_idx_insert_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *u
if(idx_info->pline->nused > 0) {
idx_info->storage->u.single.nbytes = udata->chunk_block.length;
idx_info->storage->u.single.filter_mask = udata->filter_mask;
- }
+ } /* end if */
if(dset) {
-
if(dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0) {
-
/* Mark the layout/storage dirty so that the address of the single chunk will be flushed later */
if(H5D__mark(dset, idx_info->dxpl_id, H5D_MARK_LAYOUT) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark layout as dirty")
- }
- }
+ } /* end if */
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -445,7 +460,7 @@ H5D_single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL);
/* Set up information at the destination file */
- if(H5D_single_idx_create(idx_info_dst) < 0)
+ if(H5D__single_idx_create(idx_info_dst) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage")
/* Reset metadata tag */
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index ebd291c..9f3a556 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -322,8 +322,9 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5G_BT2_NAME;
bt2_cparam.node_size = (size_t)H5G_NAME_BT2_NODE_SIZE;
+ H5_CHECK_OVERFLOW(fheap_id_len, /* From: */ hsize_t, /* To: */ uint32_t);
bt2_cparam.rrec_size = 4 + /* Name's hash value */
- fheap_id_len; /* Fractal heap ID */
+ (uint32_t)fheap_id_len; /* Fractal heap ID */
bt2_cparam.split_percent = H5G_NAME_BT2_SPLIT_PERC;
bt2_cparam.merge_percent = H5G_NAME_BT2_MERGE_PERC;
if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam, NULL, NULL)))
@@ -342,8 +343,9 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr)
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
bt2_cparam.cls = H5G_BT2_CORDER;
bt2_cparam.node_size = (size_t)H5G_CORDER_BT2_NODE_SIZE;
- bt2_cparam.rrec_size = 8 + /* Creation order value */
- fheap_id_len; /* Fractal heap ID */
+ H5_CHECK_OVERFLOW(fheap_id_len, /* From: */ hsize_t, /* To: */ uint32_t);
+ bt2_cparam.rrec_size = 8 + /* Creation order value */
+ (uint32_t)fheap_id_len; /* Fractal heap ID */
bt2_cparam.split_percent = H5G_CORDER_BT2_SPLIT_PERC;
bt2_cparam.merge_percent = H5G_CORDER_BT2_MERGE_PERC;
if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam, NULL, NULL)))
diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c
index 37aa53c..c167bb1 100644
--- a/src/H5HFbtree2.c
+++ b/src/H5HFbtree2.c
@@ -68,7 +68,7 @@ typedef struct H5HF_huge_bt2_ctx_t {
/* v2 B-tree driver callbacks */
-static void *H5HF_huge_bt2_crt_context(void *udata);
+static void *H5HF__huge_bt2_crt_context(void *udata);
static herr_t H5HF_huge_bt2_dst_context(void *ctx);
static void *H5HF_huge_bt2_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr);
@@ -116,7 +116,7 @@ const H5B2_class_t H5HF_HUGE_BT2_INDIR[1]={{ /* B-tree class information */
H5B2_FHEAP_HUGE_INDIR_ID, /* Type of B-tree */
"H5B2_FHEAP_HUGE_INDIR_ID", /* Name of B-tree class */
sizeof(H5HF_huge_bt2_indir_rec_t), /* Size of native record */
- H5HF_huge_bt2_crt_context, /* Create client callback context */
+ H5HF__huge_bt2_crt_context, /* Create client callback context */
H5HF_huge_bt2_dst_context, /* Destroy client callback context */
H5HF_huge_bt2_indir_store, /* Record storage callback */
H5HF_huge_bt2_indir_compare, /* Record comparison callback */
@@ -132,7 +132,7 @@ const H5B2_class_t H5HF_HUGE_BT2_FILT_INDIR[1]={{ /* B-tree class information */
H5B2_FHEAP_HUGE_FILT_INDIR_ID, /* Type of B-tree */
"H5B2_FHEAP_HUGE_FILT_INDIR_ID", /* Name of B-tree class */
sizeof(H5HF_huge_bt2_filt_indir_rec_t), /* Size of native record */
- H5HF_huge_bt2_crt_context, /* Create client callback context */
+ H5HF__huge_bt2_crt_context, /* Create client callback context */
H5HF_huge_bt2_dst_context, /* Destroy client callback context */
H5HF_huge_bt2_filt_indir_store, /* Record storage callback */
H5HF_huge_bt2_filt_indir_compare, /* Record comparison callback */
@@ -148,7 +148,7 @@ const H5B2_class_t H5HF_HUGE_BT2_DIR[1]={{ /* B-tree class information */
H5B2_FHEAP_HUGE_DIR_ID, /* Type of B-tree */
"H5B2_FHEAP_HUGE_DIR_ID", /* Name of B-tree class */
sizeof(H5HF_huge_bt2_dir_rec_t), /* Size of native record */
- H5HF_huge_bt2_crt_context, /* Create client callback context */
+ H5HF__huge_bt2_crt_context, /* Create client callback context */
H5HF_huge_bt2_dst_context, /* Destroy client callback context */
H5HF_huge_bt2_dir_store, /* Record storage callback */
H5HF_huge_bt2_dir_compare, /* Record comparison callback */
@@ -164,7 +164,7 @@ const H5B2_class_t H5HF_HUGE_BT2_FILT_DIR[1]={{ /* B-tree class information */
H5B2_FHEAP_HUGE_FILT_DIR_ID, /* Type of B-tree */
"H5B2_FHEAP_HUGE_FILT_DIR_ID", /* Name of B-tree class */
sizeof(H5HF_huge_bt2_filt_dir_rec_t), /* Size of native record */
- H5HF_huge_bt2_crt_context, /* Create client callback context */
+ H5HF__huge_bt2_crt_context, /* Create client callback context */
H5HF_huge_bt2_dst_context, /* Destroy client callback context */
H5HF_huge_bt2_filt_dir_store, /* Record storage callback */
H5HF_huge_bt2_filt_dir_compare, /* Record comparison callback */
@@ -190,7 +190,7 @@ H5FL_DEFINE_STATIC(H5HF_huge_bt2_ctx_t);
/*-------------------------------------------------------------------------
- * Function: H5HF_huge_bt2_crt_context
+ * Function: H5HF__huge_bt2_crt_context
*
* Purpose: Create client callback context
*
@@ -205,13 +205,13 @@ H5FL_DEFINE_STATIC(H5HF_huge_bt2_ctx_t);
*-------------------------------------------------------------------------
*/
static void *
-H5HF_huge_bt2_crt_context(void *_f)
+H5HF__huge_bt2_crt_context(void *_f)
{
H5F_t *f = (H5F_t *)_f; /* User data for building callback context */
H5HF_huge_bt2_ctx_t *ctx; /* Callback context structure */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -229,7 +229,7 @@ H5HF_huge_bt2_crt_context(void *_f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5HF_huge_bt2_crt_context() */
+} /* H5HF__huge_bt2_crt_context() */
/*-------------------------------------------------------------------------
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index ed45457..475c963 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -1727,7 +1727,6 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata)
H5HF_hdr_t *hdr; /* Shared fractal heap information */
H5HF_parent_t *par_info; /* Pointer to parent information */
uint32_t stored_chksum; /* Stored metadata checksum value */
- uint32_t t_chksum; /* Computed metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
size_t chk_size; /* The size for validating checksum */
uint8_t *chk_p; /* Pointer to the area for validating checksum */
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index eb4f155..73db840 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -460,7 +460,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr,
HDassert(dblock_size > 0);
/* only H5AC__READ_ONLY_FLAG may appear in flags */
- HDassert((flags & (~H5AC__READ_ONLY_FLAG)) == 0);
+ HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* Set up parent info */
udata.par_info.hdr = hdr;
@@ -543,7 +543,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off,
HDassert(ret_did_protect);
/* only H5AC__READ_ONLY_FLAG may appear in flags */
- HDassert((flags & (~H5AC__READ_ONLY_FLAG)) == 0);
+ HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* Look up row & column for object */
if(H5HF_dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0)
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index b46e0e0..8a5c3ff 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -463,13 +463,13 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
case 1: /* Set the length of heap IDs to just enough to hold the information needed to directly access 'huge' objects in the heap */
if(hdr->filter_len > 0)
- hdr->id_len = 1 /* ID flags */
+ hdr->id_len = (unsigned)1 /* ID flags */
+ hdr->sizeof_addr /* Address of filtered object */
+ hdr->sizeof_size /* Length of filtered object */
+ 4 /* Filter mask for filtered object */
+ hdr->sizeof_size; /* Size of de-filtered object in memory */
else
- hdr->id_len = 1 /* ID flags */
+ hdr->id_len = (unsigned)1 /* ID flags */
+ hdr->sizeof_addr /* Address of object */
+ hdr->sizeof_size; /* Length of object */
break;
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 29f4662..49d6d7e 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -214,7 +214,7 @@ H5HF_iblock_unpin(H5HF_indirect_t *iblock)
} /* end if */
/* Indicate that the root indirect block is unpinned */
- iblock->hdr->root_iblock_flags &= ~(H5HF_ROOT_IBLOCK_PINNED);
+ iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED));
} /* end if */
} /* end else */
@@ -751,7 +751,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id)
max_child_row = iblock->max_child / hdr->man_dtable.cparam.width;
/* Compute new # of rows in root indirect block */
- new_nrows = 1 << (1 + H5VM_log2_gen((uint64_t)max_child_row));
+ new_nrows = (unsigned)1 << (1 + H5VM_log2_gen((uint64_t)max_child_row));
/* Check if the indirect block is NOT currently allocated in temp. file space */
/* (temp. file space does not need to be freed) */
@@ -1323,7 +1323,7 @@ H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id,
} /* end if */
/* Indicate that the root indirect block is unprotected */
- iblock->hdr->root_iblock_flags &= ~(H5HF_ROOT_IBLOCK_PROTECTED);
+ iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PROTECTED));
} /* end if */
/* Unprotect the indirect block */
diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c
index 8c321bc..f0d1835 100644
--- a/src/H5HFtiny.c
+++ b/src/H5HFtiny.c
@@ -169,12 +169,12 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size);
/* Encode object into ID */
if(!hdr->tiny_len_extended) {
- *id++ = H5HF_ID_VERS_CURR | H5HF_ID_TYPE_TINY |
- (enc_obj_size & H5HF_TINY_MASK_SHORT);
+ *id++ = (uint8_t)(H5HF_ID_VERS_CURR | H5HF_ID_TYPE_TINY |
+ (enc_obj_size & H5HF_TINY_MASK_SHORT));
} /* end if */
else {
- *id++ = H5HF_ID_VERS_CURR | H5HF_ID_TYPE_TINY |
- ((enc_obj_size & H5HF_TINY_MASK_EXT_1) >> 8);
+ *id++ = (uint8_t)(H5HF_ID_VERS_CURR | H5HF_ID_TYPE_TINY |
+ ((enc_obj_size & H5HF_TINY_MASK_EXT_1) >> 8));
*id++ = enc_obj_size & H5HF_TINY_MASK_EXT_2;
} /* end else */
HDmemcpy(id, obj, obj_size);
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index bf7252e..e917263 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -2155,7 +2155,6 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
H5O_storage_virtual_ent_t *old_list = NULL; /* List pointer previously on property list */
H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */
hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */
- hbool_t adding_entry = FALSE; /* Whether we are in the middle of adding an entry */
hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2229,7 +2228,6 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
HDmemset(ent, 0, sizeof(H5O_storage_virtual_ent_t)); /* Clear before starting to set up */
if(NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, FALSE, TRUE)))
HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection")
- adding_entry = TRUE;
if(NULL == (ent->source_file_name = HDstrdup(src_file_name)))
HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't duplicate source file name")
if(NULL == (ent->source_dset_name = HDstrdup(src_dset_name)))
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c
index e975840..aafcb91 100644
--- a/src/H5SMbtree2.c
+++ b/src/H5SMbtree2.c
@@ -45,7 +45,7 @@
/********************/
/* v2 B-tree callbacks */
-static void *H5SM_bt2_crt_context(void *udata);
+static void *H5SM__bt2_crt_context(void *udata);
static herr_t H5SM_bt2_dst_context(void *ctx);
static herr_t H5SM_bt2_store(void *native, const void *udata);
static herr_t H5SM_bt2_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
@@ -61,7 +61,7 @@ const H5B2_class_t H5SM_INDEX[1]={{ /* B-tree class information */
H5B2_SOHM_INDEX_ID, /* Type of B-tree */
"H5B2_SOHM_INDEX_ID", /* Name of B-tree class */
sizeof(H5SM_sohm_t), /* Size of native record */
- H5SM_bt2_crt_context, /* Create client callback context */
+ H5SM__bt2_crt_context, /* Create client callback context */
H5SM_bt2_dst_context, /* Destroy client callback context */
H5SM_bt2_store, /* Record storage callback */
H5SM_message_compare, /* Record comparison callback */
@@ -83,7 +83,7 @@ H5FL_DEFINE_STATIC(H5SM_bt2_ctx_t);
/*-------------------------------------------------------------------------
- * Function: H5SM_bt2_crt_context
+ * Function: H5SM__bt2_crt_context
*
* Purpose: Create client callback context
*
@@ -96,13 +96,13 @@ H5FL_DEFINE_STATIC(H5SM_bt2_ctx_t);
*-------------------------------------------------------------------------
*/
static void *
-H5SM_bt2_crt_context(void *_f)
+H5SM__bt2_crt_context(void *_f)
{
H5F_t *f = (H5F_t *)_f; /* User data for building callback context */
H5SM_bt2_ctx_t *ctx; /* Callback context structure */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -119,7 +119,7 @@ H5SM_bt2_crt_context(void *_f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5SM_bt2_crt_context() */
+} /* H5SM__bt2_crt_context() */
/*-------------------------------------------------------------------------
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index eabe211..cbe108a 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -436,7 +436,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] =
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE unsigned H5_ATTR_UNUSED
+static H5_INLINE H5_ATTR_PURE unsigned
H5VM_log2_of2(uint32_t n)
{
#ifndef NDEBUG
@@ -457,7 +457,7 @@ H5VM_log2_of2(uint32_t n)
*
*-------------------------------------------------------------------------
*/
-static H5_INLINE hsize_t H5_ATTR_UNUSED
+static H5_INLINE H5_ATTR_CONST hsize_t
H5VM_power2up(hsize_t n)
{
hsize_t ret_value = 1; /* Return value */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 7de0060..0dc12a3 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -49,7 +49,7 @@ static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t spac
static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts,
const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf);
static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, size_t dtype_size);
-static unsigned H5Z_scaleoffset_log2(unsigned long long num);
+static H5_ATTR_CONST unsigned H5Z_scaleoffset_log2(unsigned long long num);
static void H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts,
enum H5Z_scaleoffset_t type, unsigned filavail, const unsigned cd_values[],
uint32_t *minbits, unsigned long long *minval);
diff --git a/src/H5private.h b/src/H5private.h
index 911dbc8..23046cf 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -301,17 +301,23 @@
*/
#ifdef __cplusplus
# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
-# define H5_ATTR_UNUSED /*void*/
-# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_UNUSED /*void*/
+# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_CONST /*void*/
+# define H5_ATTR_PURE /*void*/
#else /* __cplusplus */
#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C)
# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z)))
-# define H5_ATTR_UNUSED __attribute__((unused))
-# define H5_ATTR_NORETURN __attribute__((noreturn))
+# define H5_ATTR_UNUSED __attribute__((unused))
+# define H5_ATTR_NORETURN __attribute__((noreturn))
+# define H5_ATTR_CONST __attribute__((const))
+# define H5_ATTR_PURE __attribute__((pure))
#else
# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
-# define H5_ATTR_UNUSED /*void*/
-# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_UNUSED /*void*/
+# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_CONST /*void*/
+# define H5_ATTR_PURE /*void*/
#endif
#endif /* __cplusplus */
@@ -800,7 +806,7 @@ typedef struct {
H5_DLL int Pflock(int fd, int operation);
#define HDflock(F,L) Pflock(F,L)
#else
- H5_DLL int Nflock(int fd, int operation);
+ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#define HDflock(F,L) Nflock(F,L)
#endif /* H5_HAVE_FLOCK */
#endif /* HDflock */
diff --git a/src/H5system.c b/src/H5system.c
index 5bca82a..c72a8df 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -32,11 +32,10 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Fprivate.h" /* File access */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Eprivate.h"
-
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5MMprivate.h" /* Memory management */
/****************/