diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-04-23 18:25:16 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-04-23 18:25:16 (GMT) |
commit | f098d20ab95c885414f82ee310b3692929e76227 (patch) | |
tree | 8f9eaca942902a988ccc12e983144d6b3d0b04c4 /src/H5B2int.c | |
parent | b1f8b21130a4f95d2dcd4b9343ed05e93c33f35c (diff) | |
download | hdf5-f098d20ab95c885414f82ee310b3692929e76227.zip hdf5-f098d20ab95c885414f82ee310b3692929e76227.tar.gz hdf5-f098d20ab95c885414f82ee310b3692929e76227.tar.bz2 |
[svn-r16847] Description:
Bring r16846 from revise_chunks branch back to trunk:
Fix broken (for how long?) H5_ASSIGN_OVERFLOW macro to actually detect
overflows during assignments, along with several errors it [now] detected.
Cleaned up a fix minor warnings and/or pieces of code also.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
(h5committest not needed - multi-platform test performed on branch)
Diffstat (limited to 'src/H5B2int.c')
-rw-r--r-- | src/H5B2int.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5B2int.c b/src/H5B2int.c index b5d4048..f0213ce 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -207,7 +207,7 @@ HDmemset(shared->page, 0, shared->node_size); /* Compute size to store # of records in each node */ /* (uses leaf # of records because its the largest) */ u_max_nrec_size = H5V_limit_enc_size((uint64_t)shared->node_info[0].max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ shared->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ unsigned char) + H5_ASSIGN_OVERFLOW(/* To: */ shared->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) HDassert(shared->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); /* Initialize internal node info */ @@ -223,7 +223,7 @@ HDmemset(shared->page, 0, shared->node_size); shared->node_info[u].cum_max_nrec = ((shared->node_info[u].max_nrec + 1) * shared->node_info[u - 1].cum_max_nrec) + shared->node_info[u].max_nrec; u_max_nrec_size = H5V_limit_enc_size((uint64_t)shared->node_info[u].cum_max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ shared->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ unsigned char) + H5_ASSIGN_OVERFLOW(/* To: */ shared->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) if((shared->node_info[u].nat_rec_fac = H5FL_fac_init(shared->type->nrec_size * shared->node_info[u].max_nrec)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") @@ -586,7 +586,7 @@ H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_t *bt2, unsigned *bt2_flags_ptr) shared->node_info[shared->depth].cum_max_nrec = ((shared->node_info[shared->depth].max_nrec + 1) * shared->node_info[shared->depth - 1].cum_max_nrec) + shared->node_info[shared->depth].max_nrec; u_max_nrec_size = H5V_limit_enc_size((uint64_t)shared->node_info[shared->depth].cum_max_nrec); - H5_ASSIGN_OVERFLOW(/* To: */ shared->node_info[shared->depth].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ unsigned char) + H5_ASSIGN_OVERFLOW(/* To: */ shared->node_info[shared->depth].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t) if((shared->node_info[shared->depth].nat_rec_fac = H5FL_fac_init(shared->type->nrec_size * shared->node_info[shared->depth].max_nrec)) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory") if((shared->node_info[shared->depth].node_ptr_fac = H5FL_fac_init(sizeof(H5B2_node_ptr_t) * (shared->node_info[shared->depth].max_nrec + 1))) == NULL) |