summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-01-06 15:48:25 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-01-06 15:48:25 (GMT)
commit11c3b4fdeb8c86a782eabd756b8c82a649ab0812 (patch)
tree19f4a4428cab082e8200eb475b88658641677499 /src
parent282692288961cc76fadafb94a067a8a28b982e9e (diff)
downloadhdf5-11c3b4fdeb8c86a782eabd756b8c82a649ab0812.zip
hdf5-11c3b4fdeb8c86a782eabd756b8c82a649ab0812.tar.gz
hdf5-11c3b4fdeb8c86a782eabd756b8c82a649ab0812.tar.bz2
[svn-r28812] Description:
Bring r28811 from trunk to revise_chunks branch: Switch v2 B-tree min & max records to be void*'s to be cleaner and generate less warnings. Tested on: Linux/32 2.6.x (jam) w/serial MacOSX/64 10.11.2 (amazon) w/serial & parallel
Diffstat (limited to 'src')
-rw-r--r--src/H5B2.c8
-rw-r--r--src/H5B2int.c8
-rw-r--r--src/H5B2pkg.h4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/H5B2.c b/src/H5B2.c
index 611b0eb..62cd47e 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -642,7 +642,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
- if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->min_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
@@ -650,7 +650,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
- if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->max_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
@@ -1316,7 +1316,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
- if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->min_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
@@ -1324,7 +1324,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
- if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->max_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
diff --git a/src/H5B2int.c b/src/H5B2int.c
index e66d430..a9c9ecc 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -2388,7 +2388,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
- if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->min_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
@@ -2396,7 +2396,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
- if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->max_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
@@ -2689,7 +2689,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr
if(idx == 0) {
if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->min_native_rec == NULL)
- if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->min_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info")
HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
@@ -2697,7 +2697,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr
if(idx == (unsigned)(leaf->nrec - 1)) {
if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) {
if(hdr->max_native_rec == NULL)
- if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size)))
+ if(NULL == (hdr->max_native_rec = H5MM_malloc(hdr->cls->nrec_size)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info")
HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size);
} /* end if */
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h
index b6410fd..46f3d83 100644
--- a/src/H5B2pkg.h
+++ b/src/H5B2pkg.h
@@ -186,8 +186,8 @@ typedef struct H5B2_hdr_t {
hbool_t swmr_write; /* Whether we are doing SWMR writes */
struct H5B2_leaf_t *shadowed_leaf; /* Linked list of shadowed leaf nodes */
struct H5B2_internal_t *shadowed_internal; /* Linked list of shadowed internal nodes */
- uint8_t *min_native_rec; /* Pointer to minimum native record */
- uint8_t *max_native_rec; /* Pointer to maximum native record */
+ void *min_native_rec; /* Pointer to minimum native record */
+ void *max_native_rec; /* Pointer to maximum native record */
/* Client information (not stored) */
const H5B2_class_t *cls; /* Class of B-tree client */